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) VTK_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 NULL;
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() VTK_OVERRIDE;
272 
273 protected:
275  ~vtkPointInterpolator() VTK_OVERRIDE;
276 
279 
280  int NullPointsStrategy;
281  double NullValue;
282  vtkStdString ValidPointsMaskArrayName;
283  vtkCharArray *ValidPointsMask;
284 
285  std::vector<vtkStdString> ExcludedArrays;
286 
287  bool PromoteOutputArrays;
288 
289  bool PassCellArrays;
290  bool PassPointArrays;
291  bool PassFieldArrays;
292 
293  int RequestData(vtkInformation *, vtkInformationVector **,
294  vtkInformationVector *) VTK_OVERRIDE;
295  int RequestInformation(vtkInformation *, vtkInformationVector **,
296  vtkInformationVector *) VTK_OVERRIDE;
297  int RequestUpdateExtent(vtkInformation *, vtkInformationVector **,
298  vtkInformationVector *) VTK_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:
319  vtkPointInterpolator(const vtkPointInterpolator&) VTK_DELETE_FUNCTION;
320  void operator=(const vtkPointInterpolator&) VTK_DELETE_FUNCTION;
321 
322 };
323 
324 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:41
void SetNullPointsStrategyToMaskPoints()
Specify a strategy to use when encountering a &quot;null&quot; point during the interpolation process...
base class for interpolation kernels
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
void SetNullPointsStrategyToNullValue()
Specify a strategy to use when encountering a &quot;null&quot; point during the interpolation process...
void ClearExcludedArrays()
Clears the contents of excluded array list.
void SetNullPointsStrategyToClosestPoint()
Specify a strategy to use when encountering a &quot;null&quot; point during the interpolation process...
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&#39;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 void Modified()
Update the modification time for this object.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Store zero or more vtkInformation instances.
Superclass for algorithms that produce output of the same type as input.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
general representation of visualization data
Definition: vtkDataObject.h:58
static vtkDataSetAlgorithm * New()
interpolate over point cloud using various kernels