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 vtkCachingInterpolatedVelocityField_h
44 #define vtkCachingInterpolatedVelocityField_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 
102  void ClearLastCellInfo();
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);
154  vtkGenericCell *GetLastCell();
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;
183  IVFDataSetInfo();
184  IVFDataSetInfo(const IVFDataSetInfo &ivfci);
185  IVFDataSetInfo &operator=(const IVFDataSetInfo &ivfci);
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
#define VTKFILTERSFLOWPATHS_EXPORT
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:61
an abstract base class for locators which find cells
Interface for obtaining interpolated velocity values.
int vtkIdType
Definition: vtkType.h:247
IVFDataSetInfo & operator=(const IVFDataSetInfo &ivfci)
virtual int FunctionValues(double *x, double *f)=0
provides thread-safe access to cells
vtkSmartPointer< vtkAbstractCellLocator > BSPTree
vtkSmartPointer< vtkGenericCell > Cell
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
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)