VTK  9.2.6
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 =========================================================================*/
23 #ifndef vtkRandomHyperTreeGridSource_h
24 #define vtkRandomHyperTreeGridSource_h
25 
26 #include "vtkFiltersSourcesModule.h" // For export macro
28 
29 #include <vtkNew.h> // For vtkNew
30 
31 class vtkDoubleArray;
35 
36 class VTKFILTERSSOURCES_EXPORT vtkRandomHyperTreeGridSource : public vtkHyperTreeGridAlgorithm
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
48  vtkGetVector3Macro(Dimensions, unsigned int);
49  vtkSetVector3Macro(Dimensions, unsigned int);
56  vtkGetVector6Macro(OutputBounds, double);
57  vtkSetVector6Macro(OutputBounds, double);
58 
65  vtkGetMacro(Seed, vtkTypeUInt32);
66  vtkSetMacro(Seed, vtkTypeUInt32);
74  vtkGetMacro(MaxDepth, vtkIdType);
75  vtkSetClampMacro(MaxDepth, vtkIdType, 1, VTK_ID_MAX);
83  vtkGetMacro(SplitFraction, double);
84  vtkSetClampMacro(SplitFraction, double, 0., 1.);
87 protected:
89  ~vtkRandomHyperTreeGridSource() override;
90 
92  vtkInformation* req, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
93 
94  int RequestData(
95  vtkInformation* req, vtkInformationVector** inInfo, 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(vtkHyperTreeGridNonOrientedCursor* cursor, vtkIdType treeId);
103 
104  bool ShouldRefine(vtkIdType level);
105 
106  unsigned int Dimensions[3];
107  double OutputBounds[6];
108  vtkTypeUInt32 Seed;
111 
112 private:
114  void operator=(const vtkRandomHyperTreeGridSource&) = delete;
115 
117  vtkNew<vtkExtentTranslator> ExtentTranslator;
118  vtkDoubleArray* Levels;
119 };
120 
121 #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.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Generates a structured extent from unstructured.
int vtkIdType
Definition: vtkType.h:332
int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *) final
Main routine to process individual trees in the grid This is pure virtual method to be implemented by...
Objects for traversal a HyperTreeGrid.
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Park and Miller Sequence of pseudo random numbers.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
#define VTK_ID_MAX
Definition: vtkType.h:336
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:65