VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Filters/FlowPaths/vtkAbstractInterpolatedVelocityField.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkAbstractInterpolatedVelocityField.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00066 #ifndef vtkAbstractInterpolatedVelocityField_h
00067 #define vtkAbstractInterpolatedVelocityField_h
00068 
00069 #include "vtkFunctionSet.h"
00070 //BTX
00071 #include <vector> // STL Header; Required for vector
00072 //ETX
00073 
00074 class vtkDataSet;
00075 //BTX
00076 class vtkDataArray;
00077 //ETX
00078 class vtkPointData;
00079 class vtkGenericCell;
00080 class vtkAbstractInterpolatedVelocityFieldDataSetsType;
00081 
00082 #include "vtkFiltersFlowPathsModule.h" // For export macro
00083 
00084 class VTKFILTERSFLOWPATHS_EXPORT vtkAbstractInterpolatedVelocityField : public vtkFunctionSet
00085 {
00086 public:
00087   vtkTypeMacro( vtkAbstractInterpolatedVelocityField, vtkFunctionSet );
00088   void PrintSelf( ostream & os, vtkIndent indent );
00089 
00091 
00097   vtkSetMacro( Caching, bool );
00098   vtkGetMacro( Caching, bool );
00100 
00102 
00104   vtkGetMacro( CacheHit, int );
00105   vtkGetMacro( CacheMiss, int );
00107 
00108   vtkGetObjectMacro( LastDataSet, vtkDataSet );
00109 
00111 
00112   vtkGetMacro( LastCellId, vtkIdType );
00113   virtual void SetLastCellId( vtkIdType c ) { this->LastCellId = c; }
00115 
00117   virtual void SetLastCellId( vtkIdType c, int dataindex ) = 0;
00118 
00120 
00122   vtkGetStringMacro( VectorsSelection );
00123   vtkGetMacro(VectorsType,int);
00125 
00128   void SelectVectors(int fieldAssociation, const char * fieldName );
00129 
00130 
00132 
00148   vtkSetMacro( NormalizeVector, bool );
00149   vtkGetMacro( NormalizeVector, bool );
00151 
00153 
00154   virtual void CopyParameters( vtkAbstractInterpolatedVelocityField * from )
00155     { this->Caching = from->Caching; }
00157 
00158 
00160   virtual int FunctionValues( double * x, double * f ) = 0;
00161 
00164   void ClearLastCellId() { this->LastCellId = -1; }
00165 
00167 
00169   int GetLastWeights( double * w );
00170   int GetLastLocalCoordinates( double pcoords[3] );
00172 
00173 protected:
00174   vtkAbstractInterpolatedVelocityField();
00175   ~vtkAbstractInterpolatedVelocityField();
00176 
00177   static const double TOLERANCE_SCALE;
00178 
00179   int       CacheHit;
00180   int       CacheMiss;
00181   int       WeightsSize;
00182   bool      Caching;
00183   bool      NormalizeVector;
00184   int       VectorsType;
00185   char *    VectorsSelection;
00186   double *  Weights;
00187   double    LastPCoords[3];
00188   vtkIdType LastCellId;
00189   vtkDataSet *     LastDataSet;
00190   vtkGenericCell * Cell;
00191   vtkGenericCell * GenCell; // the current cell
00192 
00193 
00195 
00196   vtkSetStringMacro( VectorsSelection );
00198 
00207   virtual int FunctionValues( vtkDataSet * ds, double * x, double * f );
00208 
00209 //BTX
00210   friend class vtkTemporalInterpolatedVelocityField;
00212 
00216   void FastCompute( vtkDataArray * vectors, double f[3] );
00217   bool InterpolatePoint( vtkPointData * outPD, vtkIdType outIndex );
00218   vtkGenericCell * GetLastCell()
00219     { return ( this->LastCellId != -1 ) ? this->GenCell : NULL; }
00220 //ETX
00222 
00223 private:
00224   vtkAbstractInterpolatedVelocityField
00225     ( const vtkAbstractInterpolatedVelocityField & );  // Not implemented.
00226   void operator = ( const vtkAbstractInterpolatedVelocityField & );  // Not implemented.
00227 };
00228 
00229 
00230 
00231 #endif