VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
95  void SetLastCellInfo(vtkIdType c, int datasetindex);
96 
99  void ClearLastCellInfo();
100 
102 
105  int GetLastWeights(double* w);
106  int GetLastLocalCoordinates(double pcoords[3]);
108 
110 
111  vtkGetMacro(CellCacheHit, int);
112  vtkGetMacro(DataSetCacheHit, int);
113  vtkGetMacro(CacheMiss, int);
115 
116 protected:
119 
129 //BTX
130  std::vector<double> Weights;
131 //ETX
132 
133  vtkSetStringMacro(VectorsSelection);
134 
135  // private versions which work on the passed dataset/cache
136  // these do the real computation
137  int FunctionValues(IVFDataSetInfo *cache, double *x, double *f);
138  int InsideTest(IVFDataSetInfo *cache, double* x);
139 
140 //BTX
143 
147  void FastCompute(IVFDataSetInfo *cache, double f[3]);
148  bool InterpolatePoint(vtkPointData *outPD, vtkIdType outIndex);
150  vtkPointData *outPD, vtkIdType outIndex);
151  vtkGenericCell *GetLastCell();
152 //ETX
154 
155 private:
157  void operator=(const vtkCachingInterpolatedVelocityField&); // Not implemented.
158 };
159 
160 //---------------------------------------------------------------------------
161 
163 // IVFDataSetInfo
165 #ifndef DOXYGEN_SHOULD_SKIP_THIS
166 //
167 //BTX
168 //
170 {
171 public:
175  double PCoords[3];
177  double *VelocityDouble;
178  double Tolerance;
180  IVFDataSetInfo();
181  IVFDataSetInfo(const IVFDataSetInfo &ivfci);
182  IVFDataSetInfo &operator=(const IVFDataSetInfo &ivfci);
183  void SetDataSet(vtkDataSet *data, char *velocity, bool staticdataset, vtkAbstractCellLocator *locator);
184  //
185  static const double TOLERANCE_SCALE;
186 };
187 
188 //
189 //ETX
190 //
191 
192 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
193 
194 #endif
#define VTKFILTERSFLOWPATHS_EXPORT
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
GLclampf f
Definition: vtkgl.h:14181
A helper class for interpolating between times during particle tracing.
represent and manipulate point attribute data
Definition: vtkPointData.h:36
abstract class to specify dataset behavior
Definition: vtkDataSet.h:60
an abstract base class for locators which find cells
Interface for obtaining interpolated velocity values.
int vtkIdType
Definition: vtkType.h:268
IVFDataSetInfo & operator=(const IVFDataSetInfo &ivfci)
virtual int FunctionValues(double *x, double *f)=0
provides thread-safe access to cells
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkSmartPointer< vtkAbstractCellLocator > BSPTree
GLubyte GLubyte GLubyte GLubyte w
Definition: vtkgl.h:12054
vtkSmartPointer< vtkGenericCell > Cell
a simple class to control print indentation
Definition: vtkIndent.h:38
const GLubyte * c
Definition: vtkgl.h:15720
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
vtkSmartPointer< vtkDataSet > DataSet
Abstract interface for sets of functions.
virtual void PrintSelf(ostream &os, vtkIndent indent)
bool InterpolatePoint(vtkPointData *outPD1, vtkPointData *outPD2, vtkIdType outIndex)
static vtkObject * New()
void SetDataSet(vtkDataSet *data, char *velocity, bool staticdataset, vtkAbstractCellLocator *locator)