vtkHierarchicalFractal.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkHierarchicalFractal.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 =========================================================================*/
28 #ifndef vtkHierarchicalFractal_h
29 #define vtkHierarchicalFractal_h
30 
32 #include "vtkPVVTKExtensionsFiltersGeneralModule.h" //needed for exports
33 #include "vtkSmartPointer.h" //for ivars
34 
35 class vtkIntArray;
36 class vtkUniformGrid;
37 class vtkRectilinearGrid;
38 class vtkDataSet;
40 class HierarchicalFractalOutputUtil;
41 
44 {
45 public:
46  static vtkHierarchicalFractal* New();
47 
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
57  vtkSetMacro(FractalValue, float);
58  vtkGetMacro(FractalValue, float);
60 
62 
67  vtkSetMacro(MaximumLevel, int);
68  vtkGetMacro(MaximumLevel, int);
70 
72 
75  vtkSetMacro(Dimensions, int);
76  vtkGetMacro(Dimensions, int);
78 
80 
83  vtkSetMacro(GhostLevels, int);
84  vtkGetMacro(GhostLevels, int);
85  vtkBooleanMacro(GhostLevels, int);
87 
89 
92  vtkSetMacro(TimeStep, int);
93  vtkGetMacro(TimeStep, int);
94  vtkGetVector2Macro(TimeStepRange, int);
96 
98 
102  vtkSetMacro(GenerateRectilinearGrids, int);
103  vtkGetMacro(GenerateRectilinearGrids, int);
104  vtkBooleanMacro(GenerateRectilinearGrids, int);
106 
108 
111  vtkSetMacro(TwoDimensional, int);
112  vtkGetMacro(TwoDimensional, int);
113  vtkBooleanMacro(TwoDimensional, int);
115 
117 
121  vtkSetMacro(Asymetric, int);
122  vtkGetMacro(Asymetric, int);
124 
126 
130  vtkSetMacro(Overlap, int);
131  vtkGetMacro(Overlap, int);
133 
134 protected:
136  ~vtkHierarchicalFractal() override;
137 
139  int EndBlock;
141  int TimeStep;
142  int TimeStepRange[2];
143 
144  // Create either vtkHierarchicalBoxDataSet or vtkMultiBlockDataSet based on
145  // the GenerateRectilinearGrids flag.
146  int RequestDataObject(
147  vtkInformation* req, vtkInformationVector** inV, vtkInformationVector* outV) override;
148 
153  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
154  vtkInformationVector* outputVector) override;
155 
160  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
161  vtkInformationVector* outputVector) override;
162 
163  void Traverse(int& blockId, int level, vtkCompositeDataSet* output, int x0, int x1, int y0,
164  int y1, int z0, int z1, int onFace[6]);
165 
166  int LineTest2(float x0, float y0, float z0, float x1, float y1, float z1, double bds[6]);
167  int LineTest(float x0, float y0, float z0, float x1, float y1, float z1, double bds[6], int level,
168  int target);
169 
170  void SetBlockInfo(vtkUniformGrid* grid, int level, int* ext, int onFace[6]);
171  void SetRBlockInfo(vtkRectilinearGrid* grid, int level, int* ext, int onFace[6]);
172 
173  void AddVectorArray(vtkCompositeDataSet* output);
174  void AddTestArray(vtkCompositeDataSet* output);
175  void AddFractalArray(vtkCompositeDataSet* output);
176  void AddBlockIdArray(vtkCompositeDataSet* output);
177  void AddDepthArray(vtkHierarchicalBoxDataSet* output);
178 
179  void AddGhostLevelArray(vtkDataSet* grid, int dim[3], int onFace[6]);
180 
181  int MandelbrotTest(double x, double y);
182  int TwoDTest(double bds[6], int level, int target);
183 
184  void CellExtentToBounds(int level, int ext[6], double bds[6]);
185 
186  void ExecuteRectilinearMandelbrot(vtkRectilinearGrid* grid, double* ptr);
187  double EvaluateSet(double p[4]);
188  void GetContinuousIncrements(int extent[6], vtkIdType& incX, vtkIdType& incY, vtkIdType& incZ);
189 
190  // Dimensions:
191  // Specify blocks relative to this top level block.
192  // For now this has to be set before the blocks are defined.
193  vtkSetVector3Macro(TopLevelSpacing, double);
194  vtkGetVector3Macro(TopLevelSpacing, double);
195  vtkSetVector3Macro(TopLevelOrigin, double);
196  vtkGetVector3Macro(TopLevelOrigin, double);
197 
198  void InternalImageDataCopy(vtkHierarchicalFractal* src);
199 
200  int Overlap;
208 
209  // New method of specifying blocks.
210  double TopLevelSpacing[3];
211  double TopLevelOrigin[3];
212 
214 
216  OutputUtil; // convenient class to create composite output
217 
218 private:
220  void operator=(const vtkHierarchicalFractal&) = delete;
221 };
222 
223 #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 &)