VTK
vtkTemporalFractal.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkTemporalFractal.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
30 #ifndef __vtkTemporalFractal_h
31 #define __vtkTemporalFractal_h
32 
34 
36 class vtkDataSet;
38 class vtkIntArray;
39 class vtkRectilinearGrid;
40 class vtkUniformGrid;
41 
43 {
44 public:
45  static vtkTemporalFractal *New();
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
50 
52  vtkSetMacro(FractalValue, float);
53  vtkGetMacro(FractalValue, float);
55 
57 
60  vtkSetMacro(MaximumLevel, int);
61  vtkGetMacro(MaximumLevel, int);
63 
65 
66  vtkSetMacro(Dimensions, int);
67  vtkGetMacro(Dimensions, int);
69 
71 
72  vtkSetMacro(GhostLevels, int);
73  vtkGetMacro(GhostLevels, int);
74  vtkBooleanMacro(GhostLevels, int);
76 
78 
80  vtkSetMacro(GenerateRectilinearGrids, int);
81  vtkGetMacro(GenerateRectilinearGrids, int);
82  vtkBooleanMacro(GenerateRectilinearGrids, int);
84 
86 
88  vtkSetMacro(DiscreteTimeSteps, int);
89  vtkGetMacro(DiscreteTimeSteps, int);
90  vtkBooleanMacro(DiscreteTimeSteps, int);
92 
94 
95  vtkSetMacro(TwoDimensional, int);
96  vtkGetMacro(TwoDimensional, int);
97  vtkBooleanMacro(TwoDimensional, int);
99 
101 
103  vtkSetMacro(Asymetric,int);
104  vtkGetMacro(Asymetric,int);
106 
108 
109  vtkSetMacro(AdaptiveSubdivision, int);
110  vtkGetMacro(AdaptiveSubdivision, int);
111  vtkBooleanMacro(AdaptiveSubdivision, int);
113 
114 
115 protected:
118 
120  int EndBlock;
122 
124 
126  virtual int RequestInformation(vtkInformation *request,
127  vtkInformationVector **inputVector,
128  vtkInformationVector *outputVector);
130 
132 
134  virtual int RequestData(vtkInformation *request,
135  vtkInformationVector **inputVector,
136  vtkInformationVector *outputVector);
137  virtual int RequestOneTimeStep(vtkCompositeDataSet *output,
138  vtkInformation *request,
139  vtkInformationVector **inputVector,
140  vtkInformationVector *outputVector);
142 
143  void Traverse(int &blockId, int level, vtkDataObject* output,
144  int x0,int x1, int y0,int y1, int z0,int z1,
145  int onFace[6]);
146 
147  int LineTest2(float x0, float y0, float z0,
148  float x1, float y1, float z1,
149  double bds[6]);
150  int LineTest(float x0, float y0, float z0,
151  float x1, float y1, float z1,
152  double bds[6], int level, int target);
153 
154  void SetBlockInfo(vtkUniformGrid *grid, int level, int* ext,int onFace[6]);
155  void SetRBlockInfo(vtkRectilinearGrid *grid, int level, int* ext,
156  int onFace[6]);
157 
158 
159  void AddDataSet(vtkDataObject* output, unsigned int level, int extents[6],
160  vtkDataSet* dataSet);
161 
162  void AddVectorArray(vtkHierarchicalBoxDataSet *output);
163  void AddTestArray(vtkHierarchicalBoxDataSet *output);
164  void AddFractalArray(vtkCompositeDataSet* output);
165  void AddBlockIdArray(vtkHierarchicalBoxDataSet *output);
166  void AddDepthArray(vtkHierarchicalBoxDataSet *output);
167 
168  void AddGhostLevelArray(vtkDataSet *grid,
169  int dim[3],
170  int onFace[6]);
171 
172  int MandelbrotTest(double x, double y);
173  int TwoDTest(double bds[6], int level, int target);
174 
175  void CellExtentToBounds(int level,
176  int ext[6],
177  double bds[6]);
178 
179  void ExecuteRectilinearMandelbrot(vtkRectilinearGrid *grid,
180  double *ptr);
181  double EvaluateSet(double p[4]);
182  void GetContinuousIncrements(int extent[6],
183  vtkIdType &incX,
184  vtkIdType &incY,
185  vtkIdType &incZ);
186 
187  // Dimensions:
188  // Specify blocks relative to this top level block.
189  // For now this has to be set before the blocks are defined.
190  vtkSetVector3Macro(TopLevelSpacing, double);
191  vtkGetVector3Macro(TopLevelSpacing, double);
192  vtkSetVector3Macro(TopLevelOrigin, double);
193  vtkGetVector3Macro(TopLevelOrigin, double);
194 
195  void InternalImageDataCopy(vtkTemporalFractal *src);
196 
205 
206  // New method of specifing blocks.
207  double TopLevelSpacing[3];
208  double TopLevelOrigin[3];
209 
211 
212  double CurrentTime;
213 
215 
216 private:
217  vtkTemporalFractal(const vtkTemporalFractal&); // Not implemented.
218  void operator=(const vtkTemporalFractal&); // Not implemented.
219 };
220 
221 
222 #endif