VTK
vtkAbstractInterpolatedVelocityField.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAbstractInterpolatedVelocityField.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 =========================================================================*/
67 #ifndef vtkAbstractInterpolatedVelocityField_h
68 #define vtkAbstractInterpolatedVelocityField_h
69 
70 #include "vtkFunctionSet.h"
71 
72 #include <vector> // STL Header; Required for vector
73 
74 class vtkDataSet;
75 
76 class vtkDataArray;
77 
78 class vtkPointData;
79 class vtkGenericCell;
80 class vtkAbstractInterpolatedVelocityFieldDataSetsType;
81 
82 #include "vtkFiltersFlowPathsModule.h" // For export macro
83 
84 class VTKFILTERSFLOWPATHS_EXPORT vtkAbstractInterpolatedVelocityField : public vtkFunctionSet
85 {
86 public:
88  void PrintSelf( ostream & os, vtkIndent indent ) override;
89 
91 
98  vtkSetMacro( Caching, bool );
99  vtkGetMacro( Caching, bool );
101 
103 
107  vtkGetMacro( CacheHit, int );
108  vtkGetMacro( CacheMiss, int );
110 
111  vtkGetObjectMacro( LastDataSet, vtkDataSet );
112 
114 
117  vtkGetMacro( LastCellId, vtkIdType );
118  virtual void SetLastCellId( vtkIdType c ) { this->LastCellId = c; }
120 
124  virtual void SetLastCellId( vtkIdType c, int dataindex ) = 0;
125 
127 
131  vtkGetStringMacro( VectorsSelection );
132  vtkGetMacro(VectorsType,int);
134 
139  void SelectVectors(int fieldAssociation, const char * fieldName );
140 
141 
143 
160  vtkSetMacro( NormalizeVector, bool );
161  vtkGetMacro( NormalizeVector, bool );
163 
165 
169  vtkSetMacro(ForceSurfaceTangentVector, bool);
170  vtkGetMacro(ForceSurfaceTangentVector, bool);
172 
174 
177  vtkSetMacro(SurfaceDataset, bool);
178  vtkGetMacro(SurfaceDataset, bool);
180 
185  { this->Caching = from->Caching; }
186 
187 
191  int FunctionValues( double * x, double * f ) override = 0;
192 
196  void ClearLastCellId() { this->LastCellId = -1; }
197 
199 
203  int GetLastWeights( double * w );
204  int GetLastLocalCoordinates( double pcoords[3] );
206 
207 protected:
210 
211  static const double TOLERANCE_SCALE;
212  static const double SURFACE_TOLERANCE_SCALE;
213 
214  int CacheHit;
217  bool Caching;
223  double * Weights;
224  double LastPCoords[3];
229  vtkGenericCell * GenCell; // the current cell
230 
231 
233 
236  vtkSetStringMacro( VectorsSelection );
238 
250  virtual int FunctionValues( vtkDataSet * ds, double * x, double * f );
251 
255  virtual bool CheckPCoords(double pcoords[3]);
256 
264  virtual bool FindAndUpdateCell(vtkDataSet* ds, double* x);
265 
268 
274  void FastCompute( vtkDataArray * vectors, double f[3] );
275  bool InterpolatePoint( vtkPointData * outPD, vtkIdType outIndex );
277  { return ( this->LastCellId != -1 ) ? this->GenCell : nullptr; }
279 
280 private:
282  ( const vtkAbstractInterpolatedVelocityField & ) = delete;
283  void operator = ( const vtkAbstractInterpolatedVelocityField & ) = delete;
284 };
285 
286 
287 
288 #endif
vtkAbstractInterpolatedVelocityField::GetLastCell
vtkGenericCell * GetLastCell()
Definition: vtkAbstractInterpolatedVelocityField.h:276
vtkAbstractInterpolatedVelocityField::SetLastCellId
virtual void SetLastCellId(vtkIdType c)
Definition: vtkAbstractInterpolatedVelocityField.h:118
vtkFunctionSet
Abstract interface for sets of functions.
Definition: vtkFunctionSet.h:35
vtkAbstractInterpolatedVelocityField::TOLERANCE_SCALE
static const double TOLERANCE_SCALE
Definition: vtkAbstractInterpolatedVelocityField.h:211
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
vtkAbstractInterpolatedVelocityField::VectorsSelection
char * VectorsSelection
Definition: vtkAbstractInterpolatedVelocityField.h:222
vtkAbstractInterpolatedVelocityField::ClearLastCellId
void ClearLastCellId()
Set the last cell id to -1 to incur a global cell search for the next point.
Definition: vtkAbstractInterpolatedVelocityField.h:196
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkFunctionSet::FunctionValues
virtual int FunctionValues(double *x, double *f)=0
Evaluate functions at x_j.
vtkAbstractInterpolatedVelocityField::Caching
bool Caching
Definition: vtkAbstractInterpolatedVelocityField.h:217
vtkTemporalInterpolatedVelocityField::InterpolatePoint
bool InterpolatePoint(vtkPointData *outPD1, vtkPointData *outPD2, vtkIdType outIndex)
vtkFunctionSet.h
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkAbstractInterpolatedVelocityField::GenCell
vtkGenericCell * GenCell
Definition: vtkAbstractInterpolatedVelocityField.h:229
vtkFunctionSet::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAbstractInterpolatedVelocityField::SurfaceDataset
bool SurfaceDataset
Definition: vtkAbstractInterpolatedVelocityField.h:220
vtkAbstractInterpolatedVelocityField::LastSubId
int LastSubId
Definition: vtkAbstractInterpolatedVelocityField.h:225
vtkAbstractInterpolatedVelocityField::CacheHit
int CacheHit
Definition: vtkAbstractInterpolatedVelocityField.h:214
vtkAbstractInterpolatedVelocityField::LastCellId
vtkIdType LastCellId
Definition: vtkAbstractInterpolatedVelocityField.h:226
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkAbstractInterpolatedVelocityField::CacheMiss
int CacheMiss
Definition: vtkAbstractInterpolatedVelocityField.h:215
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkAbstractInterpolatedVelocityField
An abstract class for obtaining the interpolated velocity values at a point.
Definition: vtkAbstractInterpolatedVelocityField.h:84
vtkAbstractInterpolatedVelocityField::Cell
vtkGenericCell * Cell
Definition: vtkAbstractInterpolatedVelocityField.h:228
vtkAbstractInterpolatedVelocityField::WeightsSize
int WeightsSize
Definition: vtkAbstractInterpolatedVelocityField.h:216
vtkTemporalInterpolatedVelocityField
A helper class for interpolating between times during particle tracing.
Definition: vtkTemporalInterpolatedVelocityField.h:68
vtkAbstractInterpolatedVelocityField::Weights
double * Weights
Definition: vtkAbstractInterpolatedVelocityField.h:223
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:39
vtkAbstractInterpolatedVelocityField::VectorsType
int VectorsType
Definition: vtkAbstractInterpolatedVelocityField.h:221
vtkAbstractInterpolatedVelocityField::SURFACE_TOLERANCE_SCALE
static const double SURFACE_TOLERANCE_SCALE
Definition: vtkAbstractInterpolatedVelocityField.h:212
vtkAbstractInterpolatedVelocityField::ForceSurfaceTangentVector
bool ForceSurfaceTangentVector
Definition: vtkAbstractInterpolatedVelocityField.h:219
vtkAbstractInterpolatedVelocityField::LastDataSet
vtkDataSet * LastDataSet
Definition: vtkAbstractInterpolatedVelocityField.h:227
vtkAbstractInterpolatedVelocityField::CopyParameters
virtual void CopyParameters(vtkAbstractInterpolatedVelocityField *from)
Import parameters.
Definition: vtkAbstractInterpolatedVelocityField.h:184
vtkAbstractInterpolatedVelocityField::NormalizeVector
bool NormalizeVector
Definition: vtkAbstractInterpolatedVelocityField.h:218