VTK  9.0.1
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 "vtkDataSetAlgorithm.h"
69 #include "vtkFiltersPointsModule.h" // For export macro
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 class VTKFILTERSPOINTS_EXPORT vtkPointInterpolator : public vtkDataSetAlgorithm
80 {
81 public:
83 
87  static vtkPointInterpolator* New();
89  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
93 
100  void SetSourceData(vtkDataObject* source);
101  vtkDataObject* GetSource();
103 
110  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
111 
113 
118  void SetLocator(vtkAbstractPointLocator* locator);
119  vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
121 
123 
128  void SetKernel(vtkInterpolationKernel* kernel);
129  vtkGetObjectMacro(Kernel, vtkInterpolationKernel);
131 
132  enum Strategy
133  {
134  MASK_POINTS = 0,
135  NULL_VALUE = 1,
136  CLOSEST_POINT = 2
137  };
138 
140 
151  vtkSetMacro(NullPointsStrategy, int);
152  vtkGetMacro(NullPointsStrategy, int);
153  void SetNullPointsStrategyToMaskPoints() { this->SetNullPointsStrategy(MASK_POINTS); }
154  void SetNullPointsStrategyToNullValue() { this->SetNullPointsStrategy(NULL_VALUE); }
155  void SetNullPointsStrategyToClosestPoint() { this->SetNullPointsStrategy(CLOSEST_POINT); }
157 
159 
165  vtkSetMacro(ValidPointsMaskArrayName, vtkStdString);
166  vtkGetMacro(ValidPointsMaskArrayName, vtkStdString);
168 
170 
175  vtkSetMacro(NullValue, double);
176  vtkGetMacro(NullValue, double);
178 
180 
184  void AddExcludedArray(const vtkStdString& excludedArray)
185  {
186  this->ExcludedArrays.push_back(excludedArray);
187  this->Modified();
188  }
190 
192 
196  {
197  this->ExcludedArrays.clear();
198  this->Modified();
199  }
201 
205  int GetNumberOfExcludedArrays() { return static_cast<int>(this->ExcludedArrays.size()); }
206 
208 
211  const char* GetExcludedArray(int i)
212  {
213  if (i < 0 || i >= static_cast<int>(this->ExcludedArrays.size()))
214  {
215  return nullptr;
216  }
217  return this->ExcludedArrays[i].c_str();
218  }
220 
222 
228  vtkSetMacro(PromoteOutputArrays, bool);
229  vtkBooleanMacro(PromoteOutputArrays, bool);
230  vtkGetMacro(PromoteOutputArrays, bool);
232 
234 
238  vtkSetMacro(PassPointArrays, bool);
239  vtkBooleanMacro(PassPointArrays, bool);
240  vtkGetMacro(PassPointArrays, bool);
242 
244 
248  vtkSetMacro(PassCellArrays, bool);
249  vtkBooleanMacro(PassCellArrays, bool);
250  vtkGetMacro(PassCellArrays, bool);
252 
254 
258  vtkSetMacro(PassFieldArrays, bool);
259  vtkBooleanMacro(PassFieldArrays, bool);
260  vtkGetMacro(PassFieldArrays, bool);
262 
266  vtkMTimeType GetMTime() override;
267 
268 protected:
270  ~vtkPointInterpolator() override;
271 
274 
276  double NullValue;
279 
280  std::vector<vtkStdString> ExcludedArrays;
281 
283 
287 
291 
295  virtual void Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet* output);
296 
301  virtual void PassAttributeData(vtkDataSet* input, vtkDataObject* source, vtkDataSet* output);
302 
306  void ExtractImageDescription(
307  vtkImageData* input, int dims[3], double origin[3], double spacing[3]);
308 
309 private:
311  void operator=(const vtkPointInterpolator&) = delete;
312 };
313 
314 #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:293
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
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph *>::edge_descriptor e, vtkGraph *)
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:41
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 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.
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:59
static vtkDataSetAlgorithm * New()
vtkAbstractPointLocator * Locator
interpolate over point cloud using various kernels