00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00025 #ifndef __vtkHierarchicalFractal_h
00026 #define __vtkHierarchicalFractal_h
00027
00028 #include "vtkHierarchicalDataSetAlgorithm.h"
00029
00030 class vtkIntArray;
00031 class vtkUniformGrid;
00032 class vtkRectilinearGrid;
00033 class vtkDataSet;
00034
00035 class VTK_EXPORT vtkHierarchicalFractal : public vtkHierarchicalDataSetAlgorithm
00036 {
00037 public:
00038 static vtkHierarchicalFractal *New();
00039
00040 vtkTypeRevisionMacro(vtkHierarchicalFractal,vtkHierarchicalDataSetAlgorithm);
00041 void PrintSelf(ostream& os, vtkIndent indent);
00042
00044
00046 vtkSetMacro(FractalValue, float);
00047 vtkGetMacro(FractalValue, float);
00049
00051
00054 vtkSetMacro(MaximumLevel, int);
00055 vtkGetMacro(MaximumLevel, int);
00057
00059
00060 vtkSetMacro(Dimensions, int);
00061 vtkGetMacro(Dimensions, int);
00063
00065
00066 vtkSetMacro(GhostLevels, int);
00067 vtkGetMacro(GhostLevels, int);
00068 vtkBooleanMacro(GhostLevels, int);
00070
00072
00073 vtkSetMacro(TimeStep, int);
00074 vtkGetMacro(TimeStep, int);
00075 vtkGetVector2Macro(TimeStepRange, int);
00077
00079
00081 vtkSetMacro(GenerateRectilinearGrids, int);
00082 vtkGetMacro(GenerateRectilinearGrids, int);
00083 vtkBooleanMacro(GenerateRectilinearGrids, int);
00085
00087
00088 vtkSetMacro(TwoDimensional, int);
00089 vtkGetMacro(TwoDimensional, int);
00090 vtkBooleanMacro(TwoDimensional, int);
00092
00094
00096 vtkSetMacro(Asymetric,int);
00097 vtkGetMacro(Asymetric,int);
00099
00100 protected:
00101 vtkHierarchicalFractal();
00102 ~vtkHierarchicalFractal();
00103
00104 int StartBlock;
00105 int EndBlock;
00106 int BlockCount;
00107 int TimeStep;
00108 int TimeStepRange[2];
00109
00111
00113 virtual int RequestInformation(vtkInformation *request,
00114 vtkInformationVector **inputVector,
00115 vtkInformationVector *outputVector);
00117
00119
00121 virtual int RequestData(vtkInformation *request,
00122 vtkInformationVector **inputVector,
00123 vtkInformationVector *outputVector);
00125
00126 void Traverse(int &blockId, int level, vtkHierarchicalDataSet* output,
00127 int x0,int x1, int y0,int y1, int z0,int z1,
00128 int onFace[6]);
00129
00130 int LineTest2(float x0, float y0, float z0,
00131 float x1, float y1, float z1,
00132 double bds[6]);
00133 int LineTest(float x0, float y0, float z0,
00134 float x1, float y1, float z1,
00135 double bds[6], int level, int target);
00136
00137 void SetBlockInfo(vtkUniformGrid *grid, int level, int* ext,int onFace[6]);
00138 void SetRBlockInfo(vtkRectilinearGrid *grid, int level, int* ext,
00139 int onFace[6]);
00140
00141 void AddVectorArray(vtkHierarchicalDataSet *output);
00142 void AddTestArray(vtkHierarchicalDataSet *output);
00143 void AddFractalArray(vtkHierarchicalDataSet *output);
00144 void AddBlockIdArray(vtkHierarchicalDataSet *output);
00145 void AddDepthArray(vtkHierarchicalDataSet *output);
00146
00147 void AddGhostLevelArray(vtkDataSet *grid,
00148 int dim[3],
00149 int onFace[6]);
00150
00151 int MandelbrotTest(double x, double y);
00152 int TwoDTest(double bds[6], int level, int target);
00153
00154 void CellExtentToBounds(int level,
00155 int ext[6],
00156 double bds[6]);
00157
00158 void ExecuteRectilinearMandelbrot(vtkRectilinearGrid *grid,
00159 double *ptr);
00160 double EvaluateSet(double p[4]);
00161 void GetContinuousIncrements(int extent[6],
00162 vtkIdType &incX,
00163 vtkIdType &incY,
00164 vtkIdType &incZ);
00165
00166
00167
00168
00169 vtkSetVector3Macro(TopLevelSpacing, double);
00170 vtkGetVector3Macro(TopLevelSpacing, double);
00171 vtkSetVector3Macro(TopLevelOrigin, double);
00172 vtkGetVector3Macro(TopLevelOrigin, double);
00173
00174 void InternalImageDataCopy(vtkHierarchicalFractal *src);
00175
00176 int Asymetric;
00177 int MaximumLevel;
00178 int Dimensions;
00179 float FractalValue;
00180 int GhostLevels;
00181 vtkIntArray *Levels;
00182 int TwoDimensional;
00183
00184
00185 double TopLevelSpacing[3];
00186 double TopLevelOrigin[3];
00187
00188 int GenerateRectilinearGrids;
00189
00190 private:
00191 vtkHierarchicalFractal(const vtkHierarchicalFractal&);
00192 void operator=(const vtkHierarchicalFractal&);
00193 };
00194
00195
00196 #endif