VTK: Filters/Points/vtkPointInterpolator.h Source File

| 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
65 #ifndef vtkPointInterpolator_h
66 #define vtkPointInterpolator_h
67
68 #include "vtkDataSetAlgorithm.h"
69 #include "vtkFiltersPointsModule.h" // For export macro
70 #include "vtkStdString.h" // For vtkStdString ivars
71 #include <vector> //For STL vector
72
73 VTK_ABI_NAMESPACE_BEGIN
74 class vtkAbstractPointLocator;
75 class vtkIdList;
76 class vtkDoubleArray;
77 class vtkInterpolationKernel;
78 class vtkCharArray;
79
80 class VTKFILTERSPOINTS_EXPORT vtkPointInterpolator : public vtkDataSetAlgorithm
81 {
82 public:
84
88 static vtkPointInterpolator* New();
89 vtkTypeMacro(vtkPointInterpolator, vtkDataSetAlgorithm);
90 void PrintSelf(ostream& os, vtkIndent indent) override;
92
94
101 void SetSourceData(vtkDataObject* source);
102 vtkDataObject* GetSource();
104
111 void SetSourceConnection(vtkAlgorithmOutput* algOutput);
112
114
119 void SetLocator(vtkAbstractPointLocator* locator);
120 vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
122
124
129 void SetKernel(vtkInterpolationKernel* kernel);
130 vtkGetObjectMacro(Kernel, vtkInterpolationKernel);
132
133 enum Strategy
134 {
135 MASK_POINTS = 0,
136 NULL_VALUE = 1,
137 CLOSEST_POINT = 2
138 };
139
141
152 vtkSetMacro(NullPointsStrategy, int);
153 vtkGetMacro(NullPointsStrategy, int);
154 void SetNullPointsStrategyToMaskPoints() { this->SetNullPointsStrategy(MASK_POINTS); }
155 void SetNullPointsStrategyToNullValue() { this->SetNullPointsStrategy(NULL_VALUE); }
156 void SetNullPointsStrategyToClosestPoint() { this->SetNullPointsStrategy(CLOSEST_POINT); }
158
160
166 vtkSetMacro(ValidPointsMaskArrayName, vtkStdString);
167 vtkGetMacro(ValidPointsMaskArrayName, vtkStdString);
169
171
176 vtkSetMacro(NullValue, double);
177 vtkGetMacro(NullValue, double);
179
181
185 void AddExcludedArray(const vtkStdString& excludedArray)
186 {
187 this->ExcludedArrays.push_back(excludedArray);
188 this->Modified();
189 }
191
193
196 void ClearExcludedArrays()
197 {
198 this->ExcludedArrays.clear();
199 this->Modified();
200 }
202
206 int GetNumberOfExcludedArrays() { return static_cast<int>(this->ExcludedArrays.size()); }
207
209
212 const char* GetExcludedArray(int i)
213 {
214 if (i < 0 || i >= static_cast<int>(this->ExcludedArrays.size()))
215 {
216 return nullptr;
217 }
218 return this->ExcludedArrays[i].c_str();
219 }
221
223
229 vtkSetMacro(PromoteOutputArrays, bool);
230 vtkBooleanMacro(PromoteOutputArrays, bool);
231 vtkGetMacro(PromoteOutputArrays, bool);
233
235
239 vtkSetMacro(PassPointArrays, bool);
240 vtkBooleanMacro(PassPointArrays, bool);
241 vtkGetMacro(PassPointArrays, bool);
243
245
249 vtkSetMacro(PassCellArrays, bool);
250 vtkBooleanMacro(PassCellArrays, bool);
251 vtkGetMacro(PassCellArrays, bool);
253
255
259 vtkSetMacro(PassFieldArrays, bool);
260 vtkBooleanMacro(PassFieldArrays, bool);
261 vtkGetMacro(PassFieldArrays, bool);
263
267 vtkMTimeType GetMTime() override;
268
269 protected:
270 vtkPointInterpolator();
271 ~vtkPointInterpolator() override;
272
273 vtkAbstractPointLocator* Locator;
274 vtkInterpolationKernel* Kernel;
275
276 int NullPointsStrategy;
277 double NullValue;
278 vtkStdString ValidPointsMaskArrayName;
279 vtkCharArray* ValidPointsMask;
280
281 std::vector<vtkStdString> ExcludedArrays;
282
283 bool PromoteOutputArrays;
284
285 bool PassCellArrays;
286 bool PassPointArrays;
287 bool PassFieldArrays;
288
289 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
290 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
291 int RequestUpdateExtent(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
292
296 virtual void Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet* output);
297
302 virtual void PassAttributeData(vtkDataSet* input, vtkDataObject* source, vtkDataSet* output);
303
307 void ExtractImageDescription(
308 vtkImageData* input, int dims[3], double origin[3], double spacing[3]);
309
310 private:
311 vtkPointInterpolator(const vtkPointInterpolator&) = delete;
312 void operator=(const vtkPointInterpolator&) = delete;
313 };
314
315 VTK_ABI_NAMESPACE_END
316 #endif
vtkAbstractPointLocator
abstract class to quickly locate points in 3-space
Definition: vtkAbstractPointLocator.h:31
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:41
vtkCharArray
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:50
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:38
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:40
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:32
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkInterpolationKernel
base class for interpolation kernels
Definition: vtkInterpolationKernel.h:53
vtkObject::Modified
virtual void Modified()
Update the modification time for this object.
vtkPointInterpolator
interpolate over point cloud using various kernels
Definition: vtkPointInterpolator.h:81
vtkPointInterpolator::ValidPointsMask
vtkCharArray * ValidPointsMask
Definition: vtkPointInterpolator.h:279
vtkPointInterpolator::Kernel
vtkInterpolationKernel * Kernel
Definition: vtkPointInterpolator.h:274
vtkPointInterpolator::GetNumberOfExcludedArrays
int GetNumberOfExcludedArrays()
Return the number of excluded arrays.
Definition: vtkPointInterpolator.h:206
vtkPointInterpolator::ExcludedArrays
std::vector< vtkStdString > ExcludedArrays
Definition: vtkPointInterpolator.h:281
vtkPointInterpolator::SetNullPointsStrategyToNullValue
void SetNullPointsStrategyToNullValue()
Specify a strategy to use when encountering a "null" point during the interpolation process.
Definition: vtkPointInterpolator.h:155
vtkPointInterpolator::AddExcludedArray
void AddExcludedArray(const vtkStdString &excludedArray)
Adds an array to the list of arrays which are to be excluded from the interpolation process.
Definition: vtkPointInterpolator.h:185
vtkPointInterpolator::ValidPointsMaskArrayName
vtkStdString ValidPointsMaskArrayName
Definition: vtkPointInterpolator.h:278
vtkPointInterpolator::SetSourceData
void SetSourceData(vtkDataObject *source)
Specify the dataset Pc that will be probed by the input points P.
vtkPointInterpolator::NullPointsStrategy
int NullPointsStrategy
Definition: vtkPointInterpolator.h:276
vtkPointInterpolator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiating, obtaining type information, and printing.
vtkPointInterpolator::PassFieldArrays
bool PassFieldArrays
Definition: vtkPointInterpolator.h:287
vtkPointInterpolator::PassAttributeData
virtual void PassAttributeData(vtkDataSet *input, vtkDataObject *source, vtkDataSet *output)
Call at end of RequestData() to pass attribute data respecting the PassCellArrays,...
vtkPointInterpolator::SetSourceConnection
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
Specify the dataset Pc that will be probed by the input points P.
vtkPointInterpolator::NullValue
double NullValue
Definition: vtkPointInterpolator.h:277
vtkPointInterpolator::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
vtkPointInterpolator::Probe
virtual void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output)
Virtual for specialized subclass(es)
vtkPointInterpolator::PassPointArrays
bool PassPointArrays
Definition: vtkPointInterpolator.h:286
vtkPointInterpolator::SetNullPointsStrategyToClosestPoint
void SetNullPointsStrategyToClosestPoint()
Specify a strategy to use when encountering a "null" point during the interpolation process.
Definition: vtkPointInterpolator.h:156
vtkPointInterpolator::GetSource
vtkDataObject * GetSource()
Specify the dataset Pc that will be probed by the input points P.
vtkPointInterpolator::Locator
vtkAbstractPointLocator * Locator
Definition: vtkPointInterpolator.h:273
vtkPointInterpolator::SetKernel
void SetKernel(vtkInterpolationKernel *kernel)
Specify an interpolation kernel.
vtkPointInterpolator::ExtractImageDescription
void ExtractImageDescription(vtkImageData *input, int dims[3], double origin[3], double spacing[3])
Internal method to extract image metadata.
vtkPointInterpolator::GetExcludedArray
const char * GetExcludedArray(int i)
Return the name of the ith excluded array.
Definition: vtkPointInterpolator.h:212
vtkPointInterpolator::Strategy
Strategy
Definition: vtkPointInterpolator.h:134
vtkPointInterpolator::~vtkPointInterpolator
~vtkPointInterpolator() override
vtkPointInterpolator::ClearExcludedArrays
void ClearExcludedArrays()
Clears the contents of excluded array list.
Definition: vtkPointInterpolator.h:196
vtkPointInterpolator::PassCellArrays
bool PassCellArrays
Definition: vtkPointInterpolator.h:285
vtkPointInterpolator::SetNullPointsStrategyToMaskPoints
void SetNullPointsStrategyToMaskPoints()
Specify a strategy to use when encountering a "null" point during the interpolation process.
Definition: vtkPointInterpolator.h:154
vtkPointInterpolator::vtkPointInterpolator
vtkPointInterpolator()
vtkPointInterpolator::GetMTime
vtkMTimeType GetMTime() override
Get the MTime of this object also considering the locator and kernel.
vtkPointInterpolator::New
static vtkPointInterpolator * New()
Standard methods for instantiating, obtaining type information, and printing.
vtkPointInterpolator::PromoteOutputArrays
bool PromoteOutputArrays
Definition: vtkPointInterpolator.h:283
vtkPointInterpolator::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks for Information.
vtkPointInterpolator::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
vtkPointInterpolator::SetLocator
void SetLocator(vtkAbstractPointLocator *locator)
Specify a point locator.
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
vtkX3D::spacing
@ spacing
Definition: vtkX3D.h:481
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:964
vtkDataSetAlgorithm.h
vtkStdString.h
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270