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=========================================================================*/
77#ifndef vtkPointInterpolator_h
78#define vtkPointInterpolator_h
79
80#include "vtkDataSetAlgorithm.h"
81#include "vtkFiltersPointsModule.h" // For export macro
82#include "vtkStdString.h" // For vtkStdString ivars
83#include <vector> //For STL vector
84
86class vtkIdList;
87class vtkDoubleArray;
89class vtkCharArray;
90
91class VTKFILTERSPOINTS_EXPORT vtkPointInterpolator : public vtkDataSetAlgorithm
92{
93public:
95
101 void PrintSelf(ostream& os, vtkIndent indent) override;
103
105
115
123
125
131 vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
133
135
141 vtkGetObjectMacro(Kernel, vtkInterpolationKernel);
143
145 {
146 MASK_POINTS = 0,
147 NULL_VALUE = 1,
148 CLOSEST_POINT = 2
149 };
150
152
163 vtkSetMacro(NullPointsStrategy, int);
164 vtkGetMacro(NullPointsStrategy, int);
165 void SetNullPointsStrategyToMaskPoints() { this->SetNullPointsStrategy(MASK_POINTS); }
166 void SetNullPointsStrategyToNullValue() { this->SetNullPointsStrategy(NULL_VALUE); }
167 void SetNullPointsStrategyToClosestPoint() { this->SetNullPointsStrategy(CLOSEST_POINT); }
169
171
177 vtkSetMacro(ValidPointsMaskArrayName, vtkStdString);
178 vtkGetMacro(ValidPointsMaskArrayName, vtkStdString);
180
182
187 vtkSetMacro(NullValue, double);
188 vtkGetMacro(NullValue, double);
190
192
196 void AddExcludedArray(const vtkStdString& excludedArray)
197 {
198 this->ExcludedArrays.push_back(excludedArray);
199 this->Modified();
200 }
202
204
208 {
209 this->ExcludedArrays.clear();
210 this->Modified();
211 }
213
217 int GetNumberOfExcludedArrays() { return static_cast<int>(this->ExcludedArrays.size()); }
218
220
223 const char* GetExcludedArray(int i)
224 {
225 if (i < 0 || i >= static_cast<int>(this->ExcludedArrays.size()))
226 {
227 return nullptr;
228 }
229 return this->ExcludedArrays[i].c_str();
230 }
232
234
240 vtkSetMacro(PromoteOutputArrays, bool);
241 vtkBooleanMacro(PromoteOutputArrays, bool);
242 vtkGetMacro(PromoteOutputArrays, bool);
244
246
250 vtkSetMacro(PassPointArrays, bool);
251 vtkBooleanMacro(PassPointArrays, bool);
252 vtkGetMacro(PassPointArrays, bool);
254
256
260 vtkSetMacro(PassCellArrays, bool);
261 vtkBooleanMacro(PassCellArrays, bool);
262 vtkGetMacro(PassCellArrays, bool);
264
266
270 vtkSetMacro(PassFieldArrays, bool);
271 vtkBooleanMacro(PassFieldArrays, bool);
272 vtkGetMacro(PassFieldArrays, bool);
274
279
280protected:
283
286
288 double NullValue;
291
292 std::vector<vtkStdString> ExcludedArrays;
293
295
299
303
307 virtual void Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet* output);
308
314
319 vtkImageData* input, int dims[3], double origin[3], double spacing[3]);
320
321private:
323 void operator=(const vtkPointInterpolator&) = delete;
324};
325
326#endif
abstract class to quickly locate points in 3-space
Proxy object to connect input/output ports.
dynamic, self-adjusting array of char
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:72
dynamic, self-adjusting array of double
list of point or cell ids
Definition vtkIdList.h:43
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:49
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
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.
vtkDataObject * GetSource()
Specify the dataset Pc that will be probed by the input points P.
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.
static vtkPointInterpolator * New()
Standard methods for instantiating, obtaining type information, and printing.
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.
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.
~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.
const char * GetExcludedArray(int i)
Return the name of the ith excluded array.
vtkMTimeType GetMTime() override
Get the MTime of this object also considering the locator and kernel.
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.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287