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;
57 class vtkAbstractCellLocator;
58 //BTX
59 //---------------------------------------------------------------------------
60 class IVFDataSetInfo;
61 //---------------------------------------------------------------------------
62 class IVFCacheList : public std::vector< IVFDataSetInfo > {};
63 //---------------------------------------------------------------------------
64 //ETX
65 class VTKFILTERSFLOWPATHS_EXPORT vtkCachingInterpolatedVelocityField : public vtkFunctionSet
66 {
67 public:
68  vtkTypeMacro(vtkCachingInterpolatedVelocityField,vtkFunctionSet);
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 
120  vtkGenericCell *TempCell;
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);
149  vtkGenericCell *GetLastCell();
150 //ETX
152 
153 private:
155  void operator=(const vtkCachingInterpolatedVelocityField&); // Not implemented.
156 };
157 
158 //---------------------------------------------------------------------------
159 
161 // IVFDataSetInfo
163 #ifndef DOXYGEN_SHOULD_SKIP_THIS
164 //
165 //BTX
166 //
168 {
169 public:
170  vtkSmartPointer<vtkDataSet> DataSet;
171  vtkSmartPointer<vtkAbstractCellLocator> BSPTree;
172  vtkSmartPointer<vtkGenericCell> Cell;
173  double PCoords[3];
175  double *VelocityDouble;
176  double Tolerance;
178  IVFDataSetInfo();
179  IVFDataSetInfo(const IVFDataSetInfo &ivfci);
180  IVFDataSetInfo &operator=(const IVFDataSetInfo &ivfci);
181  void SetDataSet(vtkDataSet *data, char *velocity, bool staticdataset, vtkAbstractCellLocator *locator);
182  //
183  static const double TOLERANCE_SCALE;
184 };
185 
186 //
187 //ETX
188 //
189 
190 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
191 
192 #endif
A helper class for interpolating between times during particle tracing.
Interface for obtaining interpolated velocity values.
IVFDataSetInfo & operator=(const IVFDataSetInfo &ivfci)
vtkSmartPointer< vtkAbstractCellLocator > BSPTree
vtkSmartPointer< vtkGenericCell > Cell
vtkSmartPointer< vtkDataSet > DataSet
bool InterpolatePoint(vtkPointData *outPD1, vtkPointData *outPD2, vtkIdType outIndex)
void SetDataSet(vtkDataSet *data, char *velocity, bool staticdataset, vtkAbstractCellLocator *locator)