VTK  9.2.5
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 =========================================================================*/
97 #ifndef vtkPointInterpolator_h
98 #define vtkPointInterpolator_h
99 
100 #include "vtkDataSetAlgorithm.h"
101 #include "vtkFiltersPointsModule.h" // For export macro
102 #include "vtkStdString.h" // For vtkStdString ivars
103 #include <vector> //For STL vector
104 
106 class vtkIdList;
107 class vtkDoubleArray;
109 class vtkCharArray;
110 
111 class VTKFILTERSPOINTS_EXPORT vtkPointInterpolator : public vtkDataSetAlgorithm
112 {
113 public:
115 
121  void PrintSelf(ostream& os, vtkIndent indent) override;
123 
125 
135 
143 
145 
151  vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
153 
155 
161  vtkGetObjectMacro(Kernel, vtkInterpolationKernel);
163 
164  enum Strategy
165  {
166  MASK_POINTS = 0,
167  NULL_VALUE = 1,
168  CLOSEST_POINT = 2
169  };
170 
172 
183  vtkSetMacro(NullPointsStrategy, int);
184  vtkGetMacro(NullPointsStrategy, int);
185  void SetNullPointsStrategyToMaskPoints() { this->SetNullPointsStrategy(MASK_POINTS); }
186  void SetNullPointsStrategyToNullValue() { this->SetNullPointsStrategy(NULL_VALUE); }
187  void SetNullPointsStrategyToClosestPoint() { this->SetNullPointsStrategy(CLOSEST_POINT); }
189 
191 
197  vtkSetMacro(ValidPointsMaskArrayName, vtkStdString);
198  vtkGetMacro(ValidPointsMaskArrayName, vtkStdString);
200 
202 
207  vtkSetMacro(NullValue, double);
208  vtkGetMacro(NullValue, double);
210 
212 
216  void AddExcludedArray(const vtkStdString& excludedArray)
217  {
218  this->ExcludedArrays.push_back(excludedArray);
219  this->Modified();
220  }
222 
224 
228  {
229  this->ExcludedArrays.clear();
230  this->Modified();
231  }
233 
237  int GetNumberOfExcludedArrays() { return static_cast<int>(this->ExcludedArrays.size()); }
238 
240 
243  const char* GetExcludedArray(int i)
244  {
245  if (i < 0 || i >= static_cast<int>(this->ExcludedArrays.size()))
246  {
247  return nullptr;
248  }
249  return this->ExcludedArrays[i].c_str();
250  }
252 
254 
260  vtkSetMacro(PromoteOutputArrays, bool);
261  vtkBooleanMacro(PromoteOutputArrays, bool);
262  vtkGetMacro(PromoteOutputArrays, bool);
264 
266 
270  vtkSetMacro(PassPointArrays, bool);
271  vtkBooleanMacro(PassPointArrays, bool);
272  vtkGetMacro(PassPointArrays, bool);
274 
276 
280  vtkSetMacro(PassCellArrays, bool);
281  vtkBooleanMacro(PassCellArrays, bool);
282  vtkGetMacro(PassCellArrays, bool);
284 
286 
290  vtkSetMacro(PassFieldArrays, bool);
291  vtkBooleanMacro(PassFieldArrays, bool);
292  vtkGetMacro(PassFieldArrays, bool);
294 
298  vtkMTimeType GetMTime() override;
299 
300 protected:
303 
306 
308  double NullValue;
311 
312  std::vector<vtkStdString> ExcludedArrays;
313 
315 
319 
323 
327  virtual void Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet* output);
328 
333  virtual void PassAttributeData(vtkDataSet* input, vtkDataObject* source, vtkDataSet* output);
334 
339  vtkImageData* input, int dims[3], double origin[3], double spacing[3]);
340 
341 private:
343  void operator=(const vtkPointInterpolator&) = delete;
344 };
345 
346 #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:71
general representation of visualization data
Superclass for algorithms that produce output of the same type as input.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:172
dynamic, self-adjusting array of double
list of point or cell ids
Definition: vtkIdList.h:143
topologically and geometrically regular array of data
Definition: vtkImageData.h:163
a simple class to control print indentation
Definition: vtkIndent.h:119
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
vtkCharArray * ValidPointsMask
vtkInterpolationKernel * Kernel
int GetNumberOfExcludedArrays()
Return the number of excluded arrays.
std::vector< vtkStdString > ExcludedArrays
void SetNullPointsStrategyToNullValue()
Specify a strategy to use when encountering a "null" point during the interpolation process.
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) override
Standard methods for instantiating, obtaining type information, and printing.
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.
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
virtual void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output)
Virtual for specialized subclass(es)
void SetNullPointsStrategyToClosestPoint()
Specify a strategy to use when encountering a "null" point during the interpolation process.
vtkDataObject * GetSource()
Specify the dataset Pc that will be probed by the input points P.
vtkAbstractPointLocator * Locator
void SetKernel(vtkInterpolationKernel *kernel)
Specify an interpolation kernel.
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.
~vtkPointInterpolator() override
void ClearExcludedArrays()
Clears the contents of excluded array list.
void SetNullPointsStrategyToMaskPoints()
Specify a strategy to use when encountering a "null" point during the interpolation process.
vtkMTimeType GetMTime() override
Get the MTime of this object also considering the locator and kernel.
static vtkPointInterpolator * New()
Standard methods for instantiating, obtaining type information, and printing.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks for Information.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
void SetLocator(vtkAbstractPointLocator *locator)
Specify a point locator.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:108
@ spacing
Definition: vtkX3D.h:487
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287