VTK  9.4.20250202
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
85#ifndef vtkPointInterpolator_h
86#define vtkPointInterpolator_h
87
88#include "vtkDataSetAlgorithm.h"
89#include "vtkFiltersPointsModule.h" // For export macro
90#include "vtkStdString.h" // For vtkStdString ivars
91#include <vector> //For STL vector
92
93VTK_ABI_NAMESPACE_BEGIN
95class vtkIdList;
96class vtkDoubleArray;
98class vtkCharArray;
99
100class VTKFILTERSPOINTS_EXPORT vtkPointInterpolator : public vtkDataSetAlgorithm
101{
102public:
104
110 void PrintSelf(ostream& os, vtkIndent indent) override;
112
114
124
132
134
140 vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
142
144
150 vtkGetObjectMacro(Kernel, vtkInterpolationKernel);
152
154 {
155 MASK_POINTS = 0,
156 NULL_VALUE = 1,
157 CLOSEST_POINT = 2
158 };
159
161
172 vtkSetMacro(NullPointsStrategy, int);
173 vtkGetMacro(NullPointsStrategy, int);
174 void SetNullPointsStrategyToMaskPoints() { this->SetNullPointsStrategy(MASK_POINTS); }
175 void SetNullPointsStrategyToNullValue() { this->SetNullPointsStrategy(NULL_VALUE); }
176 void SetNullPointsStrategyToClosestPoint() { this->SetNullPointsStrategy(CLOSEST_POINT); }
178
180
186 vtkSetMacro(ValidPointsMaskArrayName, vtkStdString);
187 vtkGetMacro(ValidPointsMaskArrayName, vtkStdString);
189
191
196 vtkSetMacro(NullValue, double);
197 vtkGetMacro(NullValue, double);
199
201
205 void AddExcludedArray(const vtkStdString& excludedArray)
206 {
207 this->ExcludedArrays.push_back(excludedArray);
208 this->Modified();
209 }
211
213
217 {
218 this->ExcludedArrays.clear();
219 this->Modified();
220 }
222
226 int GetNumberOfExcludedArrays() { return static_cast<int>(this->ExcludedArrays.size()); }
227
229
232 const char* GetExcludedArray(int i)
233 {
234 if (i < 0 || i >= static_cast<int>(this->ExcludedArrays.size()))
235 {
236 return nullptr;
237 }
238 return this->ExcludedArrays[i].c_str();
239 }
241
243
249 vtkSetMacro(PromoteOutputArrays, bool);
250 vtkBooleanMacro(PromoteOutputArrays, bool);
251 vtkGetMacro(PromoteOutputArrays, bool);
253
255
259 vtkSetMacro(PassPointArrays, bool);
260 vtkBooleanMacro(PassPointArrays, bool);
261 vtkGetMacro(PassPointArrays, bool);
263
265
269 vtkSetMacro(PassCellArrays, bool);
270 vtkBooleanMacro(PassCellArrays, bool);
271 vtkGetMacro(PassCellArrays, bool);
273
275
279 vtkSetMacro(PassFieldArrays, bool);
280 vtkBooleanMacro(PassFieldArrays, bool);
281 vtkGetMacro(PassFieldArrays, bool);
283
288
289protected:
292
295
297 double NullValue;
300
301 std::vector<vtkStdString> ExcludedArrays;
302
304
308
312
316 virtual void Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet* output);
317
323
328 vtkImageData* input, int dims[3], double origin[3], double spacing[3]);
329
330private:
332 void operator=(const vtkPointInterpolator&) = delete;
333};
334
335VTK_ABI_NAMESPACE_END
336#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:165
dynamic, self-adjusting array of double
list of point or cell ids
Definition vtkIdList.h:133
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
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:270