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 =========================================================================*/
32 #ifndef vtkTemporalFractal_h
33 #define vtkTemporalFractal_h
34 
35 #include "vtkFiltersHybridModule.h" // For export macro
36 #include "vtkAlgorithm.h"
37 #include "vtkSmartPointer.h" //for ivars
38 
40 class vtkDataSet;
42 class vtkIntArray;
43 class vtkRectilinearGrid;
44 class vtkUniformGrid;
45 class TemporalFractalOutputUtil;
46 
47 class VTKFILTERSHYBRID_EXPORT vtkTemporalFractal: public vtkAlgorithm
48 {
49 public:
51 
54  static vtkTemporalFractal *New();
56  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
60 
64  vtkSetMacro(FractalValue, float);
65  vtkGetMacro(FractalValue, float);
67 
69 
74  vtkSetMacro(MaximumLevel, int);
75  vtkGetMacro(MaximumLevel, int);
77 
79 
82  vtkSetMacro(Dimensions, int);
83  vtkGetMacro(Dimensions, int);
85 
87 
90  vtkSetMacro(GhostLevels, vtkTypeBool);
91  vtkGetMacro(GhostLevels, vtkTypeBool);
92  vtkBooleanMacro(GhostLevels, vtkTypeBool);
94 
96 
100  vtkSetMacro(GenerateRectilinearGrids, vtkTypeBool);
101  vtkGetMacro(GenerateRectilinearGrids, vtkTypeBool);
102  vtkBooleanMacro(GenerateRectilinearGrids, vtkTypeBool);
104 
106 
110  vtkSetMacro(DiscreteTimeSteps, vtkTypeBool);
111  vtkGetMacro(DiscreteTimeSteps, vtkTypeBool);
112  vtkBooleanMacro(DiscreteTimeSteps, vtkTypeBool);
114 
116 
119  vtkSetMacro(TwoDimensional, vtkTypeBool);
120  vtkGetMacro(TwoDimensional, vtkTypeBool);
121  vtkBooleanMacro(TwoDimensional, vtkTypeBool);
123 
125 
129  vtkSetMacro(Asymmetric,int);
130  vtkGetMacro(Asymmetric,int);
132 
134 
137  vtkSetMacro(AdaptiveSubdivision, vtkTypeBool);
138  vtkGetMacro(AdaptiveSubdivision, vtkTypeBool);
139  vtkBooleanMacro(AdaptiveSubdivision, vtkTypeBool);
141 
142 
143 protected:
145  ~vtkTemporalFractal() override;
146 
147  int FillOutputPortInformation(int vtkNotUsed(port), vtkInformation* info) override;
148 
150  int EndBlock;
152 
156  int ProcessRequest(vtkInformation* request,
157  vtkInformationVector** inputVector,
158  vtkInformationVector* outputVector) override;
159 
164  virtual int RequestDataObject(vtkInformation*,
167 
172  virtual int RequestInformation(vtkInformation *request,
173  vtkInformationVector **inputVector,
174  vtkInformationVector *outputVector);
175 
177 
181  virtual int RequestData(vtkInformation *request,
182  vtkInformationVector **inputVector,
183  vtkInformationVector *outputVector);
184  virtual int RequestOneTimeStep(vtkCompositeDataSet *output,
185  vtkInformation *request,
186  vtkInformationVector **inputVector,
187  vtkInformationVector *outputVector);
189 
190  void Traverse(int &blockId, int level, vtkDataObject* output,
191  int x0,int x1, int y0,int y1, int z0,int z1,
192  int onFace[6]);
193 
194  int LineTest2(float x0, float y0, float z0,
195  float x1, float y1, float z1,
196  double bds[6]);
197  int LineTest(float x0, float y0, float z0,
198  float x1, float y1, float z1,
199  double bds[6], int level, int target);
200 
201  void SetBlockInfo(vtkUniformGrid *grid, int level, int* ext,int onFace[6]);
202  void SetRBlockInfo(vtkRectilinearGrid *grid, int level, int* ext,
203  int onFace[6]);
204 
205  void AddVectorArray(vtkHierarchicalBoxDataSet *output);
206  void AddTestArray(vtkHierarchicalBoxDataSet *output);
207  void AddFractalArray(vtkCompositeDataSet* output);
208  void AddBlockIdArray(vtkHierarchicalBoxDataSet *output);
209  void AddDepthArray(vtkHierarchicalBoxDataSet *output);
210 
211  void AddGhostLevelArray(vtkDataSet *grid,
212  int dim[3],
213  int onFace[6]);
214 
215  int MandelbrotTest(double x, double y);
216  int TwoDTest(double bds[6], int level, int target);
217 
218  void CellExtentToBounds(int level,
219  int ext[6],
220  double bds[6]);
221 
222  void ExecuteRectilinearMandelbrot(vtkRectilinearGrid *grid,
223  double *ptr);
224  double EvaluateSet(double p[4]);
225  void GetContinuousIncrements(int extent[6],
226  vtkIdType &incX,
227  vtkIdType &incY,
228  vtkIdType &incZ);
229 
230  // Dimensions:
231  // Specify blocks relative to this top level block.
232  // For now this has to be set before the blocks are defined.
233  vtkSetVector3Macro(TopLevelSpacing, double);
234  vtkGetVector3Macro(TopLevelSpacing, double);
235  vtkSetVector3Macro(TopLevelOrigin, double);
236  vtkGetVector3Macro(TopLevelOrigin, double);
237 
238  void InternalImageDataCopy(vtkTemporalFractal *src);
239 
248 
249  // New method of specifying blocks.
250  double TopLevelSpacing[3];
251  double TopLevelOrigin[3];
252 
254 
255  double CurrentTime;
256 
259 
260 private:
261  vtkTemporalFractal(const vtkTemporalFractal&) = delete;
262  void operator=(const vtkTemporalFractal&) = delete;
263 };
264 
265 
266 #endif
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
Backwards compatibility class.
int vtkIdType
Definition: vtkType.h:347
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkTypeBool
Definition: vtkABI.h:69
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:45
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:59
abstract superclass for composite (multi-block or AMR) datasets
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkTypeBool AdaptiveSubdivision
image data with blanking
vtkSmartPointer< TemporalFractalOutputUtil > OutputUtil
A source to test AMR data object.
vtkTypeBool DiscreteTimeSteps
vtkTypeBool GenerateRectilinearGrids
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
general representation of visualization data
Definition: vtkDataObject.h:64