00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00040 #ifndef __vtkInterpolatedVelocityField_h
00041 #define __vtkInterpolatedVelocityField_h
00042 
00043 #include "vtkFunctionSet.h"
00044 
00045 class vtkDataSet;
00046 class vtkGenericCell;
00047 
00048 class vtkInterpolatedVelocityFieldDataSetsType;
00049 
00050 class VTK_FILTERING_EXPORT vtkInterpolatedVelocityField : public vtkFunctionSet
00051 {
00052 public:
00053   vtkTypeRevisionMacro(vtkInterpolatedVelocityField,vtkFunctionSet);
00054   virtual void PrintSelf(ostream& os, vtkIndent indent);
00055 
00058   static vtkInterpolatedVelocityField *New();
00059 
00062   virtual int FunctionValues(double* x, double* f);
00063 
00068   virtual void AddDataSet(vtkDataSet* dataset);
00069 
00071 
00072   vtkGetMacro(LastCellId, vtkIdType);
00073   vtkSetMacro(LastCellId, vtkIdType);
00075 
00078   void ClearLastCellId() { this->LastCellId = -1; }
00079 
00081 
00084   int GetLastWeights(double* w);
00085   int GetLastLocalCoordinates(double pcoords[3]);
00087 
00089 
00090   vtkGetMacro(Caching, int);
00091   vtkSetMacro(Caching, int);
00092   vtkBooleanMacro(Caching, int);
00094 
00096 
00097   vtkGetMacro(CacheHit, int);
00098   vtkGetMacro(CacheMiss, int);
00100 
00102 
00105   vtkGetStringMacro(VectorsSelection);
00106   void SelectVectors(const char *fieldName) 
00107     {this->SetVectorsSelection(fieldName);}
00109   
00111 
00115   vtkGetObjectMacro(LastDataSet, vtkDataSet);
00117 
00120   virtual void CopyParameters(vtkInterpolatedVelocityField* from);
00121 
00122 protected:
00123   vtkInterpolatedVelocityField();
00124   ~vtkInterpolatedVelocityField();
00125 
00126   vtkGenericCell* GenCell; 
00127   vtkGenericCell* Cell;
00128   double* Weights; 
00129   int WeightsSize;
00130   double LastPCoords[3]; 
00131   vtkIdType LastCellId;
00132   int CacheHit;
00133   int CacheMiss;
00134   int Caching;
00135 
00136   vtkDataSet* LastDataSet;
00137 
00138   vtkSetStringMacro(VectorsSelection);
00139   char *VectorsSelection;
00140 
00141   vtkInterpolatedVelocityFieldDataSetsType* DataSets;
00142 
00143   int FunctionValues(vtkDataSet* ds, double* x, double* f);
00144 
00145   static const double TOLERANCE_SCALE;
00146 
00147 private:
00148   vtkInterpolatedVelocityField(const vtkInterpolatedVelocityField&);  
00149   void operator=(const vtkInterpolatedVelocityField&);  
00150 };
00151 
00152 #endif
00153 
00154 
00155 
00156 
00157 
00158 
00159 
00160