VTK  9.1.0
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
72class vtkDataSet;
73class vtkDataArray;
74class vtkPointData;
75class vtkGenericCell;
76class vtkAbstractInterpolatedVelocityFieldDataSetsType;
78struct vtkStrategyMap;
79
80#include "vtkFiltersFlowPathsModule.h" // For export macro
81
82class VTKFILTERSFLOWPATHS_EXPORT vtkAbstractInterpolatedVelocityField : public vtkFunctionSet
83{
84public:
86 void PrintSelf(ostream& os, vtkIndent indent) override;
87
89
96 vtkSetMacro(Caching, bool);
97 vtkGetMacro(Caching, bool);
99
101
105 vtkGetMacro(CacheHit, int);
106 vtkGetMacro(CacheMiss, int);
108
109 vtkGetObjectMacro(LastDataSet, vtkDataSet);
110
112
115 vtkGetMacro(LastCellId, vtkIdType);
116 virtual void SetLastCellId(vtkIdType c) { this->LastCellId = c; }
118
122 virtual void SetLastCellId(vtkIdType c, int dataindex) = 0;
123
125
129 vtkGetStringMacro(VectorsSelection);
130 vtkGetMacro(VectorsType, int);
132
137 void SelectVectors(int fieldAssociation, const char* fieldName);
138
140
157 vtkSetMacro(NormalizeVector, bool);
158 vtkGetMacro(NormalizeVector, bool);
160
162
167 vtkSetMacro(ForceSurfaceTangentVector, bool);
168 vtkGetMacro(ForceSurfaceTangentVector, bool);
170
172
175 vtkSetMacro(SurfaceDataset, bool);
176 vtkGetMacro(SurfaceDataset, bool);
178
183
184 using Superclass::FunctionValues;
188 int FunctionValues(double* x, double* f) override = 0;
189
193 void ClearLastCellId() { this->LastCellId = -1; }
194
196
200 int GetLastWeights(double* w);
201 int GetLastLocalCoordinates(double pcoords[3]);
203
205
212 vtkGetObjectMacro(FindCellStrategy, vtkFindCellStrategy);
214
215protected:
218
219 static const double TOLERANCE_SCALE;
220 static const double SURFACE_TOLERANCE_SCALE;
221
231 double* Weights;
232 double LastPCoords[3];
237 vtkGenericCell* GenCell; // the current cell
238
239 // Define a FindCell() strategy, keep track of the strategies assigned to
240 // each dataset
242 vtkStrategyMap* StrategyMap;
243
245
248 vtkSetStringMacro(VectorsSelection);
250
262 virtual int FunctionValues(vtkDataSet* ds, double* x, double* f);
263
267 virtual bool CheckPCoords(double pcoords[3]);
268
276 virtual bool FindAndUpdateCell(vtkDataSet* ds, double* x);
277
280
286 void FastCompute(vtkDataArray* vectors, double f[3]);
288 vtkGenericCell* GetLastCell() { return (this->LastCellId != -1) ? this->GenCell : nullptr; }
290
291private:
293 void operator=(const vtkAbstractInterpolatedVelocityField&) = delete;
294};
295
296#endif
An abstract class for obtaining the interpolated velocity values at a point.
int FunctionValues(double *x, double *f) override=0
Evaluate the velocity field f at point (x, y, z).
virtual int FunctionValues(vtkDataSet *ds, double *x, double *f)
Evaluate the velocity field f at point (x, y, z) in a specified dataset by invoking vtkDataSet::FindC...
int GetLastWeights(double *w)
Get the interpolation weights cached from last evaluation.
int GetLastLocalCoordinates(double pcoords[3])
Get the interpolation weights cached from last evaluation.
virtual bool FindAndUpdateCell(vtkDataSet *ds, double *x)
Try to find the cell closest to provided x point in provided dataset, By first testing inclusion in i...
void ClearLastCellId()
Set the last cell id to -1 to incur a global cell search for the next point.
virtual void SetFindCellStrategy(vtkFindCellStrategy *)
Set / get the strategy used to perform the FindCell() operation.
void FastCompute(vtkDataArray *vectors, double f[3])
If all weights have been computed (parametric coords etc all valid), a scalar/vector can be quickly i...
bool InterpolatePoint(vtkPointData *outPD, vtkIdType outIndex)
If all weights have been computed (parametric coords etc all valid), a scalar/vector can be quickly i...
vtkGenericCell * GetLastCell()
If all weights have been computed (parametric coords etc all valid), a scalar/vector can be quickly i...
virtual void CopyParameters(vtkAbstractInterpolatedVelocityField *from)
Import parameters.
virtual void SetLastCellId(vtkIdType c)
Get/Set the id of the cell cached from last evaluation.
virtual bool CheckPCoords(double pcoords[3])
Check that all three pcoords are between 0 and 1 included.
virtual void SetLastCellId(vtkIdType c, int dataindex)=0
Set the id of the most recently visited cell of a dataset.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SelectVectors(int fieldAssociation, const char *fieldName)
the association type (see vtkDataObject::FieldAssociations) and the name of the velocity data field
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
helper class to manage the vtkPointSet::FindCell() METHOD
Abstract interface for sets of functions.
provides thread-safe access to cells
a simple class to control print indentation
Definition: vtkIndent.h:113
represent and manipulate point attribute data
Definition: vtkPointData.h:142
A helper class for interpolating between times during particle tracing.
int vtkIdType
Definition: vtkType.h:332