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
38#include <ogdf/basic/Array.h>
39#include <ogdf/basic/Graph.h>
41#include <ogdf/basic/SList.h> // IWYU pragma: keep
42#include <ogdf/basic/basic.h>
43#include <ogdf/basic/memory.h>
44
45namespace ogdf {
46class GraphAttributes;
47
49
66public:
68 enum class RootSelectionType {
69 Source,
70 Sink,
71 Center
72 };
73
74private:
76
78
80
86
90
92
95
98
100
101public:
104
107
109 ~RadialTreeLayout() = default;
110
113
115
122 virtual void call(GraphAttributes& GA) override;
123
124 // option that determines the minimal vertical distance
125 // required between levels
126
128 double levelDistance() const { return m_levelDistance; }
129
131 void levelDistance(double x) { m_levelDistance = x; }
132
133 // option that determines if the root is on the top or on the bottom
134
136 RootSelectionType rootSelection() const { return m_selectRoot; }
137
139 void rootSelection(RootSelectionType sel) { m_selectRoot = sel; }
140
141 const NodeArray<double>& diameter() const { return m_diameter; }
142
143private:
144 void FindRoot(const Graph& G);
145 void ComputeLevels(const Graph& G);
147 void ComputeAngles(const Graph& G);
149 void ComputeGroupings(const Graph& G);
150
152};
153
154}
Declaration and implementation of Array class and Array algorithms.
Includes declaration of graph class.
Declaration of interface for layout algorithms (class LayoutModule)
Declaration of singly linked lists and iterators.
Basic declarations, included by all source files.
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:219
Stores additional attributes of a graph (like layout information).
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Interface of general layout algorithms.
Class for the representation of nodes.
Definition Graph_d.h:241
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.
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
Definition memory.h:85
Declaration of memory manager for allocating small pieces of memory.
The namespace for all OGDF objects.