VTK
vtkRandomHyperTreeGridSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkRandomHyperTreeGridSource.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
20 #ifndef vtkRandomHyperTreeGridSource_h
21 #define vtkRandomHyperTreeGridSource_h
22 
23 #include "vtkFiltersSourcesModule.h" // For export macro
25 
26 #include <vtkNew.h> // For vtkNew
27 
28 class vtkDoubleArray;
30 class vtkHyperTreeCursor;
32 
33 class VTKFILTERSSOURCES_EXPORT vtkRandomHyperTreeGridSource
35 {
36 public:
39  void PrintSelf(ostream &os, vtkIndent indent) override;
40 
46  vtkGetVector3Macro(GridSize, unsigned int)
47  vtkSetVector3Macro(GridSize, unsigned int)
54  vtkGetVector6Macro(OutputBounds, double)
55  vtkSetVector6Macro(OutputBounds, double)
56 
63  vtkGetMacro(Seed, vtkTypeUInt32)
64  vtkSetMacro(Seed, vtkTypeUInt32)
72  vtkGetMacro(MaxDepth, vtkIdType)
73  vtkSetClampMacro(MaxDepth, vtkIdType, 1, VTK_ID_MAX)
81  vtkGetMacro(SplitFraction, double)
82  vtkSetClampMacro(SplitFraction, double, 0., 1.)
85 protected:
87  ~vtkRandomHyperTreeGridSource() override;
88 
89  int RequestInformation(vtkInformation *req,
90  vtkInformationVector **inInfo,
91  vtkInformationVector *outInfo) override;
92 
93  int RequestData(vtkInformation *req,
94  vtkInformationVector **inInfo,
95  vtkInformationVector *outInfo) override;
96 
97  // We just do the work in RequestData.
98  int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *) final { return 1; }
99 
101 
102  void SubdivideLeaves(vtkHyperTreeCursor *cursor, vtkIdType treeId);
103 
104  bool ShouldRefine(vtkIdType level);
105 
106  unsigned int GridSize[3];
107  double OutputBounds[6];
108  vtkTypeUInt32 Seed;
111 
112 private:
114  void operator=(const vtkRandomHyperTreeGridSource&) = delete;
115 
117  vtkNew<vtkExtentTranslator> ExtentTranslator;
118  vtkHyperTreeGrid *HTG;
119  vtkDoubleArray *Levels;
120 };
121 
122 #endif // vtkRandomHyperTreeGridSource_h
int FillOutputPortInformation(int, vtkInformation *) override
Define default input and output port types.
Store vtkAlgorithm input/output information.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Builds a randomized but reproducible vtkHyperTreeGrid.
Generates a structured extent from unstructured.
int vtkIdType
Definition: vtkType.h:347
dynamic, self-adjusting array of double
Objects for depth-first traversal HyperTrees.
a simple class to control print indentation
Definition: vtkIndent.h:39
Park and Miller Sequence of pseudo random numbers.
#define VTK_ID_MAX
Definition: vtkType.h:351
Superclass for algorithms that produce a hyper tree grid as output.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
general representation of visualization data
Definition: vtkDataObject.h:64