VTK  9.2.6
vtkSPHInterpolator.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSPHInterpolator.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=========================================================================*/
79
80#ifndef vtkSPHInterpolator_h
81#define vtkSPHInterpolator_h
82
83#include "vtkDataSetAlgorithm.h"
84#include "vtkFiltersPointsModule.h" // For export macro
85#include "vtkStdString.h" // For vtkStdString ivars
86#include <vector> //For STL vector
87
89class vtkIdList;
90class vtkDoubleArray;
91class vtkSPHKernel;
92class vtkCharArray;
93class vtkFloatArray;
94
95class VTKFILTERSPOINTS_EXPORT vtkSPHInterpolator : public vtkDataSetAlgorithm
96{
97public:
99
105 void PrintSelf(ostream& os, vtkIndent indent) override;
107
109
119
127
129
135 vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
137
139
144 void SetKernel(vtkSPHKernel* kernel);
145 vtkGetObjectMacro(Kernel, vtkSPHKernel);
147
149
156
158
167
169
179
181
185 void AddExcludedArray(const vtkStdString& excludedArray)
186 {
187 this->ExcludedArrays.push_back(excludedArray);
188 this->Modified();
189 }
190
191
193
197 {
198 this->ExcludedArrays.clear();
199 this->Modified();
200 }
201
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 }
220
221
223
228 void AddDerivativeArray(const vtkStdString& derivArray)
229 {
230 this->DerivArrays.push_back(derivArray);
231 this->Modified();
232 }
233
234
236
240 {
241 this->DerivArrays.clear();
242 this->Modified();
243 }
244
245
249 int GetNumberOfDerivativeArrays() { return static_cast<int>(this->DerivArrays.size()); }
250
252
255 const char* GetDerivativeArray(int i)
256 {
257 if (i < 0 || i >= static_cast<int>(this->DerivArrays.size()))
258 {
259 return nullptr;
260 }
261 return this->DerivArrays[i].c_str();
262 }
263
264
265 // How to handle NULL/empty points
267 {
270 };
271
273
282 vtkSetMacro(NullPointsStrategy, int);
283 vtkGetMacro(NullPointsStrategy, int);
287
289
298
300
305 vtkSetMacro(NullValue, double);
306 vtkGetMacro(NullValue, double);
308
310
322
324
333
335
345
347
352 vtkBooleanMacro(PassPointArrays, vtkTypeBool);
355
357
362 vtkBooleanMacro(PassCellArrays, vtkTypeBool);
365
367
372 vtkBooleanMacro(PassFieldArrays, vtkTypeBool);
375
377
387
392
393protected:
396
399
401
404
405 std::vector<vtkStdString> ExcludedArrays;
406 std::vector<vtkStdString> DerivArrays;
407
409
411 double NullValue;
414
417
419
423
427
431 virtual void Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet* output);
432
438
439private:
440 vtkSPHInterpolator(const vtkSPHInterpolator&) = delete;
441 void operator=(const vtkSPHInterpolator&) = delete;
442};
443
444#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
abstract class to specify dataset behavior
Definition vtkDataSet.h:63
dynamic, self-adjusting array of double
dynamic, self-adjusting array of float
list of point or cell ids
Definition vtkIdList.h:34
a simple class to control print indentation
Definition vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
virtual void Modified()
Update the modification time for this object.
void SetSourceData(vtkDataObject *source)
Specify the dataset Pc that will be probed by the input points P.
int GetNumberOfDerivativeArrays()
Return the number of derivative arrays.
vtkTypeBool ShepardNormalization
vtkCharArray * ValidPointsMask
virtual void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output)
Virtual for specialized subclass(es)
const char * GetExcludedArray(int i)
Return the name of the ith excluded array.
void SetLocator(vtkAbstractPointLocator *locator)
Specify a point locator.
const char * GetDerivativeArray(int i)
Return the name of the ith derivative array.
void ClearDerivativeArrays()
Clears the contents of derivative array list.
void SetKernel(vtkSPHKernel *kernel)
Specify an interpolation kernel.
static vtkSPHInterpolator * New()
Standard methods for instantiating, obtaining type information, and printing.
vtkStdString DensityArrayName
vtkDataObject * GetSource()
Specify the dataset Pc that will be probed by the input points P.
vtkTypeBool PromoteOutputArrays
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.
void AddDerivativeArray(const vtkStdString &derivArray)
Adds an array to the list of arrays whose derivative is to be taken.
void AddExcludedArray(const vtkStdString &excludedArray)
Adds an array to the list of arrays which are to be excluded from the interpolation process.
vtkStdString ShepardSumArrayName
void SetNullPointsStrategyToNullValue()
Specify a strategy to use when encountering a "null" point during the interpolation process.
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
Specify the dataset Pc that will be probed by the input points P.
vtkStdString ValidPointsMaskArrayName
~vtkSPHInterpolator() override
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
std::vector< vtkStdString > ExcludedArrays
int GetNumberOfExcludedArrays()
Return the number of excluded arrays.
virtual void SetNullPointsStrategy(int)
Specify a strategy to use when encountering a "null" point during the interpolation process.
vtkAbstractPointLocator * Locator
void ClearExcludedArrays()
Clears the contents of excluded array list.
virtual void PassAttributeData(vtkDataSet *input, vtkDataObject *source, vtkDataSet *output)
Call at end of RequestData() to pass attribute data respecting the PassCellArrays,...
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
void PrintSelf(ostream &os, vtkIndent indent) override
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.
std::vector< vtkStdString > DerivArrays
a family of SPH interpolation kernels
Wrapper around std::string to keep symbols short.
int vtkTypeBool
Definition vtkABI.h:69
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287