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 
33 #include "vtkFiltersHybridModule.h" // For export macro
34 #include "vtkAlgorithm.h"
35 
37 class vtkDataSet;
39 class vtkIntArray;
40 class vtkRectilinearGrid;
41 class vtkUniformGrid;
42 
43 class VTKFILTERSHYBRID_EXPORT vtkTemporalFractal: public vtkAlgorithm
44 {
45 public:
46  static vtkTemporalFractal *New();
48  void PrintSelf(ostream& os, vtkIndent indent);
49 
51 
53  vtkSetMacro(FractalValue, float);
54  vtkGetMacro(FractalValue, float);
56 
58 
61  vtkSetMacro(MaximumLevel, int);
62  vtkGetMacro(MaximumLevel, int);
64 
66 
67  vtkSetMacro(Dimensions, int);
68  vtkGetMacro(Dimensions, int);
70 
72 
73  vtkSetMacro(GhostLevels, int);
74  vtkGetMacro(GhostLevels, int);
75  vtkBooleanMacro(GhostLevels, int);
77 
79 
81  vtkSetMacro(GenerateRectilinearGrids, int);
82  vtkGetMacro(GenerateRectilinearGrids, int);
83  vtkBooleanMacro(GenerateRectilinearGrids, int);
85 
87 
89  vtkSetMacro(DiscreteTimeSteps, int);
90  vtkGetMacro(DiscreteTimeSteps, int);
91  vtkBooleanMacro(DiscreteTimeSteps, int);
93 
95 
96  vtkSetMacro(TwoDimensional, int);
97  vtkGetMacro(TwoDimensional, int);
98  vtkBooleanMacro(TwoDimensional, int);
100 
102 
104  vtkSetMacro(Asymetric,int);
105  vtkGetMacro(Asymetric,int);
107 
109 
110  vtkSetMacro(AdaptiveSubdivision, int);
111  vtkGetMacro(AdaptiveSubdivision, int);
112  vtkBooleanMacro(AdaptiveSubdivision, int);
114 
115 
116 protected:
119 
120  virtual int FillOutputPortInformation(int vtkNotUsed(port), vtkInformation* info);
121 
123  int EndBlock;
125 
127 
128  virtual int ProcessRequest(vtkInformation* request,
129  vtkInformationVector** inputVector,
130  vtkInformationVector* outputVector);
132 
134 
136  virtual int RequestDataObject(vtkInformation*,
140 
142 
144  virtual int RequestInformation(vtkInformation *request,
145  vtkInformationVector **inputVector,
146  vtkInformationVector *outputVector);
148 
150 
152  virtual int RequestData(vtkInformation *request,
153  vtkInformationVector **inputVector,
154  vtkInformationVector *outputVector);
155  virtual int RequestOneTimeStep(vtkCompositeDataSet *output,
156  vtkInformation *request,
157  vtkInformationVector **inputVector,
158  vtkInformationVector *outputVector);
160 
161  void Traverse(int &blockId, int level, vtkDataObject* output,
162  int x0,int x1, int y0,int y1, int z0,int z1,
163  int onFace[6]);
164 
165  int LineTest2(float x0, float y0, float z0,
166  float x1, float y1, float z1,
167  double bds[6]);
168  int LineTest(float x0, float y0, float z0,
169  float x1, float y1, float z1,
170  double bds[6], int level, int target);
171 
172  void SetBlockInfo(vtkUniformGrid *grid, int level, int* ext,int onFace[6]);
173  void SetRBlockInfo(vtkRectilinearGrid *grid, int level, int* ext,
174  int onFace[6]);
175 
176 
177  void AddDataSet(vtkDataObject* output, unsigned int level, int extents[6],
178  vtkDataSet* dataSet);
179 
180  void AddVectorArray(vtkHierarchicalBoxDataSet *output);
181  void AddTestArray(vtkHierarchicalBoxDataSet *output);
182  void AddFractalArray(vtkCompositeDataSet* output);
183  void AddBlockIdArray(vtkHierarchicalBoxDataSet *output);
184  void AddDepthArray(vtkHierarchicalBoxDataSet *output);
185 
186  void AddGhostLevelArray(vtkDataSet *grid,
187  int dim[3],
188  int onFace[6]);
189 
190  int MandelbrotTest(double x, double y);
191  int TwoDTest(double bds[6], int level, int target);
192 
193  void CellExtentToBounds(int level,
194  int ext[6],
195  double bds[6]);
196 
197  void ExecuteRectilinearMandelbrot(vtkRectilinearGrid *grid,
198  double *ptr);
199  double EvaluateSet(double p[4]);
200  void GetContinuousIncrements(int extent[6],
201  vtkIdType &incX,
202  vtkIdType &incY,
203  vtkIdType &incZ);
204 
205  // Dimensions:
206  // Specify blocks relative to this top level block.
207  // For now this has to be set before the blocks are defined.
208  vtkSetVector3Macro(TopLevelSpacing, double);
209  vtkGetVector3Macro(TopLevelSpacing, double);
210  vtkSetVector3Macro(TopLevelOrigin, double);
211  vtkGetVector3Macro(TopLevelOrigin, double);
212 
213  void InternalImageDataCopy(vtkTemporalFractal *src);
214 
223 
224  // New method of specifing blocks.
225  double TopLevelSpacing[3];
226  double TopLevelOrigin[3];
227 
229 
230  double CurrentTime;
231 
233 
234 private:
235  vtkTemporalFractal(const vtkTemporalFractal&); // Not implemented.
236  void operator=(const vtkTemporalFractal&); // Not implemented.
237 };
238 
239 
240 #endif