VTK  9.2.6
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 "vtkAlgorithm.h"
36 #include "vtkFiltersHybridModule.h" // For export macro
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 protected:
144  ~vtkTemporalFractal() override;
145 
146  int FillOutputPortInformation(int vtkNotUsed(port), vtkInformation* info) override;
147 
149  int EndBlock;
151 
156  vtkInformationVector* outputVector) override;
157 
162  virtual int RequestDataObject(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
163 
168  virtual int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
169  vtkInformationVector* outputVector);
170 
172 
176  virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
177  vtkInformationVector* outputVector);
178  virtual int RequestOneTimeStep(vtkCompositeDataSet* output, vtkInformation* request,
179  vtkInformationVector** inputVector, vtkInformationVector* outputVector);
181 
182  void Traverse(int& blockId, int level, vtkDataObject* output, int x0, int x1, int y0, int y1,
183  int z0, int z1, int onFace[6]);
184 
185  int LineTest2(float x0, float y0, float z0, float x1, float y1, float z1, double bds[6]);
186  int LineTest(float x0, float y0, float z0, float x1, float y1, float z1, double bds[6], int level,
187  int target);
188 
189  void SetBlockInfo(vtkUniformGrid* grid, int level, int* ext, int onFace[6]);
190  void SetRBlockInfo(vtkRectilinearGrid* grid, int level, int* ext, int onFace[6]);
191 
192  void AddVectorArray(vtkHierarchicalBoxDataSet* output);
193  void AddTestArray(vtkHierarchicalBoxDataSet* output);
194  void AddFractalArray(vtkCompositeDataSet* output);
195  void AddBlockIdArray(vtkHierarchicalBoxDataSet* output);
196  void AddDepthArray(vtkHierarchicalBoxDataSet* output);
197 
198  void AddGhostLevelArray(vtkDataSet* grid, int dim[3], int onFace[6]);
199 
200  int MandelbrotTest(double x, double y);
201  int TwoDTest(double bds[6], int level, int target);
202 
203  void CellExtentToBounds(int level, int ext[6], double bds[6]);
204 
205  void ExecuteRectilinearMandelbrot(vtkRectilinearGrid* grid, double* ptr);
206  double EvaluateSet(double p[4]);
207  void GetContinuousIncrements(int extent[6], vtkIdType& incX, vtkIdType& incY, vtkIdType& incZ);
208 
209  // Dimensions:
210  // Specify blocks relative to this top level block.
211  // For now this has to be set before the blocks are defined.
212  vtkSetVector3Macro(TopLevelSpacing, double);
213  vtkGetVector3Macro(TopLevelSpacing, double);
214  vtkSetVector3Macro(TopLevelOrigin, double);
215  vtkGetVector3Macro(TopLevelOrigin, double);
216 
217  void InternalImageDataCopy(vtkTemporalFractal* src);
218 
227 
228  // New method of specifying blocks.
229  double TopLevelSpacing[3];
230  double TopLevelOrigin[3];
231 
233 
234  double CurrentTime;
235 
238 
239 private:
240  vtkTemporalFractal(const vtkTemporalFractal&) = delete;
241  void operator=(const vtkTemporalFractal&) = delete;
242 };
243 
244 #endif
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
Backwards compatibility class.
int vtkIdType
Definition: vtkType.h:332
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
virtual vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:45
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:62
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
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
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:65