VTK  9.3.1
vtkRandomHyperTreeGridSource.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
11 #ifndef vtkRandomHyperTreeGridSource_h
12 #define vtkRandomHyperTreeGridSource_h
13 
14 #include "vtkFiltersSourcesModule.h" // For export macro
16 
17 #include <vtkNew.h> // For vtkNew
18 
19 VTK_ABI_NAMESPACE_BEGIN
20 class vtkDoubleArray;
24 
25 class VTKFILTERSSOURCES_EXPORT vtkRandomHyperTreeGridSource : public vtkHyperTreeGridAlgorithm
26 {
27 public:
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31 
37  vtkGetVector3Macro(Dimensions, unsigned int);
38  vtkSetVector3Macro(Dimensions, unsigned int);
45  vtkGetVector6Macro(OutputBounds, double);
46  vtkSetVector6Macro(OutputBounds, double);
47 
54  vtkGetMacro(Seed, vtkTypeUInt32);
55  vtkSetMacro(Seed, vtkTypeUInt32);
63  vtkGetMacro(MaxDepth, vtkIdType);
64  vtkSetClampMacro(MaxDepth, vtkIdType, 1, VTK_ID_MAX);
72  vtkGetMacro(SplitFraction, double);
73  vtkSetClampMacro(SplitFraction, double, 0., 1.);
76 protected:
78  ~vtkRandomHyperTreeGridSource() override;
79 
81  vtkInformation* req, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
82 
83  int RequestData(
84  vtkInformation* req, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
85 
86  // We just do the work in RequestData.
87  int ProcessTrees(vtkHyperTreeGrid*, vtkDataObject*) final { return 1; }
88 
90 
91  void SubdivideLeaves(vtkHyperTreeGridNonOrientedCursor* cursor, vtkIdType treeId);
92 
93  bool ShouldRefine(vtkIdType level);
94 
95  unsigned int Dimensions[3];
96  double OutputBounds[6];
97  vtkTypeUInt32 Seed;
99  double SplitFraction;
100 
101 private:
103  void operator=(const vtkRandomHyperTreeGridSource&) = delete;
104 
106  vtkNew<vtkExtentTranslator> ExtentTranslator;
107  vtkDoubleArray* Levels;
108 };
109 
110 VTK_ABI_NAMESPACE_END
111 #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:315
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:28
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:319
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:54