vtkHierarchicalFractal.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkHierarchicalFractal_h
17 #define vtkHierarchicalFractal_h
18 
20 #include "vtkPVVTKExtensionsFiltersGeneralModule.h" //needed for exports
21 #include "vtkSmartPointer.h" //for ivars
22 
23 class vtkIntArray;
24 class vtkUniformGrid;
25 class vtkRectilinearGrid;
26 class vtkDataSet;
28 class HierarchicalFractalOutputUtil;
29 
32 {
33 public:
34  static vtkHierarchicalFractal* New();
35 
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
40 
45  vtkSetMacro(FractalValue, float);
46  vtkGetMacro(FractalValue, float);
48 
50 
55  vtkSetMacro(MaximumLevel, int);
56  vtkGetMacro(MaximumLevel, int);
58 
60 
63  vtkSetMacro(Dimensions, int);
64  vtkGetMacro(Dimensions, int);
66 
68 
71  vtkSetMacro(GhostLevels, int);
72  vtkGetMacro(GhostLevels, int);
73  vtkBooleanMacro(GhostLevels, int);
75 
77 
80  vtkSetMacro(TimeStep, int);
81  vtkGetMacro(TimeStep, int);
82  vtkGetVector2Macro(TimeStepRange, int);
84 
86 
90  vtkSetMacro(GenerateRectilinearGrids, int);
91  vtkGetMacro(GenerateRectilinearGrids, int);
92  vtkBooleanMacro(GenerateRectilinearGrids, int);
94 
96 
99  vtkSetMacro(TwoDimensional, int);
100  vtkGetMacro(TwoDimensional, int);
101  vtkBooleanMacro(TwoDimensional, int);
103 
105 
109  vtkSetMacro(Asymetric, int);
110  vtkGetMacro(Asymetric, int);
112 
114 
118  vtkSetMacro(Overlap, int);
119  vtkGetMacro(Overlap, int);
121 
122 protected:
124  ~vtkHierarchicalFractal() override;
125 
127  int EndBlock;
129  int TimeStep;
130  int TimeStepRange[2];
131 
132  // Create either vtkHierarchicalBoxDataSet or vtkMultiBlockDataSet based on
133  // the GenerateRectilinearGrids flag.
134  int RequestDataObject(
135  vtkInformation* req, vtkInformationVector** inV, vtkInformationVector* outV) override;
136 
141  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
142  vtkInformationVector* outputVector) override;
143 
148  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
149  vtkInformationVector* outputVector) override;
150 
151  void Traverse(int& blockId, int level, vtkCompositeDataSet* output, int x0, int x1, int y0,
152  int y1, int z0, int z1, int onFace[6]);
153 
154  int LineTest2(float x0, float y0, float z0, float x1, float y1, float z1, double bds[6]);
155  int LineTest(float x0, float y0, float z0, float x1, float y1, float z1, double bds[6], int level,
156  int target);
157 
158  void SetBlockInfo(vtkUniformGrid* grid, int level, int* ext, int onFace[6]);
159  void SetRBlockInfo(vtkRectilinearGrid* grid, int level, int* ext, int onFace[6]);
160 
161  void AddVectorArray(vtkCompositeDataSet* output);
162  void AddTestArray(vtkCompositeDataSet* output);
163  void AddFractalArray(vtkCompositeDataSet* output);
164  void AddBlockIdArray(vtkCompositeDataSet* output);
165  void AddDepthArray(vtkHierarchicalBoxDataSet* output);
166 
167  void AddGhostLevelArray(vtkDataSet* grid, int dim[3], int onFace[6]);
168 
169  int MandelbrotTest(double x, double y);
170  int TwoDTest(double bds[6], int level, int target);
171 
172  void CellExtentToBounds(int level, int ext[6], double bds[6]);
173 
174  void ExecuteRectilinearMandelbrot(vtkRectilinearGrid* grid, double* ptr);
175  double EvaluateSet(double p[4]);
176  void GetContinuousIncrements(int extent[6], vtkIdType& incX, vtkIdType& incY, vtkIdType& incZ);
177 
178  // Dimensions:
179  // Specify blocks relative to this top level block.
180  // For now this has to be set before the blocks are defined.
181  vtkSetVector3Macro(TopLevelSpacing, double);
182  vtkGetVector3Macro(TopLevelSpacing, double);
183  vtkSetVector3Macro(TopLevelOrigin, double);
184  vtkGetVector3Macro(TopLevelOrigin, double);
185 
186  void InternalImageDataCopy(vtkHierarchicalFractal* src);
187 
188  int Overlap;
196 
197  // New method of specifying blocks.
198  double TopLevelSpacing[3];
199  double TopLevelOrigin[3];
200 
202 
204  OutputUtil; // convenient class to create composite output
205 
206 private:
208  void operator=(const vtkHierarchicalFractal&) = delete;
209 };
210 
211 #endif
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkSmartPointer< HierarchicalFractalOutputUtil > OutputUtil
int vtkIdType
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
#define VTKPVVTKEXTENSIONSFILTERSGENERAL_EXPORT
static vtkCompositeDataSetAlgorithm * New()
A source to test AMR data object.
void operator=(const vtkObjectBase &)