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 =========================================================================*/
77 #ifndef vtkSPHInterpolator_h
78 #define vtkSPHInterpolator_h
79 
80 #include "vtkFiltersPointsModule.h" // For export macro
81 #include "vtkDataSetAlgorithm.h"
82 #include "vtkStdString.h" // For vtkStdString ivars
83 #include <vector> //For STL vector
84 
86 class vtkIdList;
87 class vtkDoubleArray;
88 class vtkSPHKernel;
89 class vtkCharArray;
90 class vtkFloatArray;
91 
92 
93 class VTKFILTERSPOINTS_EXPORT vtkSPHInterpolator : public vtkDataSetAlgorithm
94 {
95 public:
97 
101  static vtkSPHInterpolator *New();
103  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
105 
107 
114  void SetSourceData(vtkDataObject *source);
115  vtkDataObject *GetSource();
117 
124  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
125 
127 
132  void SetLocator(vtkAbstractPointLocator *locator);
133  vtkGetObjectMacro(Locator,vtkAbstractPointLocator);
135 
137 
142  void SetKernel(vtkSPHKernel *kernel);
143  vtkGetObjectMacro(Kernel,vtkSPHKernel);
145 
147 
151  vtkSetMacro(CutoffArrayName,vtkStdString);
152  vtkGetMacro(CutoffArrayName,vtkStdString);
154 
156 
162  vtkSetMacro(DensityArrayName,vtkStdString);
163  vtkGetMacro(DensityArrayName,vtkStdString);
165 
167 
174  vtkSetMacro(MassArrayName,vtkStdString);
175  vtkGetMacro(MassArrayName,vtkStdString);
177 
179 
183  void AddExcludedArray(const vtkStdString &excludedArray)
184  {
185  this->ExcludedArrays.push_back(excludedArray);
186  this->Modified();
187  }
189 
191 
195  {
196  this->ExcludedArrays.clear();
197  this->Modified();
198  }
200 
205  {return static_cast<int>(this->ExcludedArrays.size());}
206 
208 
211  const char* GetExcludedArray(int i)
212  {
213  if ( i < 0 || i >= static_cast<int>(this->ExcludedArrays.size()) )
214  {
215  return NULL;
216  }
217  return this->ExcludedArrays[i].c_str();
218  }
220 
222 
227  void AddDerivativeArray(const vtkStdString &derivArray)
228  {
229  this->DerivArrays.push_back(derivArray);
230  this->Modified();
231  }
233 
235 
239  {
240  this->DerivArrays.clear();
241  this->Modified();
242  }
244 
249  {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 NULL;
260  }
261  return this->DerivArrays[i].c_str();
262  }
264 
265  // How to handle NULL points
267  {
268  MASK_POINTS=0,
269  NULL_VALUE=1
270  };
271 
273 
282  vtkSetMacro(NullPointsStrategy,int);
283  vtkGetMacro(NullPointsStrategy,int);
285  { this->SetNullPointsStrategy(MASK_POINTS); }
287  { this->SetNullPointsStrategy(NULL_VALUE); }
289 
291 
297  vtkSetMacro(ValidPointsMaskArrayName, vtkStdString);
298  vtkGetMacro(ValidPointsMaskArrayName, vtkStdString);
300 
302 
307  vtkSetMacro(NullValue,double);
308  vtkGetMacro(NullValue,double);
310 
312 
320  vtkSetMacro(ComputeShepardSum, bool);
321  vtkBooleanMacro(ComputeShepardSum, bool);
322  vtkGetMacro(ComputeShepardSum, bool);
324 
326 
332  vtkSetMacro(ShepardSumArrayName, vtkStdString);
333  vtkGetMacro(ShepardSumArrayName, vtkStdString);
335 
337 
343  vtkSetMacro(PromoteOutputArrays, bool);
344  vtkBooleanMacro(PromoteOutputArrays, bool);
345  vtkGetMacro(PromoteOutputArrays, bool);
347 
349 
353  vtkSetMacro(PassPointArrays, bool);
354  vtkBooleanMacro(PassPointArrays, bool);
355  vtkGetMacro(PassPointArrays, bool);
357 
359 
363  vtkSetMacro(PassCellArrays, bool);
364  vtkBooleanMacro(PassCellArrays, bool);
365  vtkGetMacro(PassCellArrays, bool);
367 
369 
373  vtkSetMacro(PassFieldArrays, bool);
374  vtkBooleanMacro(PassFieldArrays, bool);
375  vtkGetMacro(PassFieldArrays, bool);
377 
381  vtkMTimeType GetMTime() VTK_OVERRIDE;
382 
383 protected:
385  ~vtkSPHInterpolator() VTK_OVERRIDE;
386 
388  vtkSPHKernel *Kernel;
389 
390  vtkStdString CutoffArrayName;
391 
392  vtkStdString DensityArrayName;
393  vtkStdString MassArrayName;
394 
395  std::vector<vtkStdString> ExcludedArrays;
396  std::vector<vtkStdString> DerivArrays;
397 
398  int NullPointsStrategy;
399  double NullValue;
400  vtkStdString ValidPointsMaskArrayName;
401  vtkCharArray *ValidPointsMask;
402 
403  bool ComputeShepardSum;
404  vtkStdString ShepardSumArrayName;
405  vtkFloatArray *ShepardSumArray;
406 
407  bool PromoteOutputArrays;
408 
409  bool PassCellArrays;
410  bool PassPointArrays;
411  bool PassFieldArrays;
412 
413  int RequestData(vtkInformation *, vtkInformationVector **,
414  vtkInformationVector *) VTK_OVERRIDE;
415  int RequestInformation(vtkInformation *, vtkInformationVector **,
416  vtkInformationVector *) VTK_OVERRIDE;
417  int RequestUpdateExtent(vtkInformation *, vtkInformationVector **,
418  vtkInformationVector *) VTK_OVERRIDE;
419 
423  virtual void Probe(vtkDataSet *input, vtkDataSet *source, vtkDataSet *output);
424 
429  virtual void PassAttributeData(
430  vtkDataSet* input, vtkDataObject* source, vtkDataSet* output);
431 
435  void ExtractImageDescription(vtkImageData *input, int dims[3],
436  double origin[3], double spacing[3]);
437 
438 private:
439  vtkSPHInterpolator(const vtkSPHInterpolator&) VTK_DELETE_FUNCTION;
440  void operator=(const vtkSPHInterpolator&) VTK_DELETE_FUNCTION;
441 
442 };
443 
444 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:41
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:300
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
interpolate over point cloud using SPH kernels
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
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
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:35
int GetNumberOfExcludedArrays()
Return the number of excluded arrays.
a simple class to control print indentation
Definition: vtkIndent.h:33
abstract class to quickly locate points in 3-space
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
list of point or cell ids
Definition: vtkIdList.h:30
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 void Modified()
Update the modification time for this object.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
boost::graph_traits< vtkGraph *>::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
void ClearDerivativeArrays()
Clears the contents of derivative array list.
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.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
a family of SPH interpolation kernels
Definition: vtkSPHKernel.h:68
general representation of visualization data
Definition: vtkDataObject.h:58
static vtkDataSetAlgorithm * New()
void SetNullPointsStrategyToNullValue()
Specify a strategy to use when encountering a "null" point during the interpolation process...