VTK  9.3.20240328
vtkCosmicTreeLayoutStrategy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
26 #ifndef vtkCosmicTreeLayoutStrategy_h
27 #define vtkCosmicTreeLayoutStrategy_h
28 
29 #include "vtkGraphLayoutStrategy.h"
30 #include "vtkInfovisLayoutModule.h" // For export macro
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkDoubleArray;
34 class vtkDataArray;
35 class vtkPoints;
36 class vtkTree;
37 
38 class VTKINFOVISLAYOUT_EXPORT vtkCosmicTreeLayoutStrategy : public vtkGraphLayoutStrategy
39 {
40 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
48  void Layout() override;
49 
51 
59  vtkSetMacro(SizeLeafNodesOnly, vtkTypeBool);
60  vtkGetMacro(SizeLeafNodesOnly, vtkTypeBool);
61  vtkBooleanMacro(SizeLeafNodesOnly, vtkTypeBool);
63 
65 
73  vtkSetMacro(LayoutDepth, int);
74  vtkGetMacro(LayoutDepth, int);
76 
78 
87  vtkSetMacro(LayoutRoot, vtkIdType);
88  vtkGetMacro(LayoutRoot, vtkIdType);
90 
92 
98  vtkSetStringMacro(NodeSizeArrayName);
99  vtkGetStringMacro(NodeSizeArrayName);
101 
102 protected:
105  {
108  ALL
110  };
111 
114 
118  void LayoutChildren(vtkTree* tree, vtkPoints* newPoints, vtkDoubleArray* radii,
119  vtkDoubleArray* scale, vtkIdType root, int depth, RadiusMode mode);
120 
128  double parent[4], vtkIdType root, int depth, RadiusMode mode);
129 
140  vtkDoubleArray* CreateRadii(vtkIdType numVertices, double initialValue, vtkDataArray* inputRadii);
141 
149 
154 
155 private:
157  void operator=(const vtkCosmicTreeLayoutStrategy&) = delete;
158 };
159 
160 VTK_ABI_NAMESPACE_END
161 #endif // vtkCosmicTreeLayoutStrategy_h
tree layout strategy reminiscent of astronomical systems
void Layout() override
Perform the layout.
vtkDoubleArray * CreateRadii(vtkIdType numVertices, double initialValue, vtkDataArray *inputRadii)
Create an array to hold radii, named appropriately (depends on NodeSizeArrayName) and initialized to ...
static vtkCosmicTreeLayoutStrategy * New()
RadiusMode
How are node sizes specified?
@ NONE
No node sizes specified... unit radius is assumed.
@ LEAVES
Only leaf node sizes specified... parents are calculated during layout.
vtkDoubleArray * CreateScaleFactors(vtkIdType numVertices)
Create an array to hold scale factors, named appropriately (depends on NodeSizeArrayName) and initial...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkCosmicTreeLayoutStrategy() override
void OffsetChildren(vtkTree *tree, vtkPoints *pts, vtkDoubleArray *radii, vtkDoubleArray *scale, double parent[4], vtkIdType root, int depth, RadiusMode mode)
Recursive routine that adds each parent node's (x,y) position to its children.
void LayoutChildren(vtkTree *tree, vtkPoints *newPoints, vtkDoubleArray *radii, vtkDoubleArray *scale, vtkIdType root, int depth, RadiusMode mode)
Recursive routine used to lay out tree nodes.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:154
dynamic, self-adjusting array of double
abstract superclass for all graph layout strategies
a simple class to control print indentation
Definition: vtkIndent.h:108
represent and manipulate 3D points
Definition: vtkPoints.h:138
A rooted tree data structure.
Definition: vtkTree.h:145
@ mode
Definition: vtkX3D.h:247
@ scale
Definition: vtkX3D.h:229
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315