VTK  9.4.20241121
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
30#include "vtkInfovisLayoutModule.h" // For export macro
31
32VTK_ABI_NAMESPACE_BEGIN
33class vtkDoubleArray;
34class vtkDataArray;
35class vtkPoints;
36class vtkTree;
37
38class VTKINFOVISLAYOUT_EXPORT vtkCosmicTreeLayoutStrategy : public vtkGraphLayoutStrategy
39{
40public:
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
102protected:
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
155private:
157 void operator=(const vtkCosmicTreeLayoutStrategy&) = delete;
158};
159
160VTK_ABI_NAMESPACE_END
161#endif // vtkCosmicTreeLayoutStrategy_h
tree layout strategy reminiscent of astronomical systems
void Layout() override
Perform the layout.
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.
static vtkCosmicTreeLayoutStrategy * New()
vtkDoubleArray * CreateRadii(vtkIdType numVertices, double initialValue, vtkDataArray *inputRadii)
Create an array to hold radii, named appropriately (depends on NodeSizeArrayName) and initialized to ...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDoubleArray * CreateScaleFactors(vtkIdType numVertices)
Create an array to hold scale factors, named appropriately (depends on NodeSizeArrayName) and initial...
~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
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:139
A rooted tree data structure.
Definition vtkTree.h:155
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315