Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

RadialTreeLayout.h
Go to the documentation of this file.
1 
36 #pragma once
37 
39 #include <ogdf/basic/SList.h>
40 
41 namespace ogdf {
42 
44 
61 public:
63  enum class RootSelectionType {
64  Source,
65  Sink,
66  Center
67  };
68 
69 private:
70  double m_levelDistance;
71 
73 
75 
81 
83 
87 
90 
93 
95 
96 public:
99 
102 
104  ~RadialTreeLayout() = default;
105 
107  RadialTreeLayout& operator=(const RadialTreeLayout& tl);
108 
110 
117  virtual void call(GraphAttributes& GA) override;
118 
119  // option that determines the minimal vertical distance
120  // required between levels
121 
123  double levelDistance() const { return m_levelDistance; }
124 
126  void levelDistance(double x) { m_levelDistance = x; }
127 
128  // option that determines if the root is on the top or on the bottom
129 
131  RootSelectionType rootSelection() const { return m_selectRoot; }
132 
134  void rootSelection(RootSelectionType sel) { m_selectRoot = sel; }
135 
136  const NodeArray<double>& diameter() const { return m_diameter; }
137 
138 private:
139  void FindRoot(const Graph& G);
140  void ComputeLevels(const Graph& G);
141  void ComputeDiameters(GraphAttributes& AG);
142  void ComputeAngles(const Graph& G);
143  void ComputeCoordinates(GraphAttributes& AG);
144  void ComputeGroupings(const Graph& G);
145 
147 };
148 
149 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:66
ogdf::RadialTreeLayout::rootSelection
void rootSelection(RootSelectionType sel)
Sets the option rootSelection to sel.
Definition: RadialTreeLayout.h:134
ogdf::RadialTreeLayout::m_relWidth
NodeArray< double > m_relWidth
The relative width of the subtree.
Definition: RadialTreeLayout.h:82
ogdf::RadialTreeLayout::m_levelDistance
double m_levelDistance
The minimal distance between levels.
Definition: RadialTreeLayout.h:70
ogdf::RadialTreeLayout::m_wedge
NodeArray< double > m_wedge
The wedge reserved for subtree.
Definition: RadialTreeLayout.h:89
ogdf::RadialTreeLayout::m_maxDiameter
Array< double > m_maxDiameter
The maximal diameter on a level.
Definition: RadialTreeLayout.h:92
LayoutModule.h
Declaration of interface for layout algorithms (class LayoutModule)
ogdf::RadialTreeLayout::m_selectRoot
RootSelectionType m_selectRoot
Specifies how to determine the root.
Definition: RadialTreeLayout.h:72
ogdf::RadialTreeLayout::m_parent
NodeArray< node > m_parent
The parent of a node (nullptr if root).
Definition: RadialTreeLayout.h:78
ogdf::RadialTreeLayout::levelDistance
void levelDistance(double x)
Sets the option levelDistance to x.
Definition: RadialTreeLayout.h:126
OGDF_NEW_DELETE
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
Definition: memory.h:84
ogdf::RadialTreeLayout::diameter
const NodeArray< double > & diameter() const
Definition: RadialTreeLayout.h:136
ogdf::RadialTreeLayout::m_children
NodeArray< SListPure< node > > m_children
The children of a node.
Definition: RadialTreeLayout.h:80
ogdf::RadialTreeLayout::m_numLevels
int m_numLevels
The number of levels (root is on level 0).
Definition: RadialTreeLayout.h:76
SList.h
Declaration of singly linked lists and iterators.
ogdf::Array
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:214
ogdf::RadialTreeLayout::m_level
NodeArray< int > m_level
The level of a node.
Definition: RadialTreeLayout.h:77
ogdf::RadialTreeLayout::m_radius
Array< double > m_radius
The width of a level.
Definition: RadialTreeLayout.h:94
ogdf::RadialTreeLayout::RootSelectionType
RootSelectionType
Selection strategies for root of the tree.
Definition: RadialTreeLayout.h:63
ogdf::RadialTreeLayout::m_nodes
Array< SListPure< node > > m_nodes
The nodes at a level.
Definition: RadialTreeLayout.h:79
ogdf::RadialTreeLayout::m_angle
NodeArray< double > m_angle
The angle of node center (for placement).
Definition: RadialTreeLayout.h:88
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::RadialTreeLayout
The radial tree layout algorithm.
Definition: RadialTreeLayout.h:60
ogdf::RadialTreeLayout::levelDistance
double levelDistance() const
Returns the option levelDistance.
Definition: RadialTreeLayout.h:123
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::RadialTreeLayout::m_absWidth
NodeArray< double > m_absWidth
the absolute width of the subtree.
Definition: RadialTreeLayout.h:86
ogdf::RadialTreeLayout::m_root
node m_root
The root of the tree.
Definition: RadialTreeLayout.h:74
ogdf::RadialTreeLayout::rootSelection
RootSelectionType rootSelection() const
Returns the option rootSelection.
Definition: RadialTreeLayout.h:131
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::LayoutModule
Interface of general layout algorithms.
Definition: LayoutModule.h:44
ogdf::RadialTreeLayout::m_diameter
NodeArray< double > m_diameter
The diameter of a circle bounding a node.
Definition: RadialTreeLayout.h:91