VTK: Infovis/Layout/vtkCosmicTreeLayoutStrategy.h Source File

| VTK 9.3.1

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:
41 static vtkCosmicTreeLayoutStrategy* New();
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43 vtkTypeMacro(vtkCosmicTreeLayoutStrategy, vtkGraphLayoutStrategy);
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:
104 enum RadiusMode
105 {
106 NONE,
107 LEAVES,
108 ALL
110 };
111
112 vtkCosmicTreeLayoutStrategy();
113 ~vtkCosmicTreeLayoutStrategy() override;
114
118 void LayoutChildren(vtkTree* tree, vtkPoints* newPoints, vtkDoubleArray* radii,
119 vtkDoubleArray* scale, vtkIdType root, int depth, RadiusMode mode);
120
127 void OffsetChildren(vtkTree* tree, vtkPoints* pts, vtkDoubleArray* radii, vtkDoubleArray* scale,
128 double parent[4], vtkIdType root, int depth, RadiusMode mode);
129
140 vtkDoubleArray* CreateRadii(vtkIdType numVertices, double initialValue, vtkDataArray* inputRadii);
141
148 vtkDoubleArray* CreateScaleFactors(vtkIdType numVertices);
149
150 vtkTypeBool SizeLeafNodesOnly;
151 int LayoutDepth;
152 vtkIdType LayoutRoot;
153 char* NodeSizeArrayName;
154
155 private:
156 vtkCosmicTreeLayoutStrategy(const vtkCosmicTreeLayoutStrategy&) = delete;
157 void operator=(const vtkCosmicTreeLayoutStrategy&) = delete;
158 };
159
160 VTK_ABI_NAMESPACE_END
161 #endif // vtkCosmicTreeLayoutStrategy_h
vtkCosmicTreeLayoutStrategy
tree layout strategy reminiscent of astronomical systems
Definition: vtkCosmicTreeLayoutStrategy.h:39
vtkCosmicTreeLayoutStrategy::Layout
void Layout() override
Perform the layout.
vtkCosmicTreeLayoutStrategy::CreateRadii
vtkDoubleArray * CreateRadii(vtkIdType numVertices, double initialValue, vtkDataArray *inputRadii)
Create an array to hold radii, named appropriately (depends on NodeSizeArrayName) and initialized to ...
vtkCosmicTreeLayoutStrategy::New
static vtkCosmicTreeLayoutStrategy * New()
vtkCosmicTreeLayoutStrategy::LayoutDepth
int LayoutDepth
Definition: vtkCosmicTreeLayoutStrategy.h:151
vtkCosmicTreeLayoutStrategy::SizeLeafNodesOnly
vtkTypeBool SizeLeafNodesOnly
Definition: vtkCosmicTreeLayoutStrategy.h:150
vtkCosmicTreeLayoutStrategy::RadiusMode
RadiusMode
How are node sizes specified?
Definition: vtkCosmicTreeLayoutStrategy.h:105
vtkCosmicTreeLayoutStrategy::NONE
@ NONE
No node sizes specified... unit radius is assumed.
Definition: vtkCosmicTreeLayoutStrategy.h:106
vtkCosmicTreeLayoutStrategy::LEAVES
@ LEAVES
Only leaf node sizes specified... parents are calculated during layout.
Definition: vtkCosmicTreeLayoutStrategy.h:107
vtkCosmicTreeLayoutStrategy::LayoutRoot
vtkIdType LayoutRoot
Definition: vtkCosmicTreeLayoutStrategy.h:152
vtkCosmicTreeLayoutStrategy::vtkCosmicTreeLayoutStrategy
vtkCosmicTreeLayoutStrategy()
vtkCosmicTreeLayoutStrategy::CreateScaleFactors
vtkDoubleArray * CreateScaleFactors(vtkIdType numVertices)
Create an array to hold scale factors, named appropriately (depends on NodeSizeArrayName) and initial...
vtkCosmicTreeLayoutStrategy::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCosmicTreeLayoutStrategy::~vtkCosmicTreeLayoutStrategy
~vtkCosmicTreeLayoutStrategy() override
vtkCosmicTreeLayoutStrategy::NodeSizeArrayName
char * NodeSizeArrayName
Definition: vtkCosmicTreeLayoutStrategy.h:153
vtkCosmicTreeLayoutStrategy::OffsetChildren
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.
vtkCosmicTreeLayoutStrategy::LayoutChildren
void LayoutChildren(vtkTree *tree, vtkPoints *newPoints, vtkDoubleArray *radii, vtkDoubleArray *scale, vtkIdType root, int depth, RadiusMode mode)
Recursive routine used to lay out tree nodes.
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:40
vtkGraphLayoutStrategy
abstract superclass for all graph layout strategies
Definition: vtkGraphLayoutStrategy.h:40
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkTree
A rooted tree data structure.
Definition: vtkTree.h:55
vtkX3D::mode
@ mode
Definition: vtkX3D.h:247
vtkX3D::scale
@ scale
Definition: vtkX3D.h:229
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkGraphLayoutStrategy.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315