VTK  9.2.6
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 "vtkDataSetAlgorithm.h"
72 #include "vtkFiltersPointsModule.h" // For export macro
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 class VTKFILTERSPOINTS_EXPORT vtkPointInterpolator : public vtkDataSetAlgorithm
83 {
84 public:
86 
90  static vtkPointInterpolator* New();
92  void PrintSelf(ostream& os, vtkIndent indent) override;
94 
96 
103  void SetSourceData(vtkDataObject* source);
104  vtkDataObject* GetSource();
106 
113  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
114 
116 
121  void SetLocator(vtkAbstractPointLocator* locator);
122  vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
124 
126 
131  void SetKernel(vtkInterpolationKernel* kernel);
132  vtkGetObjectMacro(Kernel, vtkInterpolationKernel);
134 
135  enum Strategy
136  {
137  MASK_POINTS = 0,
138  NULL_VALUE = 1,
139  CLOSEST_POINT = 2
140  };
141 
143 
154  vtkSetMacro(NullPointsStrategy, int);
155  vtkGetMacro(NullPointsStrategy, int);
156  void SetNullPointsStrategyToMaskPoints() { this->SetNullPointsStrategy(MASK_POINTS); }
157  void SetNullPointsStrategyToNullValue() { this->SetNullPointsStrategy(NULL_VALUE); }
158  void SetNullPointsStrategyToClosestPoint() { this->SetNullPointsStrategy(CLOSEST_POINT); }
160 
162 
168  vtkSetMacro(ValidPointsMaskArrayName, vtkStdString);
169  vtkGetMacro(ValidPointsMaskArrayName, vtkStdString);
171 
173 
178  vtkSetMacro(NullValue, double);
179  vtkGetMacro(NullValue, double);
181 
183 
187  void AddExcludedArray(const vtkStdString& excludedArray)
188  {
189  this->ExcludedArrays.push_back(excludedArray);
190  this->Modified();
191  }
193 
195 
199  {
200  this->ExcludedArrays.clear();
201  this->Modified();
202  }
204 
208  int GetNumberOfExcludedArrays() { return static_cast<int>(this->ExcludedArrays.size()); }
209 
211 
214  const char* GetExcludedArray(int i)
215  {
216  if (i < 0 || i >= static_cast<int>(this->ExcludedArrays.size()))
217  {
218  return nullptr;
219  }
220  return this->ExcludedArrays[i].c_str();
221  }
223 
225 
231  vtkSetMacro(PromoteOutputArrays, bool);
232  vtkBooleanMacro(PromoteOutputArrays, bool);
233  vtkGetMacro(PromoteOutputArrays, bool);
235 
237 
241  vtkSetMacro(PassPointArrays, bool);
242  vtkBooleanMacro(PassPointArrays, bool);
243  vtkGetMacro(PassPointArrays, bool);
245 
247 
251  vtkSetMacro(PassCellArrays, bool);
252  vtkBooleanMacro(PassCellArrays, bool);
253  vtkGetMacro(PassCellArrays, bool);
255 
257 
261  vtkSetMacro(PassFieldArrays, bool);
262  vtkBooleanMacro(PassFieldArrays, bool);
263  vtkGetMacro(PassFieldArrays, bool);
265 
269  vtkMTimeType GetMTime() override;
270 
271 protected:
273  ~vtkPointInterpolator() override;
274 
277 
279  double NullValue;
282 
283  std::vector<vtkStdString> ExcludedArrays;
284 
286 
290 
294 
298  virtual void Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet* output);
299 
304  virtual void PassAttributeData(vtkDataSet* input, vtkDataObject* source, vtkDataSet* output);
305 
309  void ExtractImageDescription(
310  vtkImageData* input, int dims[3], double origin[3], double spacing[3]);
311 
312 private:
314  void operator=(const vtkPointInterpolator&) = delete;
315 };
316 
317 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
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:287
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
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:51
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:53
list of point or cell ids
Definition: vtkIdList.h:33
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:65
static vtkDataSetAlgorithm * New()
vtkAbstractPointLocator * Locator
interpolate over point cloud using various kernels