VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
17 
18 #include <vtkNew.h> // For vtkNew
19 
20 VTK_ABI_NAMESPACE_BEGIN
21 class vtkDoubleArray;
25 
26 class VTKFILTERSSOURCES_EXPORT VTK_MARSHALAUTO vtkRandomHyperTreeGridSource
28 {
29 public:
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
39  vtkGetVector3Macro(Dimensions, unsigned int);
40  vtkSetVector3Macro(Dimensions, unsigned int);
47  vtkGetVector6Macro(OutputBounds, double);
48  vtkSetVector6Macro(OutputBounds, double);
49 
56  vtkGetMacro(Seed, vtkTypeUInt32);
57  vtkSetMacro(Seed, vtkTypeUInt32);
65  vtkGetMacro(MaxDepth, vtkIdType);
66  vtkSetClampMacro(MaxDepth, vtkIdType, 1, VTK_ID_MAX);
74  vtkGetMacro(SplitFraction, double);
75  vtkSetClampMacro(SplitFraction, double, 0., 1.);
89  vtkGetMacro(MaskedFraction, double);
90  vtkSetClampMacro(MaskedFraction, double, 0., 1.);
93 protected:
95  ~vtkRandomHyperTreeGridSource() override;
96 
98  vtkInformation* req, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
99 
100  int RequestData(
101  vtkInformation* req, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
102 
103  // We just do the work in RequestData.
104  int ProcessTrees(vtkHyperTreeGrid*, vtkDataObject*) final { return 1; }
105 
107 
115  void SubdivideLeaves(
117 
118  unsigned int Dimensions[3];
119  double OutputBounds[6];
120  vtkTypeUInt32 Seed;
123 
124 private:
126  void operator=(const vtkRandomHyperTreeGridSource&) = delete;
127 
130 
131  bool ShouldRefine();
132  bool ShouldMask();
133 
134  double MaskedFraction = 0;
135 };
136 
137 VTK_ABI_NAMESPACE_END
138 #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:363
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:367
Superclass for algorithms that produce a hyper tree grid as output.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
#define VTK_MARSHALAUTO
general representation of visualization data
Definition: vtkDataObject.h:55