VTK
vtkPointInterpolator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPointInterpolator.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
65 #ifndef vtkPointInterpolator_h
66 #define vtkPointInterpolator_h
67 
68 #include "vtkFiltersPointsModule.h" // For export macro
69 #include "vtkDataSetAlgorithm.h"
70 #include "vtkStdString.h" // For vtkStdString ivars
71 #include <vector> //For STL vector
72 
74 class vtkIdList;
75 class vtkDoubleArray;
77 class vtkCharArray;
78 
79 
80 class VTKFILTERSPOINTS_EXPORT vtkPointInterpolator : public vtkDataSetAlgorithm
81 {
82 public:
84 
88  static vtkPointInterpolator *New();
90  void PrintSelf(ostream& os, vtkIndent indent) override;
92 
94 
101  void SetSourceData(vtkDataObject *source);
102  vtkDataObject *GetSource();
104 
111  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
112 
114 
119  void SetLocator(vtkAbstractPointLocator *locator);
120  vtkGetObjectMacro(Locator,vtkAbstractPointLocator);
122 
124 
129  void SetKernel(vtkInterpolationKernel *kernel);
130  vtkGetObjectMacro(Kernel,vtkInterpolationKernel);
132 
133  enum Strategy
134  {
135  MASK_POINTS=0,
136  NULL_VALUE=1,
137  CLOSEST_POINT=2
138  };
139 
141 
152  vtkSetMacro(NullPointsStrategy,int);
153  vtkGetMacro(NullPointsStrategy,int);
155  { this->SetNullPointsStrategy(MASK_POINTS); }
157  { this->SetNullPointsStrategy(NULL_VALUE); }
159  { this->SetNullPointsStrategy(CLOSEST_POINT); }
161 
163 
169  vtkSetMacro(ValidPointsMaskArrayName, vtkStdString);
170  vtkGetMacro(ValidPointsMaskArrayName, vtkStdString);
172 
174 
179  vtkSetMacro(NullValue,double);
180  vtkGetMacro(NullValue,double);
182 
184 
188  void AddExcludedArray(const vtkStdString &excludedArray)
189  {
190  this->ExcludedArrays.push_back(excludedArray);
191  this->Modified();
192  }
194 
196 
200  {
201  this->ExcludedArrays.clear();
202  this->Modified();
203  }
205 
210  {return static_cast<int>(this->ExcludedArrays.size());}
211 
213 
216  const char* GetExcludedArray(int i)
217  {
218  if ( i < 0 || i >= static_cast<int>(this->ExcludedArrays.size()) )
219  {
220  return nullptr;
221  }
222  return this->ExcludedArrays[i].c_str();
223  }
225 
227 
233  vtkSetMacro(PromoteOutputArrays, bool);
234  vtkBooleanMacro(PromoteOutputArrays, bool);
235  vtkGetMacro(PromoteOutputArrays, bool);
237 
239 
243  vtkSetMacro(PassPointArrays, bool);
244  vtkBooleanMacro(PassPointArrays, bool);
245  vtkGetMacro(PassPointArrays, bool);
247 
249 
253  vtkSetMacro(PassCellArrays, bool);
254  vtkBooleanMacro(PassCellArrays, bool);
255  vtkGetMacro(PassCellArrays, bool);
257 
259 
263  vtkSetMacro(PassFieldArrays, bool);
264  vtkBooleanMacro(PassFieldArrays, bool);
265  vtkGetMacro(PassFieldArrays, bool);
267 
271  vtkMTimeType GetMTime() override;
272 
273 protected:
275  ~vtkPointInterpolator() override;
276 
279 
281  double NullValue;
284 
285  std::vector<vtkStdString> ExcludedArrays;
286 
288 
292 
294  vtkInformationVector *) override;
296  vtkInformationVector *) override;
298  vtkInformationVector *) override;
299 
303  virtual void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output);
304 
309  virtual void PassAttributeData(
310  vtkDataSet* input, vtkDataObject* source, vtkDataSet* output);
311 
315  void ExtractImageDescription(vtkImageData *input, int dims[3],
316  double origin[3], double spacing[3]);
317 
318 private:
320  void operator=(const vtkPointInterpolator&) = delete;
321 
322 };
323 
324 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
void SetNullPointsStrategyToMaskPoints()
Specify a strategy to use when encountering a "null" point during the interpolation process.
base class for interpolation kernels
vtkStdString ValidPointsMaskArrayName
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
void SetNullPointsStrategyToNullValue()
Specify a strategy to use when encountering a "null" point during the interpolation process.
void ClearExcludedArrays()
Clears the contents of excluded array list.
void SetNullPointsStrategyToClosestPoint()
Specify a strategy to use when encountering a "null" point during the interpolation process.
vtkInterpolationKernel * Kernel
Proxy object to connect input/output ports.
dynamic, self-adjusting array of double
const char * GetExcludedArray(int i)
Return the name of the ith excluded array.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:35
int GetNumberOfExcludedArrays()
Return the number of excluded arrays.
a simple class to control print indentation
Definition: vtkIndent.h:33
abstract class to quickly locate points in 3-space
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
list of point or cell ids
Definition: vtkIdList.h:30
virtual vtkMTimeType GetMTime()
Return this object's modified time.
void AddExcludedArray(const vtkStdString &excludedArray)
Adds an array to the list of arrays which are to be excluded from the interpolation process.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
virtual void Modified()
Update the modification time for this object.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks for Information.
std::vector< vtkStdString > ExcludedArrays
Store zero or more vtkInformation instances.
vtkCharArray * ValidPointsMask
Superclass for algorithms that produce output of the same type as input.
general representation of visualization data
Definition: vtkDataObject.h:58
static vtkDataSetAlgorithm * New()
vtkAbstractPointLocator * Locator
interpolate over point cloud using various kernels