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:
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
109  };
111 
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 
154 
155 private:
157  void operator=(const vtkCosmicTreeLayoutStrategy&) = delete;
158 };
159 
160 VTK_ABI_NAMESPACE_END
161 #endif // vtkCosmicTreeLayoutStrategy_h
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkIdType
Definition: vtkType.h:315
dynamic, self-adjusting array of double
abstract superclass for all graph layout strategies
int vtkTypeBool
Definition: vtkABI.h:64
a simple class to control print indentation
Definition: vtkIndent.h:28
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
tree layout strategy reminiscent of astronomical systems
RadiusMode
How are node sizes specified?
No node sizes specified... unit radius is assumed.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
A rooted tree data structure.
Definition: vtkTree.h:45
represent and manipulate 3D points
Definition: vtkPoints.h:28
virtual void Layout()=0
This is the layout method where the graph that was set in SetGraph() is laid out. ...
Only leaf node sizes specified... parents are calculated during layout.