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 =========================================================================*/
68 #ifndef vtkPointInterpolator_h
69 #define vtkPointInterpolator_h
70 
71 #include "vtkFiltersPointsModule.h" // For export macro
72 #include "vtkDataSetAlgorithm.h"
73 #include "vtkStdString.h" // For vtkStdString ivars
74 #include <vector> //For STL vector
75 
77 class vtkIdList;
78 class vtkDoubleArray;
80 class vtkCharArray;
81 
82 
83 class VTKFILTERSPOINTS_EXPORT vtkPointInterpolator : public vtkDataSetAlgorithm
84 {
85 public:
87 
91  static vtkPointInterpolator *New();
93  void PrintSelf(ostream& os, vtkIndent indent);
95 
97 
104  void SetSourceData(vtkDataObject *source);
105  vtkDataObject *GetSource();
107 
114  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
115 
117 
122  void SetLocator(vtkAbstractPointLocator *locator);
123  vtkGetObjectMacro(Locator,vtkAbstractPointLocator);
125 
127 
132  void SetKernel(vtkInterpolationKernel *kernel);
133  vtkGetObjectMacro(Kernel,vtkInterpolationKernel);
135 
136  enum Strategy
137  {
138  MASK_POINTS=0,
139  NULL_VALUE=1,
140  CLOSEST_POINT=2
141  };
142 
144 
155  vtkSetMacro(NullPointsStrategy,int);
156  vtkGetMacro(NullPointsStrategy,int);
158  { this->SetNullPointsStrategy(MASK_POINTS); }
160  { this->SetNullPointsStrategy(NULL_VALUE); }
162  { this->SetNullPointsStrategy(CLOSEST_POINT); }
164 
166 
172  vtkSetMacro(ValidPointsMaskArrayName, vtkStdString);
173  vtkGetMacro(ValidPointsMaskArrayName, vtkStdString);
175 
177 
182  vtkSetMacro(NullValue,double);
183  vtkGetMacro(NullValue,double);
185 
187 
191  void AddExcludedArray(const vtkStdString &excludedArray)
192  {
193  this->ExcludedArrays.push_back(excludedArray);
194  this->Modified();
195  }
197 
199 
203  {
204  this->ExcludedArrays.clear();
205  this->Modified();
206  }
208 
213  {return static_cast<int>(this->ExcludedArrays.size());}
214 
216 
219  const char* GetExcludedArray(int i)
220  {
221  if ( i < 0 || i >= static_cast<int>(this->ExcludedArrays.size()) )
222  {
223  return NULL;
224  }
225  return this->ExcludedArrays[i].c_str();
226  }
228 
230 
236  vtkSetMacro(PromoteOutputArrays, bool);
237  vtkBooleanMacro(PromoteOutputArrays, bool);
238  vtkGetMacro(PromoteOutputArrays, bool);
240 
242 
246  vtkSetMacro(PassPointArrays, bool);
247  vtkBooleanMacro(PassPointArrays, bool);
248  vtkGetMacro(PassPointArrays, bool);
250 
252 
256  vtkSetMacro(PassCellArrays, bool);
257  vtkBooleanMacro(PassCellArrays, bool);
258  vtkGetMacro(PassCellArrays, bool);
260 
262 
266  vtkSetMacro(PassFieldArrays, bool);
267  vtkBooleanMacro(PassFieldArrays, bool);
268  vtkGetMacro(PassFieldArrays, bool);
270 
275 
276 protected:
279 
282 
284  double NullValue;
287 
288  std::vector<vtkStdString> ExcludedArrays;
289 
291 
295 
302 
306  virtual void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output);
307 
312  virtual void PassAttributeData(
313  vtkDataSet* input, vtkDataObject* source, vtkDataSet* output);
314 
318  void ExtractImageDescription(vtkImageData *input, int dims[3],
319  double origin[3], double spacing[3]);
320 
321 private:
322  vtkPointInterpolator(const vtkPointInterpolator&) VTK_DELETE_FUNCTION;
323  void operator=(const vtkPointInterpolator&) VTK_DELETE_FUNCTION;
324 
325 };
326 
327 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:47
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.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
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
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
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:38
int GetNumberOfExcludedArrays()
Return the number of excluded arrays.
a simple class to control print indentation
Definition: vtkIndent.h:39
abstract class to quickly locate points in 3-space
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
list of point or cell ids
Definition: vtkIdList.h:36
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.
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 *)
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.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
general representation of visualization data
Definition: vtkDataObject.h:64
static vtkDataSetAlgorithm * New()
vtkAbstractPointLocator * Locator
interpolate over point cloud using various kernels