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 
93  void PrintSelf(ostream& os, vtkIndent indent);
95 
97 
107 
115 
117 
123  vtkGetObjectMacro(Locator,vtkAbstractPointLocator);
125 
127 
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
abstract class to quickly locate points in 3-space
Proxy object to connect input/output ports.
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:39
general representation of visualization data
Definition: vtkDataObject.h:65
Superclass for algorithms that produce output of the same type as input.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
dynamic, self-adjusting array of double
list of point or cell ids
Definition: vtkIdList.h:37
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
base class for interpolation kernels
virtual void Modified()
Update the modification time for this object.
interpolate over point cloud using various kernels
vtkMTimeType GetMTime()
Get the MTime of this object also considering the locator and kernel.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
vtkCharArray * ValidPointsMask
vtkInterpolationKernel * Kernel
int GetNumberOfExcludedArrays()
Return the number of excluded arrays.
std::vector< vtkStdString > ExcludedArrays
void AddExcludedArray(const vtkStdString &excludedArray)
Adds an array to the list of arrays which are to be excluded from the interpolation process.
vtkStdString ValidPointsMaskArrayName
void SetSourceData(vtkDataObject *source)
Specify the dataset Pc that will be probed by the input points P.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void PassAttributeData(vtkDataSet *input, vtkDataObject *source, vtkDataSet *output)
Call at end of RequestData() to pass attribute data respecting the PassCellArrays,...
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
Specify the dataset Pc that will be probed by the input points P.
virtual void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output)
Virtual for specialized subclass(es)
vtkDataObject * GetSource()
vtkAbstractPointLocator * Locator
void SetKernel(vtkInterpolationKernel *kernel)
Specify an interpolation kernel.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks for Information.
void ExtractImageDescription(vtkImageData *input, int dims[3], double origin[3], double spacing[3])
Internal method to extract image metadata.
const char * GetExcludedArray(int i)
Return the name of the ith excluded array.
void ClearExcludedArrays()
Clears the contents of excluded array list.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
static vtkPointInterpolator * New()
Standard methods for instantiating, obtaining type information, and printing.
void SetLocator(vtkAbstractPointLocator *locator)
Specify a point locator.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
@ spacing
Definition: vtkX3D.h:481
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248