00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00046 #ifndef __vtkTemporalInterpolatedVelocityField_h
00047 #define __vtkTemporalInterpolatedVelocityField_h
00048
00049 #include "vtkFunctionSet.h"
00050 #include "vtkSmartPointer.h"
00051
00052 #include <vtkstd/vector>
00053
00054
00055 #define ID_INSIDE_ALL 00
00056 #define ID_OUTSIDE_ALL 01
00057 #define ID_OUTSIDE_T0 02
00058 #define ID_OUTSIDE_T1 03
00059
00060 class vtkDataSet;
00061 class vtkDataArray;
00062 class vtkPointData;
00063 class vtkGenericCell;
00064 class vtkDoubleArray;
00065 class vtkCachingInterpolatedVelocityField;
00066
00067 class VTK_PARALLEL_EXPORT vtkTemporalInterpolatedVelocityField : public vtkFunctionSet
00068 {
00069 public:
00070 vtkTypeRevisionMacro(vtkTemporalInterpolatedVelocityField,vtkFunctionSet);
00071 virtual void PrintSelf(ostream& os, vtkIndent indent);
00072
00075 static vtkTemporalInterpolatedVelocityField *New();
00076
00078
00080 virtual int FunctionValues(double* x, double* u);
00081 int FunctionValuesAtT(int T, double* x, double* u);
00083
00085
00088 void SelectVectors(const char *fieldName)
00089 {this->SetVectorsSelection(fieldName);}
00091
00094 void SetDataSetAtTime(int I, int N, double T, vtkDataSet* dataset, bool staticdataset);
00095
00097
00100 bool GetCachedCellIds(vtkIdType id[2], int ds[2]);
00101 void SetCachedCellIds(vtkIdType id[2], int ds[2]);
00103
00106 void ClearCache();
00107
00109
00111 int TestPoint(double* x);
00112 int QuickTestPoint(double* x);
00114
00116
00118 vtkGetVector3Macro(LastGoodVelocity,double);
00120
00122
00123 vtkGetMacro(CurrentWeight,double);
00125
00126 bool InterpolatePoint(vtkPointData *outPD1,
00127 vtkPointData *outPD2, vtkIdType outIndex);
00128
00129 bool InterpolatePoint(int T, vtkPointData *outPD1, vtkIdType outIndex);
00130
00131 bool GetVorticityData(
00132 int T, double pcoords[3], double *weights,
00133 vtkGenericCell *&cell, vtkDoubleArray *cellVectors);
00134
00135 void ShowCacheResults();
00136 bool IsStatic(int datasetIndex);
00137
00138 void AdvanceOneTimeStep();
00139
00140 protected:
00141 vtkTemporalInterpolatedVelocityField();
00142 ~vtkTemporalInterpolatedVelocityField();
00143
00144 int FunctionValues(vtkDataSet* ds, double* x, double* f);
00145 virtual void SetVectorsSelection(const char *v);
00146
00147 double vals1[3];
00148 double vals2[3];
00149 double times[2];
00150 double LastGoodVelocity[3];
00151
00152
00153
00154 double CurrentWeight;
00155
00156 double OneMinusWeight;
00157
00158 double ScaleCoeff;
00159
00160 vtkSmartPointer<vtkCachingInterpolatedVelocityField> ivf[2];
00161
00162 vtkstd::vector<bool> StaticDataSets;
00163
00164 private:
00165
00166
00167 virtual void AddDataSet(vtkDataSet*) {};
00168
00169 private:
00170 vtkTemporalInterpolatedVelocityField(const vtkTemporalInterpolatedVelocityField&);
00171 void operator=(const vtkTemporalInterpolatedVelocityField&);
00172 };
00173
00174 #endif