Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
RadialTreeLayout.h
Go to the documentation of this file.
1
36#pragma once
37
39#include <ogdf/basic/SList.h>
40
41namespace ogdf {
42
44
61public:
63 enum class RootSelectionType {
64 Source,
65 Sink,
66 Center
67 };
68
69private:
71
73
75
81
85
87
90
93
95
96public:
99
102
104 ~RadialTreeLayout() = default;
105
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
138private:
139 void FindRoot(const Graph& G);
140 void ComputeLevels(const Graph& G);
142 void ComputeAngles(const Graph& G);
144 void ComputeGroupings(const Graph& G);
145
147};
148
149}
Declaration of interface for layout algorithms (class LayoutModule)
Declaration of singly linked lists and iterators.
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:214
Stores additional attributes of a graph (like layout information).
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:521
Interface of general layout algorithms.
Dynamic arrays indexed with nodes.
Definition NodeArray.h:125
Class for the representation of nodes.
Definition Graph_d.h:177
The radial tree layout algorithm.
RootSelectionType rootSelection() const
Returns the option rootSelection.
double levelDistance() const
Returns the option levelDistance.
int m_numLevels
The number of levels (root is on level 0).
const NodeArray< double > & diameter() const
void ComputeAngles(const Graph &G)
void ComputeCoordinates(GraphAttributes &AG)
virtual void call(GraphAttributes &GA) override
Calls the algorithm for graph attributes GA.
RootSelectionType m_selectRoot
Specifies how to determine the root.
void ComputeDiameters(GraphAttributes &AG)
void FindRoot(const Graph &G)
NodeArray< double > m_angle
The angle of node center (for placement).
Array< double > m_maxDiameter
The maximal diameter on a level.
void rootSelection(RootSelectionType sel)
Sets the option rootSelection to sel.
NodeArray< SListPure< node > > m_children
The children of a node.
NodeArray< double > m_absWidth
the absolute width of the subtree.
void ComputeLevels(const Graph &G)
RadialTreeLayout(const RadialTreeLayout &tl)
Copy constructor.
NodeArray< double > m_relWidth
The relative width of the subtree.
Array< SListPure< node > > m_nodes
The nodes at a level.
RadialTreeLayout & operator=(const RadialTreeLayout &tl)
Assignment operator.
void ComputeGroupings(const Graph &G)
Array< double > m_radius
The width of a level.
NodeArray< node > m_parent
The parent of a node (nullptr if root).
double m_levelDistance
The minimal distance between levels.
RadialTreeLayout()
Creates an instance of radial tree layout and sets options to default values.
~RadialTreeLayout()=default
Destructor.
NodeArray< double > m_diameter
The diameter of a circle bounding a node.
NodeArray< int > m_level
The level of a node.
NodeArray< double > m_wedge
The wedge reserved for subtree.
void levelDistance(double x)
Sets the option levelDistance to x.
node m_root
The root of the tree.
RootSelectionType
Selection strategies for root of the tree.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
Definition memory.h:84
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.