VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 <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;
80 class vtkAbstractInterpolatedVelocityFieldDataSetsType;
81 
82 #include "vtkFiltersFlowPathsModule.h" // For export macro
83 
84 class VTKFILTERSFLOWPATHS_EXPORT vtkAbstractInterpolatedVelocityField : public vtkFunctionSet
85 {
86 public:
87  vtkTypeMacro( vtkAbstractInterpolatedVelocityField, vtkFunctionSet );
88  void PrintSelf( ostream & os, vtkIndent indent );
89 
91 
97  vtkSetMacro( Caching, bool );
98  vtkGetMacro( Caching, bool );
100 
102 
104  vtkGetMacro( CacheHit, int );
105  vtkGetMacro( CacheMiss, int );
107 
108  vtkGetObjectMacro( LastDataSet, vtkDataSet );
109 
111 
112  vtkGetMacro( LastCellId, vtkIdType );
113  virtual void SetLastCellId( vtkIdType c ) { this->LastCellId = c; }
115 
117  virtual void SetLastCellId( vtkIdType c, int dataindex ) = 0;
118 
120 
122  vtkGetStringMacro( VectorsSelection );
123  vtkGetMacro(VectorsType,int);
125 
128  void SelectVectors(int fieldAssociation, const char * fieldName );
129 
130 
132 
148  vtkSetMacro( NormalizeVector, bool );
149  vtkGetMacro( NormalizeVector, bool );
151 
153 
155  { this->Caching = from->Caching; }
157 
158 
160  virtual int FunctionValues( double * x, double * f ) = 0;
161 
164  void ClearLastCellId() { this->LastCellId = -1; }
165 
167 
169  int GetLastWeights( double * w );
170  int GetLastLocalCoordinates( double pcoords[3] );
172 
173 protected:
176 
177  static const double TOLERANCE_SCALE;
178 
179  int CacheHit;
182  bool Caching;
186  double * Weights;
187  double LastPCoords[3];
188  vtkIdType LastCellId;
189  vtkDataSet * LastDataSet;
190  vtkGenericCell * Cell;
191  vtkGenericCell * GenCell; // the current cell
192 
193 
195 
196  vtkSetStringMacro( VectorsSelection );
198 
207  virtual int FunctionValues( vtkDataSet * ds, double * x, double * f );
208 
209 //BTX
212 
216  void FastCompute( vtkDataArray * vectors, double f[3] );
217  bool InterpolatePoint( vtkPointData * outPD, vtkIdType outIndex );
218  vtkGenericCell * GetLastCell()
219  { return ( this->LastCellId != -1 ) ? this->GenCell : NULL; }
220 //ETX
222 
223 private:
225  ( const vtkAbstractInterpolatedVelocityField & ); // Not implemented.
226  void operator = ( const vtkAbstractInterpolatedVelocityField & ); // Not implemented.
227 };
228 
229 
230 
231 #endif
A helper class for interpolating between times during particle tracing.
An abstract class for obtaining the interpolated velocity values at a point.
virtual void CopyParameters(vtkAbstractInterpolatedVelocityField *from)
bool InterpolatePoint(vtkPointData *outPD1, vtkPointData *outPD2, vtkIdType outIndex)