VTK
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=========================================================================*/
80#ifndef vtkSPHInterpolator_h
81#define vtkSPHInterpolator_h
82
83#include "vtkFiltersPointsModule.h" // For export macro
84#include "vtkDataSetAlgorithm.h"
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
95
96class VTKFILTERSPOINTS_EXPORT vtkSPHInterpolator : public vtkDataSetAlgorithm
97{
98public:
100
106 void PrintSelf(ostream& os, vtkIndent indent);
108
110
120
128
130
136 vtkGetObjectMacro(Locator,vtkAbstractPointLocator);
138
140
145 void SetKernel(vtkSPHKernel *kernel);
146 vtkGetObjectMacro(Kernel,vtkSPHKernel);
148
150
154 vtkSetMacro(CutoffArrayName,vtkStdString);
155 vtkGetMacro(CutoffArrayName,vtkStdString);
157
159
165 vtkSetMacro(DensityArrayName,vtkStdString);
166 vtkGetMacro(DensityArrayName,vtkStdString);
168
170
177 vtkSetMacro(MassArrayName,vtkStdString);
178 vtkGetMacro(MassArrayName,vtkStdString);
180
182
186 void AddExcludedArray(const vtkStdString &excludedArray)
187 {
188 this->ExcludedArrays.push_back(excludedArray);
189 this->Modified();
190 }
192
194
198 {
199 this->ExcludedArrays.clear();
200 this->Modified();
201 }
203
208 {return static_cast<int>(this->ExcludedArrays.size());}
209
211
214 const char* GetExcludedArray(int i)
215 {
216 if ( i < 0 || i >= static_cast<int>(this->ExcludedArrays.size()) )
217 {
218 return NULL;
219 }
220 return this->ExcludedArrays[i].c_str();
221 }
223
225
230 void AddDerivativeArray(const vtkStdString &derivArray)
231 {
232 this->DerivArrays.push_back(derivArray);
233 this->Modified();
234 }
236
238
242 {
243 this->DerivArrays.clear();
244 this->Modified();
245 }
247
252 {return static_cast<int>(this->DerivArrays.size());}
253
255
258 const char* GetDerivativeArray(int i)
259 {
260 if ( i < 0 || i >= static_cast<int>(this->DerivArrays.size()) )
261 {
262 return NULL;
263 }
264 return this->DerivArrays[i].c_str();
265 }
267
268 // How to handle NULL points
270 {
271 MASK_POINTS=0,
272 NULL_VALUE=1
273 };
274
276
285 vtkSetMacro(NullPointsStrategy,int);
286 vtkGetMacro(NullPointsStrategy,int);
288 { this->SetNullPointsStrategy(MASK_POINTS); }
290 { this->SetNullPointsStrategy(NULL_VALUE); }
292
294
300 vtkSetMacro(ValidPointsMaskArrayName, vtkStdString);
301 vtkGetMacro(ValidPointsMaskArrayName, vtkStdString);
303
305
310 vtkSetMacro(NullValue,double);
311 vtkGetMacro(NullValue,double);
313
315
323 vtkSetMacro(ComputeShepardSum, bool);
324 vtkBooleanMacro(ComputeShepardSum, bool);
325 vtkGetMacro(ComputeShepardSum, bool);
327
329
335 vtkSetMacro(ShepardSumArrayName, vtkStdString);
336 vtkGetMacro(ShepardSumArrayName, vtkStdString);
338
340
346 vtkSetMacro(PromoteOutputArrays, bool);
347 vtkBooleanMacro(PromoteOutputArrays, bool);
348 vtkGetMacro(PromoteOutputArrays, bool);
350
352
356 vtkSetMacro(PassPointArrays, bool);
357 vtkBooleanMacro(PassPointArrays, bool);
358 vtkGetMacro(PassPointArrays, bool);
360
362
366 vtkSetMacro(PassCellArrays, bool);
367 vtkBooleanMacro(PassCellArrays, bool);
368 vtkGetMacro(PassCellArrays, bool);
370
372
376 vtkSetMacro(PassFieldArrays, bool);
377 vtkBooleanMacro(PassFieldArrays, bool);
378 vtkGetMacro(PassFieldArrays, bool);
380
385
386protected:
389
392
394
397
398 std::vector<vtkStdString> ExcludedArrays;
399 std::vector<vtkStdString> DerivArrays;
400
402 double NullValue;
405
409
411
415
422
426 virtual void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output);
427
432 virtual void PassAttributeData(
433 vtkDataSet* input, vtkDataObject* source, vtkDataSet* output);
434
438 void ExtractImageDescription(vtkImageData *input, int dims[3],
439 double origin[3], double spacing[3]);
440
441private:
442 vtkSPHInterpolator(const vtkSPHInterpolator&) VTK_DELETE_FUNCTION;
443 void operator=(const vtkSPHInterpolator&) VTK_DELETE_FUNCTION;
444
445};
446
447#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:39
general representation of visualization data
Definition: vtkDataObject.h:65
Superclass for algorithms that produce output of the same type as input.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
dynamic, self-adjusting array of double
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
list of point or cell ids
Definition: vtkIdList.h:37
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
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.
interpolate over point cloud using SPH kernels
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.
vtkCharArray * ValidPointsMask
virtual void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output)
Virtual for specialized subclass(es)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
const char * GetExcludedArray(int i)
Return the name of the ith excluded array.
void ExtractImageDescription(vtkImageData *input, int dims[3], double origin[3], double spacing[3])
Internal method to extract image metadata.
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.
vtkStdString MassArrayName
void SetKernel(vtkSPHKernel *kernel)
Specify an interpolation kernel.
static vtkSPHInterpolator * New()
Standard methods for instantiating, obtaining type information, and printing.
vtkStdString DensityArrayName
vtkFloatArray * ShepardSumArray
vtkDataObject * GetSource()
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
void SetNullPointsStrategyToMaskPoints()
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()
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
Specify the dataset Pc that will be probed by the input points P.
vtkStdString ValidPointsMaskArrayName
std::vector< vtkStdString > ExcludedArrays
vtkMTimeType GetMTime()
Get the MTime of this object also considering the locator and kernel.
int GetNumberOfExcludedArrays()
Return the number of excluded arrays.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks for Information.
vtkStdString CutoffArrayName
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,...
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
std::vector< vtkStdString > DerivArrays
a family of SPH interpolation kernels
Definition: vtkSPHKernel.h:69
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
@ spacing
Definition: vtkX3D.h:481
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248