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 
89 class vtkIdList;
90 class vtkDoubleArray;
91 class vtkSPHKernel;
92 class vtkCharArray;
93 class vtkFloatArray;
94 
95 
96 class VTKFILTERSPOINTS_EXPORT vtkSPHInterpolator : public vtkDataSetAlgorithm
97 {
98 public:
100 
104  static vtkSPHInterpolator *New();
106  void PrintSelf(ostream& os, vtkIndent indent) override;
108 
110 
117  void SetSourceData(vtkDataObject *source);
118  vtkDataObject *GetSource();
120 
127  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
128 
130 
135  void SetLocator(vtkAbstractPointLocator *locator);
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 nullptr;
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 nullptr;
263  }
264  return this->DerivArrays[i].c_str();
265  }
267 
268  // How to handle NULL/empty 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, vtkTypeBool);
324  vtkBooleanMacro(ComputeShepardSum, vtkTypeBool);
325  vtkGetMacro(ComputeShepardSum, vtkTypeBool);
327 
329 
335  vtkSetMacro(ShepardSumArrayName, vtkStdString);
336  vtkGetMacro(ShepardSumArrayName, vtkStdString);
338 
340 
346  vtkSetMacro(PromoteOutputArrays, vtkTypeBool);
347  vtkBooleanMacro(PromoteOutputArrays, vtkTypeBool);
348  vtkGetMacro(PromoteOutputArrays, vtkTypeBool);
350 
352 
356  vtkSetMacro(PassPointArrays, vtkTypeBool);
357  vtkBooleanMacro(PassPointArrays, vtkTypeBool);
358  vtkGetMacro(PassPointArrays, vtkTypeBool);
360 
362 
366  vtkSetMacro(PassCellArrays, vtkTypeBool);
367  vtkBooleanMacro(PassCellArrays, vtkTypeBool);
368  vtkGetMacro(PassCellArrays, vtkTypeBool);
370 
372 
376  vtkSetMacro(PassFieldArrays, vtkTypeBool);
377  vtkBooleanMacro(PassFieldArrays, vtkTypeBool);
378  vtkGetMacro(PassFieldArrays, vtkTypeBool);
380 
382 
388  vtkSetMacro(ShepardNormalization, vtkTypeBool);
389  vtkBooleanMacro(ShepardNormalization, vtkTypeBool);
390  vtkGetMacro(ShepardNormalization, vtkTypeBool);
392 
396  vtkMTimeType GetMTime() override;
397 
398 protected:
400  ~vtkSPHInterpolator() override;
401 
404 
406 
409 
410  std::vector<vtkStdString> ExcludedArrays;
411  std::vector<vtkStdString> DerivArrays;
412 
414 
416  double NullValue;
419 
423 
425 
429 
431  vtkInformationVector *) override;
433  vtkInformationVector *) override;
435  vtkInformationVector *) override;
436 
440  virtual void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output);
441 
446  virtual void PassAttributeData(
447  vtkDataSet* input, vtkDataObject* source, vtkDataSet* output);
448 
449 private:
450  vtkSPHInterpolator(const vtkSPHInterpolator&) = delete;
451  void operator=(const vtkSPHInterpolator&) = delete;
452 
453 };
454 
455 #endif
std::vector< vtkStdString > DerivArrays
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:40
vtkAbstractPointLocator * Locator
const char * GetDerivativeArray(int i)
Return the name of the ith derivative array.
void ClearExcludedArrays()
Clears the contents of excluded array list.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkTypeBool ShepardNormalization
interpolate over point cloud using SPH kernels
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:41
void AddDerivativeArray(const vtkStdString &derivArray)
Adds an array to the list of arrays whose derivative is to be taken.
const char * GetExcludedArray(int i)
Return the name of the ith excluded array.
void SetNullPointsStrategyToMaskPoints()
Specify a strategy to use when encountering a "null" point during the interpolation process...
Proxy object to connect input/output ports.
dynamic, self-adjusting array of double
int vtkTypeBool
Definition: vtkABI.h:69
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:38
int GetNumberOfExcludedArrays()
Return the number of excluded arrays.
vtkTypeBool PromoteOutputArrays
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkTypeBool ComputeShepardSum
abstract class to quickly locate points in 3-space
list of point or cell ids
Definition: vtkIdList.h:36
void AddExcludedArray(const vtkStdString &excludedArray)
Adds an array to the list of arrays which are to be excluded from the interpolation process...
virtual vtkMTimeType GetMTime()
Return this object&#39;s modified time.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
virtual void Modified()
Update the modification time for this object.
vtkCharArray * ValidPointsMask
vtkStdString ShepardSumArrayName
vtkStdString ValidPointsMaskArrayName
std::vector< vtkStdString > ExcludedArrays
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
void ClearDerivativeArrays()
Clears the contents of derivative array list.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks for Information.
vtkStdString DensityArrayName
int GetNumberOfDerivativeArrays()
Return the number of derivative arrays.
Store zero or more vtkInformation instances.
Superclass for algorithms that produce output of the same type as input.
vtkStdString MassArrayName
a family of SPH interpolation kernels
Definition: vtkSPHKernel.h:68
vtkStdString CutoffArrayName
general representation of visualization data
Definition: vtkDataObject.h:64
vtkFloatArray * ShepardSumArray
static vtkDataSetAlgorithm * New()
void SetNullPointsStrategyToNullValue()
Specify a strategy to use when encountering a "null" point during the interpolation process...