00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00038 #ifndef __vtkTemporalInterpolatedVelocityField_h
00039 #define __vtkTemporalInterpolatedVelocityField_h
00040
00041 #include "vtkFunctionSet.h"
00042
00043 #define ID_INSIDE_ALL 00
00044 #define ID_OUTSIDE_ALL 01
00045 #define ID_OUTSIDE_T1 02
00046 #define ID_OUTSIDE_T2 03
00047
00048 class vtkDataSet;
00049 class vtkDataArray;
00050 class vtkPointData;
00051 class vtkGenericCell;
00052 class vtkDoubleArray;
00053 class vtkInterpolatedVelocityField;
00054 class vtkTInterpolatedVelocityFieldDataSetsType;
00055
00056 class VTK_PARALLEL_EXPORT vtkTemporalInterpolatedVelocityField : public vtkFunctionSet
00057 {
00058 public:
00059 vtkTypeRevisionMacro(vtkTemporalInterpolatedVelocityField,vtkFunctionSet);
00060 virtual void PrintSelf(ostream& os, vtkIndent indent);
00061
00064 static vtkTemporalInterpolatedVelocityField *New();
00065
00068 virtual int FunctionValues(double* x, double* u);
00069
00071
00074 void SelectVectors(const char *fieldName)
00075 {this->SetVectorsSelection(fieldName);}
00077
00080 void AddDataSetAtTime(int N, double T, vtkDataSet* dataset);
00081
00083
00087 void SetGeometryFixed(int g)
00088 { this->GeometryFixed = g; }
00089 int GetGeometryFixed()
00090 { return this->GeometryFixed; }
00092
00094
00097 bool GetCachedCellIds(vtkIdType id[2], int ds[2]);
00098 void SetCachedCellIds(vtkIdType id[2], int ds[2]);
00100
00103 void ClearCache();
00104
00107 int TestPoint(double* x);
00108
00110
00112 vtkGetVector3Macro(LastGoodVelocity,double);
00114
00116
00117 vtkGetMacro(CurrentWeight,double);
00119
00120 bool InterpolatePoint(
00121 vtkPointData *outPD1, vtkPointData *outPD2, vtkIdType outIndex);
00122 bool InterpolatePointAtT(
00123 int T, vtkPointData *outPD, vtkIdType outIndex);
00124
00125 bool GetVorticityData(
00126 int T, double pcoords[3], double *weights,
00127 vtkGenericCell *&cell, vtkDoubleArray *cellVectors);
00128
00129 protected:
00130 vtkTemporalInterpolatedVelocityField();
00131 ~vtkTemporalInterpolatedVelocityField();
00132
00133 vtkInterpolatedVelocityField *ivf[2];
00134
00135 int FunctionValues(vtkDataSet* ds, double* x, double* f);
00136 virtual void SetVectorsSelection(const char *v);
00137
00138 double vals1[3];
00139 double vals2[3];
00140 double times[2];
00141 double LastGoodVelocity[3];
00142
00143
00144
00145 double CurrentWeight;
00146
00147 double OneMinusWeight;
00148
00149 double ScaleCoeff;
00150
00151
00152 int GeometryFixed;
00153
00154
00155 vtkTInterpolatedVelocityFieldDataSetsType* DataSets[2];
00156
00157
00158 private:
00159
00160
00161 virtual void AddDataSet(vtkDataSet*) {};
00162
00163 private:
00164 vtkTemporalInterpolatedVelocityField(const vtkTemporalInterpolatedVelocityField&);
00165 void operator=(const vtkTemporalInterpolatedVelocityField&);
00166 };
00167
00168 #endif