Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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 
45 namespace ogdf {
46 class GraphAttributes;
47 
49 
66 public:
68  enum class RootSelectionType {
69  Source,
70  Sink,
71  Center
72  };
73 
74 private:
75  double m_levelDistance;
76 
78 
80 
86 
88 
92 
95 
98 
100 
101 public:
104 
107 
109  ~RadialTreeLayout() = default;
110 
112  RadialTreeLayout& operator=(const RadialTreeLayout& tl);
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 
143 private:
144  void FindRoot(const Graph& G);
145  void ComputeLevels(const Graph& G);
146  void ComputeDiameters(GraphAttributes& AG);
147  void ComputeAngles(const Graph& G);
148  void ComputeCoordinates(GraphAttributes& AG);
149  void ComputeGroupings(const Graph& G);
150 
152 };
153 
154 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
ogdf::RadialTreeLayout::rootSelection
void rootSelection(RootSelectionType sel)
Sets the option rootSelection to sel.
Definition: RadialTreeLayout.h:139
Graph.h
Includes declaration of graph class.
ogdf::RadialTreeLayout::m_relWidth
NodeArray< double > m_relWidth
The relative width of the subtree.
Definition: RadialTreeLayout.h:87
ogdf::RadialTreeLayout::m_levelDistance
double m_levelDistance
The minimal distance between levels.
Definition: RadialTreeLayout.h:75
ogdf::RadialTreeLayout::m_wedge
NodeArray< double > m_wedge
The wedge reserved for subtree.
Definition: RadialTreeLayout.h:94
ogdf::RadialTreeLayout::m_maxDiameter
Array< double > m_maxDiameter
The maximal diameter on a level.
Definition: RadialTreeLayout.h:97
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:77
ogdf::RadialTreeLayout::m_parent
NodeArray< node > m_parent
The parent of a node (nullptr if root).
Definition: RadialTreeLayout.h:83
ogdf::RadialTreeLayout::levelDistance
void levelDistance(double x)
Sets the option levelDistance to x.
Definition: RadialTreeLayout.h:131
OGDF_NEW_DELETE
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
Definition: memory.h:85
ogdf::RadialTreeLayout::diameter
const NodeArray< double > & diameter() const
Definition: RadialTreeLayout.h:141
ogdf::RadialTreeLayout::m_children
NodeArray< SListPure< node > > m_children
The children of a node.
Definition: RadialTreeLayout.h:85
ogdf::RadialTreeLayout::m_numLevels
int m_numLevels
The number of levels (root is on level 0).
Definition: RadialTreeLayout.h:81
SList.h
Declaration of singly linked lists and iterators.
ogdf::Array
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:219
ogdf::RadialTreeLayout::m_level
NodeArray< int > m_level
The level of a node.
Definition: RadialTreeLayout.h:82
ogdf::RadialTreeLayout::m_radius
Array< double > m_radius
The width of a level.
Definition: RadialTreeLayout.h:99
ogdf::RadialTreeLayout::RootSelectionType
RootSelectionType
Selection strategies for root of the tree.
Definition: RadialTreeLayout.h:68
ogdf::RadialTreeLayout::m_nodes
Array< SListPure< node > > m_nodes
The nodes at a level.
Definition: RadialTreeLayout.h:84
ogdf::RadialTreeLayout::m_angle
NodeArray< double > m_angle
The angle of node center (for placement).
Definition: RadialTreeLayout.h:93
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::RadialTreeLayout
The radial tree layout algorithm.
Definition: RadialTreeLayout.h:65
ogdf::RadialTreeLayout::levelDistance
double levelDistance() const
Returns the option levelDistance.
Definition: RadialTreeLayout.h:128
basic.h
Basic declarations, included by all source files.
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:91
Array.h
Declaration and implementation of Array class and Array algorithms.
ogdf::RadialTreeLayout::m_root
node m_root
The root of the tree.
Definition: RadialTreeLayout.h:79
ogdf::RadialTreeLayout::rootSelection
RootSelectionType rootSelection() const
Returns the option rootSelection.
Definition: RadialTreeLayout.h:136
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
memory.h
Declaration of memory manager for allocating small pieces of memory.
ogdf::LayoutModule
Interface of general layout algorithms.
Definition: LayoutModule.h:45
ogdf::RadialTreeLayout::m_diameter
NodeArray< double > m_diameter
The diameter of a circle bounding a node.
Definition: RadialTreeLayout.h:96