The radial tree layout algorithm. More...
#include <ogdf/tree/RadialTreeLayout.h>
Public Types | |
enum | RootSelectionType { RootSelectionType::Source, RootSelectionType::Sink, RootSelectionType::Center } |
Selection strategies for root of the tree. More... | |
Public Member Functions | |
RadialTreeLayout () | |
Creates an instance of radial tree layout and sets options to default values. More... | |
RadialTreeLayout (const RadialTreeLayout &tl) | |
Copy constructor. More... | |
~RadialTreeLayout ()=default | |
Destructor. More... | |
virtual void | call (GraphAttributes &GA) override |
Calls the algorithm for graph attributes GA . More... | |
const NodeArray< double > & | diameter () const |
double | levelDistance () const |
Returns the option levelDistance. More... | |
void | levelDistance (double x) |
Sets the option levelDistance to x . More... | |
RadialTreeLayout & | operator= (const RadialTreeLayout &tl) |
Assignment operator. More... | |
RootSelectionType | rootSelection () const |
Returns the option rootSelection. More... | |
void | rootSelection (RootSelectionType sel) |
Sets the option rootSelection to sel . More... | |
Public Member Functions inherited from ogdf::LayoutModule | |
LayoutModule () | |
Initializes a layout module. More... | |
virtual | ~LayoutModule () |
void | operator() (GraphAttributes &GA) |
Computes a layout of graph GA . More... | |
Private Member Functions | |
void | ComputeAngles (const Graph &G) |
void | ComputeCoordinates (GraphAttributes &AG) |
void | ComputeDiameters (GraphAttributes &AG) |
void | ComputeGroupings (const Graph &G) |
void | ComputeLevels (const Graph &G) |
void | FindRoot (const Graph &G) |
Private Attributes | |
NodeArray< double > | m_absWidth |
the absolute width of the subtree. More... | |
NodeArray< double > | m_angle |
The angle of node center (for placement). More... | |
NodeArray< SListPure< node > > | m_children |
The children of a node. More... | |
NodeArray< double > | m_diameter |
The diameter of a circle bounding a node. More... | |
NodeArray< int > | m_level |
The level of a node. More... | |
double | m_levelDistance |
The minimal distance between levels. More... | |
Array< double > | m_maxDiameter |
The maximal diameter on a level. More... | |
Array< SListPure< node > > | m_nodes |
The nodes at a level. More... | |
int | m_numLevels |
The number of levels (root is on level 0). More... | |
NodeArray< node > | m_parent |
The parent of a node (nullptr if root). More... | |
Array< double > | m_radius |
The width of a level. More... | |
NodeArray< double > | m_relWidth |
The relative width of the subtree. More... | |
node | m_root |
The root of the tree. More... | |
RootSelectionType | m_selectRoot |
Specifies how to determine the root. More... | |
NodeArray< double > | m_wedge |
The wedge reserved for subtree. More... | |
The radial tree layout algorithm.
Radial tree layout provides the following optional parameters.
Option | Type | Default | Description |
---|---|---|---|
levelDistance | double | 30.0 | The minimal vertical distance required between levels. |
rootSelection | RootSelectionType | RootSelectionType::Center | Specifies how to select the root of the tree. |
Definition at line 65 of file RadialTreeLayout.h.
|
strong |
Selection strategies for root of the tree.
Enumerator | |
---|---|
Source | Select a source in the graph. |
Sink | Select a sink in the graph. |
Center | Select the center of the tree. |
Definition at line 68 of file RadialTreeLayout.h.
ogdf::RadialTreeLayout::RadialTreeLayout | ( | ) |
Creates an instance of radial tree layout and sets options to default values.
ogdf::RadialTreeLayout::RadialTreeLayout | ( | const RadialTreeLayout & | tl | ) |
Copy constructor.
|
default |
Destructor.
|
overridevirtual |
Calls the algorithm for graph attributes GA
.
The algorithm preserve the order of children which is given by the adjacency lists.
GA | represents the input graph and is assigned the computed layout. |
Implements ogdf::LayoutModule.
|
private |
|
private |
|
private |
|
private |
|
private |
|
inline |
Definition at line 141 of file RadialTreeLayout.h.
|
private |
|
inline |
Returns the option levelDistance.
Definition at line 128 of file RadialTreeLayout.h.
|
inline |
Sets the option levelDistance to x
.
Definition at line 131 of file RadialTreeLayout.h.
RadialTreeLayout& ogdf::RadialTreeLayout::operator= | ( | const RadialTreeLayout & | tl | ) |
Assignment operator.
|
inline |
Returns the option rootSelection.
Definition at line 136 of file RadialTreeLayout.h.
|
inline |
Sets the option rootSelection to sel
.
Definition at line 139 of file RadialTreeLayout.h.
|
private |
the absolute width of the subtree.
Definition at line 91 of file RadialTreeLayout.h.
|
private |
The angle of node center (for placement).
Definition at line 93 of file RadialTreeLayout.h.
The children of a node.
Definition at line 85 of file RadialTreeLayout.h.
|
private |
The diameter of a circle bounding a node.
Definition at line 96 of file RadialTreeLayout.h.
|
private |
The level of a node.
Definition at line 82 of file RadialTreeLayout.h.
|
private |
The minimal distance between levels.
Definition at line 75 of file RadialTreeLayout.h.
|
private |
The maximal diameter on a level.
Definition at line 97 of file RadialTreeLayout.h.
The nodes at a level.
Definition at line 84 of file RadialTreeLayout.h.
|
private |
The number of levels (root is on level 0).
Definition at line 81 of file RadialTreeLayout.h.
The parent of a node (nullptr if root).
Definition at line 83 of file RadialTreeLayout.h.
|
private |
The width of a level.
Definition at line 99 of file RadialTreeLayout.h.
|
private |
The relative width of the subtree.
A nodes relative width is the greater of the sum of its childrens widths and its diameter divided by its childrens level.
Definition at line 87 of file RadialTreeLayout.h.
|
private |
The root of the tree.
Definition at line 79 of file RadialTreeLayout.h.
|
private |
Specifies how to determine the root.
Definition at line 77 of file RadialTreeLayout.h.
|
private |
The wedge reserved for subtree.
Definition at line 94 of file RadialTreeLayout.h.