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 vtkTypeMacro(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
00124 vtkGetMacro(CurrentWeight,double);
00126
00127 bool InterpolatePoint(vtkPointData *outPD1,
00128 vtkPointData *outPD2, vtkIdType outIndex);
00129
00130 bool InterpolatePoint(int T, vtkPointData *outPD1, vtkIdType outIndex);
00131
00132 bool GetVorticityData(
00133 int T, double pcoords[3], double *weights,
00134 vtkGenericCell *&cell, vtkDoubleArray *cellVectors);
00135
00136 void ShowCacheResults();
00137 bool IsStatic(int datasetIndex);
00138
00139 void AdvanceOneTimeStep();
00140
00141 protected:
00142 vtkTemporalInterpolatedVelocityField();
00143 ~vtkTemporalInterpolatedVelocityField();
00144
00145 int FunctionValues(vtkDataSet* ds, double* x, double* f);
00146 virtual void SetVectorsSelection(const char *v);
00147
00148 double vals1[3];
00149 double vals2[3];
00150 double times[2];
00151 double LastGoodVelocity[3];
00152
00153
00154
00155 double CurrentWeight;
00156
00157 double OneMinusWeight;
00158
00159 double ScaleCoeff;
00160
00161 vtkSmartPointer<vtkCachingInterpolatedVelocityField> ivf[2];
00162
00163 vtkstd::vector<bool> StaticDataSets;
00164
00165 private:
00166
00167
00168 virtual void AddDataSet(vtkDataSet*) {};
00169
00170 private:
00171 vtkTemporalInterpolatedVelocityField(const vtkTemporalInterpolatedVelocityField&);
00172 void operator=(const vtkTemporalInterpolatedVelocityField&);
00173 };
00174
00175 #endif