VTK  9.1.0
vtkCosmicTreeLayoutStrategy.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkCosmicTreeLayoutStrategy.h
5
6=========================================================================*/
7/*----------------------------------------------------------------------------
8 Copyright (c) Sandia Corporation
9 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
10----------------------------------------------------------------------------*/
30#ifndef vtkCosmicTreeLayoutStrategy_h
31#define vtkCosmicTreeLayoutStrategy_h
32
34#include "vtkInfovisLayoutModule.h" // For export macro
35
36class vtkDoubleArray;
37class vtkDataArray;
38class vtkPoints;
39class vtkTree;
40
41class VTKINFOVISLAYOUT_EXPORT vtkCosmicTreeLayoutStrategy : public vtkGraphLayoutStrategy
42{
43public:
45 void PrintSelf(ostream& os, vtkIndent indent) override;
47
51 void Layout() override;
52
54
62 vtkSetMacro(SizeLeafNodesOnly, vtkTypeBool);
63 vtkGetMacro(SizeLeafNodesOnly, vtkTypeBool);
64 vtkBooleanMacro(SizeLeafNodesOnly, vtkTypeBool);
66
68
76 vtkSetMacro(LayoutDepth, int);
77 vtkGetMacro(LayoutDepth, int);
79
81
90 vtkSetMacro(LayoutRoot, vtkIdType);
91 vtkGetMacro(LayoutRoot, vtkIdType);
93
95
101 vtkSetStringMacro(NodeSizeArrayName);
102 vtkGetStringMacro(NodeSizeArrayName);
104
105protected:
108 {
111 ALL
113 };
114
117
121 void LayoutChildren(vtkTree* tree, vtkPoints* newPoints, vtkDoubleArray* radii,
122 vtkDoubleArray* scale, vtkIdType root, int depth, RadiusMode mode);
123
131 double parent[4], vtkIdType root, int depth, RadiusMode mode);
132
143 vtkDoubleArray* CreateRadii(vtkIdType numVertices, double initialValue, vtkDataArray* inputRadii);
144
152
157
158private:
160 void operator=(const vtkCosmicTreeLayoutStrategy&) = delete;
161};
162
163#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
Definition: vtkDataArray.h:159
dynamic, self-adjusting array of double
abstract superclass for all graph layout strategies
a simple class to control print indentation
Definition: vtkIndent.h:113
represent and manipulate 3D points
Definition: vtkPoints.h:143
A rooted tree data structure.
Definition: vtkTree.h:164
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332