/usr/include/vtk-7.1/vtkPointInterpolator.h is in libvtk7-dev 7.1.1+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkPointInterpolator.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkPointInterpolator
* @brief interpolate over point cloud using various kernels
*
*
* vtkPointInterpolator probes a point cloud Pc (the filter Source) with a
* set of points P (the filter Input), interpolating the data values from Pc
* onto P. Note however that the descriptive phrase "point cloud" is a
* misnomer: Pc can be represented by any vtkDataSet type, with the points of
* the dataset forming Pc. Similary, the output P can also be represented by
* any vtkDataSet type; and the topology/geometry structure of P is passed
* through to the output along with the newly interpolated arrays.
*
* A key input to this filter is the specification of the interpolation
* kernel, and the parameters which control the associated interpolation
* process. Interpolation kernels include Voronoi, Gaussian, Shepard, and SPH
* (smoothed particle hydrodynamics), with additional kernels to be added in
* the future.
*
* An overview of the algorithm is as follows. For each p from P, Np "close"
* points to p are found. (The meaning of what is "close" can be specified as
* either the N closest points, or all points within a given radius Rp. This
* depends on how the kernel is defined.) Once the Np close points are found,
* then the interpolation kernel is applied to compute new data values
* located on p. Note that for reasonable performance, finding the Np closest
* points requires a point locator. The locator may be specified as input to
* the algorithm. (By default, a vtkStaticPointLocator is used because
* generally it is much faster to build, delete, and search with. However,
* with highly non-uniform point distributions, octree- or kd-tree based
* locators may perform better.)
*
* @warning
* This class has been threaded with vtkSMPTools. Using TBB or other
* non-sequential type (set in the CMake variable
* VTK_SMP_IMPLEMENTATION_TYPE) may improve performance significantly.
*
* @warning
* For widely spaced points in Pc, or when p is located outside the bounding
* region of Pc, the interpolation may behave badly and the interpolation
* process will adapt as necessary to produce output. For example, if the N
* closest points within R are requested to interpolate p, if N=0 then the
* interpolation will switch to a different strategy (which can be controlled
* as in the NullPointsStrategy).
*
* @sa
* vtkPointInterpolator2D vtkProbeFilter vtkGaussianSplatter
* vtkCheckerboardSplatter vtkShepardMethod vtkVoronoiKernel vtkShepardKernel
* vtkGaussianKernel vtkSPHKernel
*/
#ifndef vtkPointInterpolator_h
#define vtkPointInterpolator_h
#include "vtkFiltersPointsModule.h" // For export macro
#include "vtkDataSetAlgorithm.h"
#include "vtkStdString.h" // For vtkStdString ivars
#include <vector> //For STL vector
class vtkAbstractPointLocator;
class vtkIdList;
class vtkDoubleArray;
class vtkInterpolationKernel;
class vtkCharArray;
class VTKFILTERSPOINTS_EXPORT vtkPointInterpolator : public vtkDataSetAlgorithm
{
public:
//@{
/**
* Standard methods for instantiating, obtaining type information, and
* printing.
*/
static vtkPointInterpolator *New();
vtkTypeMacro(vtkPointInterpolator,vtkDataSetAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
//@}
//@{
/**
* Specify the dataset Pc that will be probed by the input points P. The
* Input P defines the dataset structure (the points and cells) for the
* output, while the Source Pc is probed (interpolated) to generate the
* scalars, vectors, etc. for the output points based on the point
* locations.
*/
void SetSourceData(vtkDataObject *source);
vtkDataObject *GetSource();
//@}
/**
* Specify the dataset Pc that will be probed by the input points P. The
* Input P defines the structure (the points and cells) for the output,
* while the Source Pc is probed (interpolated) to generate the scalars,
* vectors, etc. for the output points based on the point locations.
*/
void SetSourceConnection(vtkAlgorithmOutput* algOutput);
//@{
/**
* Specify a point locator. By default a vtkStaticPointLocator is
* used. The locator performs efficient searches to locate near a
* specified interpolation position.
*/
void SetLocator(vtkAbstractPointLocator *locator);
vtkGetObjectMacro(Locator,vtkAbstractPointLocator);
//@}
//@{
/**
* Specify an interpolation kernel. By default a vtkLinearKernel is used
* (i.e., linear combination of closest points). The interpolation kernel
* changes the basis of the interpolation.
*/
void SetKernel(vtkInterpolationKernel *kernel);
vtkGetObjectMacro(Kernel,vtkInterpolationKernel);
//@}
enum Strategy
{
MASK_POINTS=0,
NULL_VALUE=1,
CLOSEST_POINT=2
};
//@{
/**
* Specify a strategy to use when encountering a "null" point during the
* interpolation process. Null points occur when the local neighborhood (of
* nearby points to interpolate from) is empty. If the strategy is set to
* MaskPoints, then an output array is created that marks points as being
* valid (=1) or null (invalid =0) (and the NullValue is set as well). If
* the strategy is set to NullValue (this is the default), then the output
* data value(s) are set to the NullPoint value (specified in the output
* point data). Finally, the strategy ClosestPoint is to simply use the
* closest point to perform the interpolation.
*/
vtkSetMacro(NullPointsStrategy,int);
vtkGetMacro(NullPointsStrategy,int);
void SetNullPointsStrategyToMaskPoints()
{ this->SetNullPointsStrategy(MASK_POINTS); }
void SetNullPointsStrategyToNullValue()
{ this->SetNullPointsStrategy(NULL_VALUE); }
void SetNullPointsStrategyToClosestPoint()
{ this->SetNullPointsStrategy(CLOSEST_POINT); }
//@}
//@{
/**
* If the NullPointsStrategy == MASK_POINTS, then an array is generated for
* each input point. This vtkCharArray is placed into the output of the filter,
* with a non-zero value for a valid point, and zero otherwise. The name of
* this masking array is specified here.
*/
vtkSetMacro(ValidPointsMaskArrayName, vtkStdString);
vtkGetMacro(ValidPointsMaskArrayName, vtkStdString);
//@}
//@{
/**
* Specify the null point value. When a null point is encountered then all
* components of each null tuple are set to this value. By default the
* null value is set to zero.
*/
vtkSetMacro(NullValue,double);
vtkGetMacro(NullValue,double);
//@}
//@{
/**
* Adds an array to the list of arrays which are to be excluded from the
* interpolation process.
*/
void AddExcludedArray(const vtkStdString &excludedArray)
{
this->ExcludedArrays.push_back(excludedArray);
this->Modified();
}
//@}
//@{
/**
* Clears the contents of excluded array list.
*/
void ClearExcludedArrays()
{
this->ExcludedArrays.clear();
this->Modified();
}
//@}
/**
* Return the number of excluded arrays.
*/
int GetNumberOfExcludedArrays()
{return static_cast<int>(this->ExcludedArrays.size());}
//@{
/**
* Return the name of the ith excluded array.
*/
const char* GetExcludedArray(int i)
{
if ( i < 0 || i >= static_cast<int>(this->ExcludedArrays.size()) )
{
return NULL;
}
return this->ExcludedArrays[i].c_str();
}
//@}
//@{
/**
* If enabled, then input arrays that are non-real types (i.e., not float
* or double) are promoted to float type on output. This is because the
* interpolation process may not be well behaved when integral types are
* combined using interpolation weights.
*/
vtkSetMacro(PromoteOutputArrays, bool);
vtkBooleanMacro(PromoteOutputArrays, bool);
vtkGetMacro(PromoteOutputArrays, bool);
//@}
//@{
/**
* Indicate whether to shallow copy the input point data arrays to the
* output. On by default.
*/
vtkSetMacro(PassPointArrays, bool);
vtkBooleanMacro(PassPointArrays, bool);
vtkGetMacro(PassPointArrays, bool);
//@}
//@{
/**
* Indicate whether to shallow copy the input cell data arrays to the
* output. On by default.
*/
vtkSetMacro(PassCellArrays, bool);
vtkBooleanMacro(PassCellArrays, bool);
vtkGetMacro(PassCellArrays, bool);
//@}
//@{
/**
* Indicate whether to pass the field-data arrays from the input to the
* output. On by default.
*/
vtkSetMacro(PassFieldArrays, bool);
vtkBooleanMacro(PassFieldArrays, bool);
vtkGetMacro(PassFieldArrays, bool);
//@}
/**
* Get the MTime of this object also considering the locator and kernel.
*/
vtkMTimeType GetMTime();
protected:
vtkPointInterpolator();
~vtkPointInterpolator();
vtkAbstractPointLocator *Locator;
vtkInterpolationKernel *Kernel;
int NullPointsStrategy;
double NullValue;
vtkStdString ValidPointsMaskArrayName;
vtkCharArray *ValidPointsMask;
std::vector<vtkStdString> ExcludedArrays;
bool PromoteOutputArrays;
bool PassCellArrays;
bool PassPointArrays;
bool PassFieldArrays;
virtual int RequestData(vtkInformation *, vtkInformationVector **,
vtkInformationVector *);
virtual int RequestInformation(vtkInformation *, vtkInformationVector **,
vtkInformationVector *);
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **,
vtkInformationVector *);
/**
* Virtual for specialized subclass(es)
*/
virtual void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output);
/**
* Call at end of RequestData() to pass attribute data respecting the
* PassCellArrays, PassPointArrays, PassFieldArrays flags.
*/
virtual void PassAttributeData(
vtkDataSet* input, vtkDataObject* source, vtkDataSet* output);
/**
* Internal method to extract image metadata
*/
void ExtractImageDescription(vtkImageData *input, int dims[3],
double origin[3], double spacing[3]);
private:
vtkPointInterpolator(const vtkPointInterpolator&) VTK_DELETE_FUNCTION;
void operator=(const vtkPointInterpolator&) VTK_DELETE_FUNCTION;
};
#endif
|