VTK
vtkCachingInterpolatedVelocityField.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCachingInterpolatedVelocityField.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 =========================================================================*/
43 #ifndef vtkTInterpolatedVelocityField_h
44 #define vtkTInterpolatedVelocityField_h
45 
46 #include "vtkFiltersFlowPathsModule.h" // For export macro
47 #include "vtkFunctionSet.h"
48 #include "vtkSmartPointer.h" // this is allowed
49 //BTX
50 #include <vector> // we need them
51 //ETX
52 
53 class vtkDataSet;
54 class vtkDataArray;
55 class vtkPointData;
56 class vtkGenericCell;
58 //BTX
59 //---------------------------------------------------------------------------
60 class IVFDataSetInfo;
61 //---------------------------------------------------------------------------
62 class IVFCacheList : public std::vector< IVFDataSetInfo > {};
63 //---------------------------------------------------------------------------
64 //ETX
66 {
67 public:
69  virtual void PrintSelf(ostream& os, vtkIndent indent);
70 
74 
76 
78  virtual int FunctionValues(double* x, double* f);
79  virtual int InsideTest(double* x);
81 
83  virtual void SetDataSet(int I, vtkDataSet* dataset, bool staticdataset, vtkAbstractCellLocator *locator);
84 
86 
89  vtkGetStringMacro(VectorsSelection);
90  void SelectVectors(const char *fieldName)
91  {this->SetVectorsSelection(fieldName);}
93 
98  void SetLastCellInfo(vtkIdType c, int datasetindex);
99 
103 
105 
108  int GetLastWeights(double* w);
109  int GetLastLocalCoordinates(double pcoords[3]);
111 
113 
114  vtkGetMacro(CellCacheHit, int);
115  vtkGetMacro(DataSetCacheHit, int);
116  vtkGetMacro(CacheMiss, int);
118 
119 protected:
122 
132 //BTX
133  std::vector<double> Weights;
134 //ETX
135 
136  vtkSetStringMacro(VectorsSelection);
137 
138  // private versions which work on the passed dataset/cache
139  // these do the real computation
140  int FunctionValues(IVFDataSetInfo *cache, double *x, double *f);
141  int InsideTest(IVFDataSetInfo *cache, double* x);
142 
143 //BTX
146 
150  void FastCompute(IVFDataSetInfo *cache, double f[3]);
151  bool InterpolatePoint(vtkPointData *outPD, vtkIdType outIndex);
153  vtkPointData *outPD, vtkIdType outIndex);
155 //ETX
157 
158 private:
160  void operator=(const vtkCachingInterpolatedVelocityField&); // Not implemented.
161 };
162 
163 //---------------------------------------------------------------------------
164 
166 // IVFDataSetInfo
168 #ifndef DOXYGEN_SHOULD_SKIP_THIS
169 //
170 //BTX
171 //
173 {
174 public:
178  double PCoords[3];
180  double *VelocityDouble;
181  double Tolerance;
186  void SetDataSet(vtkDataSet *data, char *velocity, bool staticdataset, vtkAbstractCellLocator *locator);
187  //
188  static const double TOLERANCE_SCALE;
189 };
190 
191 //
192 //ETX
193 //
194 
195 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
196 
197 #endif
vtkCachingInterpolatedVelocityField::SetDataSet
virtual void SetDataSet(int I, vtkDataSet *dataset, bool staticdataset, vtkAbstractCellLocator *locator)
vtkCachingInterpolatedVelocityField::CacheList
IVFCacheList CacheList
Definition: vtkCachingInterpolatedVelocityField.h:130
vtkgl::data
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
vtkX3D::vector
@ vector
Definition: vtkX3D.h:237
vtkFunctionSet
Abstract interface for sets of functions.
Definition: vtkFunctionSet.h:35
vtkCachingInterpolatedVelocityField::InsideTest
int InsideTest(IVFDataSetInfo *cache, double *x)
IVFDataSetInfo::Tolerance
double Tolerance
Definition: vtkCachingInterpolatedVelocityField.h:181
IVFDataSetInfo::TOLERANCE_SCALE
static const double TOLERANCE_SCALE
Definition: vtkCachingInterpolatedVelocityField.h:188
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
IVFDataSetInfo::BSPTree
vtkSmartPointer< vtkAbstractCellLocator > BSPTree
Definition: vtkCachingInterpolatedVelocityField.h:176
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkCachingInterpolatedVelocityField::SelectVectors
void SelectVectors(const char *fieldName)
Definition: vtkCachingInterpolatedVelocityField.h:90
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
IVFDataSetInfo::DataSet
vtkSmartPointer< vtkDataSet > DataSet
Definition: vtkCachingInterpolatedVelocityField.h:175
vtkCachingInterpolatedVelocityField::InterpolatePoint
bool InterpolatePoint(vtkCachingInterpolatedVelocityField *inCIVF, vtkPointData *outPD, vtkIdType outIndex)
VTKFILTERSFLOWPATHS_EXPORT
#define VTKFILTERSFLOWPATHS_EXPORT
Definition: vtkFiltersFlowPathsModule.h:15
vtkSmartPointer< vtkDataSet >
vtkFiltersFlowPathsModule.h
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkCachingInterpolatedVelocityField::InsideTest
virtual int InsideTest(double *x)
vtkFunctionSet.h
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkCachingInterpolatedVelocityField::Weights
std::vector< double > Weights
Definition: vtkCachingInterpolatedVelocityField.h:133
vtkCachingInterpolatedVelocityField::FastCompute
void FastCompute(IVFDataSetInfo *cache, double f[3])
vtkCachingInterpolatedVelocityField::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
IVFDataSetInfo::IVFDataSetInfo
IVFDataSetInfo()
vtkCachingInterpolatedVelocityField::vtkCachingInterpolatedVelocityField
vtkCachingInterpolatedVelocityField()
vtkCachingInterpolatedVelocityField::New
static vtkCachingInterpolatedVelocityField * New()
IVFDataSetInfo::IVFDataSetInfo
IVFDataSetInfo(const IVFDataSetInfo &ivfci)
vtkCachingInterpolatedVelocityField::ClearLastCellInfo
void ClearLastCellInfo()
vtkCachingInterpolatedVelocityField::LastCellId
int LastCellId
Definition: vtkCachingInterpolatedVelocityField.h:128
vtkgl::c
const GLubyte * c
Definition: vtkgl.h:15720
vtkCachingInterpolatedVelocityField
Interface for obtaining interpolated velocity values.
Definition: vtkCachingInterpolatedVelocityField.h:66
IVFDataSetInfo::VelocityFloat
float * VelocityFloat
Definition: vtkCachingInterpolatedVelocityField.h:179
IVFDataSetInfo::operator=
IVFDataSetInfo & operator=(const IVFDataSetInfo &ivfci)
vtkCachingInterpolatedVelocityField::Cache
IVFDataSetInfo * Cache
Definition: vtkCachingInterpolatedVelocityField.h:129
vtkCachingInterpolatedVelocityField::FunctionValues
int FunctionValues(IVFDataSetInfo *cache, double *x, double *f)
vtkCachingInterpolatedVelocityField::GetLastWeights
int GetLastWeights(double *w)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkSmartPointer.h
vtkCachingInterpolatedVelocityField::VectorsSelection
char * VectorsSelection
Definition: vtkCachingInterpolatedVelocityField.h:131
IVFCacheList
Definition: vtkCachingInterpolatedVelocityField.h:62
vtkCachingInterpolatedVelocityField::CacheMiss
int CacheMiss
Definition: vtkCachingInterpolatedVelocityField.h:126
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkCachingInterpolatedVelocityField::DataSetCacheHit
int DataSetCacheHit
Definition: vtkCachingInterpolatedVelocityField.h:125
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkCachingInterpolatedVelocityField::GetLastLocalCoordinates
int GetLastLocalCoordinates(double pcoords[3])
vtkCachingInterpolatedVelocityField::SetLastCellInfo
void SetLastCellInfo(vtkIdType c, int datasetindex)
vtkgl::f
GLclampf f
Definition: vtkgl.h:14181
vtkCachingInterpolatedVelocityField::CellCacheHit
int CellCacheHit
Definition: vtkCachingInterpolatedVelocityField.h:124
vtkAbstractCellLocator
an abstract base class for locators which find cells
Definition: vtkAbstractCellLocator.h:50
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
IVFDataSetInfo::SetDataSet
void SetDataSet(vtkDataSet *data, char *velocity, bool staticdataset, vtkAbstractCellLocator *locator)
vtkCachingInterpolatedVelocityField::~vtkCachingInterpolatedVelocityField
~vtkCachingInterpolatedVelocityField()
vtkCachingInterpolatedVelocityField::LastCacheIndex
int LastCacheIndex
Definition: vtkCachingInterpolatedVelocityField.h:127
vtkCachingInterpolatedVelocityField::TempCell
vtkGenericCell * TempCell
Definition: vtkCachingInterpolatedVelocityField.h:123
vtkTemporalInterpolatedVelocityField
A helper class for interpolating between times during particle tracing.
Definition: vtkTemporalInterpolatedVelocityField.h:69
IVFDataSetInfo::VelocityDouble
double * VelocityDouble
Definition: vtkCachingInterpolatedVelocityField.h:180
IVFDataSetInfo::Cell
vtkSmartPointer< vtkGenericCell > Cell
Definition: vtkCachingInterpolatedVelocityField.h:177
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:42
vtkCachingInterpolatedVelocityField::GetLastCell
vtkGenericCell * GetLastCell()
vtkCachingInterpolatedVelocityField::InterpolatePoint
bool InterpolatePoint(vtkPointData *outPD, vtkIdType outIndex)
vtkgl::w
GLubyte GLubyte GLubyte GLubyte w
Definition: vtkgl.h:12054
IVFDataSetInfo::StaticDataSet
bool StaticDataSet
Definition: vtkCachingInterpolatedVelocityField.h:182
IVFDataSetInfo
Definition: vtkCachingInterpolatedVelocityField.h:173
vtkCachingInterpolatedVelocityField::FunctionValues
virtual int FunctionValues(double *x, double *f)
IVFDataSetInfo::PCoords
double PCoords[3]
Definition: vtkCachingInterpolatedVelocityField.h:178