VTK
vtkAbstractInterpolatedVelocityField.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAbstractInterpolatedVelocityField.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 =========================================================================*/
66 #ifndef __vtkAbstractInterpolatedVelocityField_h
67 #define __vtkAbstractInterpolatedVelocityField_h
68 
69 #include "vtkFunctionSet.h"
70 //BTX
71 #include <vtkstd/vector> // STL Header; Required for vector
72 //ETX
73 
74 class vtkDataSet;
75 //BTX
76 class vtkDataArray;
77 //ETX
78 class vtkPointData;
79 class vtkGenericCell;
81 
83 {
84 public:
86  void PrintSelf( ostream & os, vtkIndent indent );
87 
89 
95  vtkSetMacro( Caching, bool );
96  vtkGetMacro( Caching, bool );
98 
100 
102  vtkGetMacro( CacheHit, int );
103  vtkGetMacro( CacheMiss, int );
105 
107 
113  vtkGetMacro( LastDataSetIndex, int );
114  vtkGetObjectMacro( LastDataSet, vtkDataSet );
116 
118 
119  vtkGetMacro( LastCellId, vtkIdType );
120  virtual void SetLastCellId( vtkIdType c ) { this->LastCellId = c; }
122 
124  virtual void SetLastCellId( vtkIdType c, int dataindex ) = 0;
125 
127 
129  vtkGetStringMacro( VectorsSelection );
130  void SelectVectors( const char * fieldName )
131  { this->SetVectorsSelection( fieldName ); }
133 
135 
151  vtkSetMacro( NormalizeVector, bool );
152  vtkGetMacro( NormalizeVector, bool );
154 
156 
157  virtual void CopyParameters( vtkAbstractInterpolatedVelocityField * from )
158  { this->Caching = from->Caching; }
160 
165  virtual void AddDataSet( vtkDataSet * dataset ) = 0;
166 
168  virtual int FunctionValues( double * x, double * f ) = 0;
169 
172  void ClearLastCellId() { this->LastCellId = -1; }
173 
175 
177  int GetLastWeights( double * w );
178  int GetLastLocalCoordinates( double pcoords[3] );
180 
181 protected:
184 
185  static const double TOLERANCE_SCALE;
186 
187  int CacheHit;
191  bool Caching;
194  double * Weights;
195  double LastPCoords[3];
199  vtkGenericCell * GenCell; // the current cell
201 
203 
204  vtkSetStringMacro( VectorsSelection );
206 
215  virtual int FunctionValues( vtkDataSet * ds, double * x, double * f );
216 
217 //BTX
220 
224  void FastCompute( vtkDataArray * vectors, double f[3] );
225  bool InterpolatePoint( vtkPointData * outPD, vtkIdType outIndex );
226  vtkGenericCell * GetLastCell()
227  { return ( this->LastCellId != -1 ) ? this->GenCell : NULL; }
228 //ETX
230 
231 private:
233  ( const vtkAbstractInterpolatedVelocityField & ); // Not implemented.
234  void operator = ( const vtkAbstractInterpolatedVelocityField & ); // Not implemented.
235 };
236 
237 //BTX
238 typedef vtkstd::vector< vtkDataSet * > DataSetsTypeBase;
240 //ETX
241 
242 #endif