VTK  9.3.1
vtkPointInterpolator.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
56 #ifndef vtkPointInterpolator_h
57 #define vtkPointInterpolator_h
58 
59 #include "vtkDataSetAlgorithm.h"
60 #include "vtkFiltersPointsModule.h" // For export macro
61 #include "vtkStdString.h" // For vtkStdString ivars
62 #include <vector> //For STL vector
63 
64 VTK_ABI_NAMESPACE_BEGIN
66 class vtkIdList;
67 class vtkDoubleArray;
69 class vtkCharArray;
70 
71 class VTKFILTERSPOINTS_EXPORT vtkPointInterpolator : public vtkDataSetAlgorithm
72 {
73 public:
75 
79  static vtkPointInterpolator* New();
81  void PrintSelf(ostream& os, vtkIndent indent) override;
83 
85 
92  void SetSourceData(vtkDataObject* source);
93  vtkDataObject* GetSource();
95 
102  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
103 
105 
110  void SetLocator(vtkAbstractPointLocator* locator);
111  vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
113 
115 
120  void SetKernel(vtkInterpolationKernel* kernel);
121  vtkGetObjectMacro(Kernel, vtkInterpolationKernel);
123 
124  enum Strategy
125  {
126  MASK_POINTS = 0,
127  NULL_VALUE = 1,
128  CLOSEST_POINT = 2
129  };
130 
132 
143  vtkSetMacro(NullPointsStrategy, int);
144  vtkGetMacro(NullPointsStrategy, int);
145  void SetNullPointsStrategyToMaskPoints() { this->SetNullPointsStrategy(MASK_POINTS); }
146  void SetNullPointsStrategyToNullValue() { this->SetNullPointsStrategy(NULL_VALUE); }
147  void SetNullPointsStrategyToClosestPoint() { this->SetNullPointsStrategy(CLOSEST_POINT); }
149 
151 
157  vtkSetMacro(ValidPointsMaskArrayName, vtkStdString);
158  vtkGetMacro(ValidPointsMaskArrayName, vtkStdString);
160 
162 
167  vtkSetMacro(NullValue, double);
168  vtkGetMacro(NullValue, double);
170 
172 
176  void AddExcludedArray(const vtkStdString& excludedArray)
177  {
178  this->ExcludedArrays.push_back(excludedArray);
179  this->Modified();
180  }
182 
184 
188  {
189  this->ExcludedArrays.clear();
190  this->Modified();
191  }
193 
197  int GetNumberOfExcludedArrays() { return static_cast<int>(this->ExcludedArrays.size()); }
198 
200 
203  const char* GetExcludedArray(int i)
204  {
205  if (i < 0 || i >= static_cast<int>(this->ExcludedArrays.size()))
206  {
207  return nullptr;
208  }
209  return this->ExcludedArrays[i].c_str();
210  }
212 
214 
220  vtkSetMacro(PromoteOutputArrays, bool);
221  vtkBooleanMacro(PromoteOutputArrays, bool);
222  vtkGetMacro(PromoteOutputArrays, bool);
224 
226 
230  vtkSetMacro(PassPointArrays, bool);
231  vtkBooleanMacro(PassPointArrays, bool);
232  vtkGetMacro(PassPointArrays, bool);
234 
236 
240  vtkSetMacro(PassCellArrays, bool);
241  vtkBooleanMacro(PassCellArrays, bool);
242  vtkGetMacro(PassCellArrays, bool);
244 
246 
250  vtkSetMacro(PassFieldArrays, bool);
251  vtkBooleanMacro(PassFieldArrays, bool);
252  vtkGetMacro(PassFieldArrays, bool);
254 
258  vtkMTimeType GetMTime() override;
259 
260 protected:
262  ~vtkPointInterpolator() override;
263 
266 
268  double NullValue;
271 
272  std::vector<vtkStdString> ExcludedArrays;
273 
275 
279 
283 
287  virtual void Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet* output);
288 
293  virtual void PassAttributeData(vtkDataSet* input, vtkDataObject* source, vtkDataSet* output);
294 
298  void ExtractImageDescription(
299  vtkImageData* input, int dims[3], double origin[3], double spacing[3]);
300 
301 private:
303  void operator=(const vtkPointInterpolator&) = delete;
304 };
305 
306 VTK_ABI_NAMESPACE_END
307 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:28
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:270
abstract class to specify dataset behavior
Definition: vtkDataSet.h:52
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:40
int GetNumberOfExcludedArrays()
Return the number of excluded arrays.
a simple class to control print indentation
Definition: vtkIndent.h:28
abstract class to quickly locate points in 3-space
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
list of point or cell ids
Definition: vtkIdList.h:22
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:54
static vtkDataSetAlgorithm * New()
vtkAbstractPointLocator * Locator
interpolate over point cloud using various kernels