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 "vtkFunctionSet.h"
47 #include "vtkSmartPointer.h" // this is allowed
48 //BTX
49 #include <vtkstd/vector> // we need them
50 //ETX
51 
52 class vtkDataSet;
53 class vtkDataArray;
54 class vtkPointData;
55 class vtkGenericCell;
57 //BTX
58 //---------------------------------------------------------------------------
59 class IVFDataSetInfo;
60 //---------------------------------------------------------------------------
61 class IVFCacheList : public vtkstd::vector< IVFDataSetInfo > {};
62 //---------------------------------------------------------------------------
63 //ETX
65 {
66 public:
68  virtual void PrintSelf(ostream& os, vtkIndent indent);
69 
73 
75 
77  virtual int FunctionValues(double* x, double* f);
78  virtual int InsideTest(double* x);
80 
82  virtual void SetDataSet(int I, vtkDataSet* dataset, bool staticdataset, vtkAbstractCellLocator *locator);
83 
85 
88  vtkGetStringMacro(VectorsSelection);
89  void SelectVectors(const char *fieldName)
90  {this->SetVectorsSelection(fieldName);}
92 
94  void SetLastCellInfo(vtkIdType c, int datasetindex);
95 
98  void ClearLastCellInfo();
99 
101 
104  int GetLastWeights(double* w);
105  int GetLastLocalCoordinates(double pcoords[3]);
107 
109 
110  vtkGetMacro(CellCacheHit, int);
111  vtkGetMacro(DataSetCacheHit, int);
112  vtkGetMacro(CacheMiss, int);
114 
115 protected:
118 
128 //BTX
129  vtkstd::vector<double> Weights;
130 //ETX
131 
132  vtkSetStringMacro(VectorsSelection);
133 
134  // private versions which work on the passed dataset/cache
135  // these do the real computation
136  int FunctionValues(IVFDataSetInfo *cache, double *x, double *f);
137  int InsideTest(IVFDataSetInfo *cache, double* x);
138 
139 //BTX
142 
146  void FastCompute(IVFDataSetInfo *cache, double f[3]);
147  bool InterpolatePoint(vtkPointData *outPD, vtkIdType outIndex);
148  vtkGenericCell *GetLastCell();
149 //ETX
151 
152 private:
154  void operator=(const vtkCachingInterpolatedVelocityField&); // Not implemented.
155 };
156 
157 //---------------------------------------------------------------------------
158 
160 // IVFDataSetInfo
162 #ifndef DOXYGEN_SHOULD_SKIP_THIS
163 //
164 //BTX
165 //
167 {
168 public:
172  double PCoords[3];
174  double *VelocityDouble;
175  double Tolerance;
177  IVFDataSetInfo();
178  IVFDataSetInfo(const IVFDataSetInfo &ivfci);
179  IVFDataSetInfo &operator=(const IVFDataSetInfo &ivfci);
180  void SetDataSet(vtkDataSet *data, char *velocity, bool staticdataset, vtkAbstractCellLocator *locator);
181  //
182  static const double TOLERANCE_SCALE;
183 };
184 
185 //
186 //ETX
187 //
188 
189 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
190 
191 #endif