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 =========================================================================*/
29 #ifndef vtkTemporalFractal_h
30 #define vtkTemporalFractal_h
31 
32 #include "vtkAlgorithm.h"
33 #include "vtkFiltersHybridModule.h" // For export macro
34 #include "vtkSmartPointer.h" //for ivars
35 
37 class vtkDataSet;
39 class vtkIntArray;
40 class vtkRectilinearGrid;
41 class vtkUniformGrid;
42 class TemporalFractalOutputUtil;
43 
44 class VTKFILTERSHYBRID_EXPORT vtkTemporalFractal : public vtkAlgorithm
45 {
46 public:
48 
51  static vtkTemporalFractal* New();
53  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
57 
61  vtkSetMacro(FractalValue, float);
62  vtkGetMacro(FractalValue, float);
64 
66 
71  vtkSetMacro(MaximumLevel, int);
72  vtkGetMacro(MaximumLevel, int);
74 
76 
79  vtkSetMacro(Dimensions, int);
80  vtkGetMacro(Dimensions, int);
82 
84 
87  vtkSetMacro(GhostLevels, vtkTypeBool);
88  vtkGetMacro(GhostLevels, vtkTypeBool);
89  vtkBooleanMacro(GhostLevels, vtkTypeBool);
91 
93 
97  vtkSetMacro(GenerateRectilinearGrids, vtkTypeBool);
98  vtkGetMacro(GenerateRectilinearGrids, vtkTypeBool);
99  vtkBooleanMacro(GenerateRectilinearGrids, vtkTypeBool);
101 
103 
107  vtkSetMacro(DiscreteTimeSteps, vtkTypeBool);
108  vtkGetMacro(DiscreteTimeSteps, vtkTypeBool);
109  vtkBooleanMacro(DiscreteTimeSteps, vtkTypeBool);
111 
113 
116  vtkSetMacro(TwoDimensional, vtkTypeBool);
117  vtkGetMacro(TwoDimensional, vtkTypeBool);
118  vtkBooleanMacro(TwoDimensional, vtkTypeBool);
120 
122 
126  vtkSetMacro(Asymmetric, int);
127  vtkGetMacro(Asymmetric, int);
129 
131 
134  vtkSetMacro(AdaptiveSubdivision, vtkTypeBool);
135  vtkGetMacro(AdaptiveSubdivision, vtkTypeBool);
136  vtkBooleanMacro(AdaptiveSubdivision, vtkTypeBool);
138 
139 protected:
141  ~vtkTemporalFractal() override;
142 
143  int FillOutputPortInformation(int vtkNotUsed(port), vtkInformation* info) override;
144 
146  int EndBlock;
148 
153  vtkInformationVector* outputVector) override;
154 
159  virtual int RequestDataObject(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
160 
165  virtual int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
166  vtkInformationVector* outputVector);
167 
169 
173  virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
174  vtkInformationVector* outputVector);
175  virtual int RequestOneTimeStep(vtkCompositeDataSet* output, vtkInformation* request,
176  vtkInformationVector** inputVector, vtkInformationVector* outputVector);
178 
179  void Traverse(int& blockId, int level, vtkDataObject* output, int x0, int x1, int y0, int y1,
180  int z0, int z1, int onFace[6]);
181 
182  int LineTest2(float x0, float y0, float z0, float x1, float y1, float z1, double bds[6]);
183  int LineTest(float x0, float y0, float z0, float x1, float y1, float z1, double bds[6], int level,
184  int target);
185 
186  void SetBlockInfo(vtkUniformGrid* grid, int level, int* ext, int onFace[6]);
187  void SetRBlockInfo(vtkRectilinearGrid* grid, int level, int* ext, int onFace[6]);
188 
189  void AddVectorArray(vtkHierarchicalBoxDataSet* output);
190  void AddTestArray(vtkHierarchicalBoxDataSet* output);
191  void AddFractalArray(vtkCompositeDataSet* output);
192  void AddBlockIdArray(vtkHierarchicalBoxDataSet* output);
193  void AddDepthArray(vtkHierarchicalBoxDataSet* output);
194 
195  void AddGhostLevelArray(vtkDataSet* grid, int dim[3], int onFace[6]);
196 
197  int MandelbrotTest(double x, double y);
198  int TwoDTest(double bds[6], int level, int target);
199 
200  void CellExtentToBounds(int level, int ext[6], double bds[6]);
201 
202  void ExecuteRectilinearMandelbrot(vtkRectilinearGrid* grid, double* ptr);
203  double EvaluateSet(double p[4]);
204  void GetContinuousIncrements(int extent[6], vtkIdType& incX, vtkIdType& incY, vtkIdType& incZ);
205 
206  // Dimensions:
207  // Specify blocks relative to this top level block.
208  // For now this has to be set before the blocks are defined.
209  vtkSetVector3Macro(TopLevelSpacing, double);
210  vtkGetVector3Macro(TopLevelSpacing, double);
211  vtkSetVector3Macro(TopLevelOrigin, double);
212  vtkGetVector3Macro(TopLevelOrigin, double);
213 
214  void InternalImageDataCopy(vtkTemporalFractal* src);
215 
224 
225  // New method of specifying blocks.
226  double TopLevelSpacing[3];
227  double TopLevelOrigin[3];
228 
230 
231  double CurrentTime;
232 
235 
236 private:
237  vtkTemporalFractal(const vtkTemporalFractal&) = delete;
238  void operator=(const vtkTemporalFractal&) = delete;
239 };
240 
241 #endif
vtkTemporalFractal::Levels
vtkIntArray * Levels
Definition: vtkTemporalFractal.h:221
vtkTemporalFractal::BlockCount
int BlockCount
Definition: vtkTemporalFractal.h:147
vtkIdType
int vtkIdType
Definition: vtkType.h:349
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:53
vtkTemporalFractal::GhostLevels
vtkTypeBool GhostLevels
Definition: vtkTemporalFractal.h:220
vtkRectilinearGrid
a dataset that is topologically regular with variable spacing in the three coordinate directions
Definition: vtkRectilinearGrid.h:51
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkTemporalFractal::OutputUtil
vtkSmartPointer< TemporalFractalOutputUtil > OutputUtil
Definition: vtkTemporalFractal.h:234
vtkTemporalFractal::Asymmetric
int Asymmetric
Definition: vtkTemporalFractal.h:216
vtkUniformGrid
image data with blanking
Definition: vtkUniformGrid.h:34
vtkSmartPointer< TemporalFractalOutputUtil >
vtkTemporalFractal::TwoDimensional
vtkTypeBool TwoDimensional
Definition: vtkTemporalFractal.h:222
vtkHierarchicalBoxDataSet
Backwards compatibility class.
Definition: vtkHierarchicalBoxDataSet.h:34
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:45
vtkTemporalFractal::CurrentTime
double CurrentTime
Definition: vtkTemporalFractal.h:231
vtkAlgorithm.h
vtkX3D::level
Definition: vtkX3D.h:401
vtkX3D::port
Definition: vtkX3D.h:453
target
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:965
vtkTemporalFractal::DiscreteTimeSteps
vtkTypeBool DiscreteTimeSteps
Definition: vtkTemporalFractal.h:223
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkIntArray
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:39
vtkSmartPointer.h
vtkTemporalFractal::GenerateRectilinearGrids
vtkTypeBool GenerateRectilinearGrids
Definition: vtkTemporalFractal.h:229
vtkTemporalFractal::EndBlock
int EndBlock
Definition: vtkTemporalFractal.h:146
vtkTemporalFractal
A source to test AMR data object.
Definition: vtkTemporalFractal.h:44
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:64
vtkX3D::info
Definition: vtkX3D.h:382
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkTemporalFractal::AdaptiveSubdivision
vtkTypeBool AdaptiveSubdivision
Definition: vtkTemporalFractal.h:233
vtkTemporalFractal::StartBlock
int StartBlock
Definition: vtkTemporalFractal.h:145
vtkAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::extent
Definition: vtkX3D.h:351
vtkTemporalFractal::MaximumLevel
int MaximumLevel
Definition: vtkTemporalFractal.h:217
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:58
vtkTemporalFractal::Dimensions
int Dimensions
Definition: vtkTemporalFractal.h:218
vtkAlgorithm::ProcessRequest
virtual vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
vtkAlgorithm::FillOutputPortInformation
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkTemporalFractal::FractalValue
float FractalValue
Definition: vtkTemporalFractal.h:219