Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::RadialTreeLayout Class Reference

The radial tree layout algorithm. More...

#include <ogdf/tree/RadialTreeLayout.h>

+ Inheritance diagram for ogdf::RadialTreeLayout:

Public Types

enum class  RootSelectionType { Source , Sink , 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.
 
 RadialTreeLayout (const RadialTreeLayout &tl)
 Copy constructor.
 
 ~RadialTreeLayout ()=default
 Destructor.
 
virtual void call (GraphAttributes &GA) override
 Calls the algorithm for graph attributes GA.
 
const NodeArray< double > & diameter () const
 
double levelDistance () const
 Returns the option levelDistance.
 
void levelDistance (double x)
 Sets the option levelDistance to x.
 
RadialTreeLayoutoperator= (const RadialTreeLayout &tl)
 Assignment operator.
 
RootSelectionType rootSelection () const
 Returns the option rootSelection.
 
void rootSelection (RootSelectionType sel)
 Sets the option rootSelection to sel.
 
- Public Member Functions inherited from ogdf::LayoutModule
 LayoutModule ()
 Initializes a layout module.
 
virtual ~LayoutModule ()
 
void operator() (GraphAttributes &GA)
 Computes a layout of graph GA.
 

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< doublem_absWidth
 the absolute width of the subtree.
 
NodeArray< doublem_angle
 The angle of node center (for placement).
 
NodeArray< SListPure< node > > m_children
 The children of a node.
 
NodeArray< doublem_diameter
 The diameter of a circle bounding a node.
 
NodeArray< intm_level
 The level of a node.
 
double m_levelDistance
 The minimal distance between levels.
 
Array< doublem_maxDiameter
 The maximal diameter on a level.
 
Array< SListPure< node > > m_nodes
 The nodes at a level.
 
int m_numLevels
 The number of levels (root is on level 0).
 
NodeArray< nodem_parent
 The parent of a node (nullptr if root).
 
Array< doublem_radius
 The width of a level.
 
NodeArray< doublem_relWidth
 The relative width of the subtree.
 
node m_root
 The root of the tree.
 
RootSelectionType m_selectRoot
 Specifies how to determine the root.
 
NodeArray< doublem_wedge
 The wedge reserved for subtree.
 

Detailed Description

The radial tree layout algorithm.

Optional parameters

Radial tree layout provides the following optional parameters.

OptionTypeDefaultDescription
levelDistancedouble30.0 The minimal vertical distance required between levels.
rootSelectionRootSelectionType RootSelectionType::Center Specifies how to select the root of the tree.

Definition at line 60 of file RadialTreeLayout.h.

Member Enumeration Documentation

◆ RootSelectionType

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 63 of file RadialTreeLayout.h.

Constructor & Destructor Documentation

◆ RadialTreeLayout() [1/2]

ogdf::RadialTreeLayout::RadialTreeLayout ( )

Creates an instance of radial tree layout and sets options to default values.

◆ RadialTreeLayout() [2/2]

ogdf::RadialTreeLayout::RadialTreeLayout ( const RadialTreeLayout tl)

Copy constructor.

◆ ~RadialTreeLayout()

ogdf::RadialTreeLayout::~RadialTreeLayout ( )
default

Destructor.

Member Function Documentation

◆ call()

virtual void ogdf::RadialTreeLayout::call ( GraphAttributes GA)
overridevirtual

Calls the algorithm for graph attributes GA.

The algorithm preserve the order of children which is given by the adjacency lists.

Precondition
The graph is a tree.
Parameters
GArepresents the input graph and is assigned the computed layout.

Implements ogdf::LayoutModule.

◆ ComputeAngles()

void ogdf::RadialTreeLayout::ComputeAngles ( const Graph G)
private

◆ ComputeCoordinates()

void ogdf::RadialTreeLayout::ComputeCoordinates ( GraphAttributes AG)
private

◆ ComputeDiameters()

void ogdf::RadialTreeLayout::ComputeDiameters ( GraphAttributes AG)
private

◆ ComputeGroupings()

void ogdf::RadialTreeLayout::ComputeGroupings ( const Graph G)
private

◆ ComputeLevels()

void ogdf::RadialTreeLayout::ComputeLevels ( const Graph G)
private

◆ diameter()

const NodeArray< double > & ogdf::RadialTreeLayout::diameter ( ) const
inline

Definition at line 136 of file RadialTreeLayout.h.

◆ FindRoot()

void ogdf::RadialTreeLayout::FindRoot ( const Graph G)
private

◆ levelDistance() [1/2]

double ogdf::RadialTreeLayout::levelDistance ( ) const
inline

Returns the option levelDistance.

Definition at line 123 of file RadialTreeLayout.h.

◆ levelDistance() [2/2]

void ogdf::RadialTreeLayout::levelDistance ( double  x)
inline

Sets the option levelDistance to x.

Definition at line 126 of file RadialTreeLayout.h.

◆ operator=()

RadialTreeLayout & ogdf::RadialTreeLayout::operator= ( const RadialTreeLayout tl)

Assignment operator.

◆ rootSelection() [1/2]

RootSelectionType ogdf::RadialTreeLayout::rootSelection ( ) const
inline

Returns the option rootSelection.

Definition at line 131 of file RadialTreeLayout.h.

◆ rootSelection() [2/2]

void ogdf::RadialTreeLayout::rootSelection ( RootSelectionType  sel)
inline

Sets the option rootSelection to sel.

Definition at line 134 of file RadialTreeLayout.h.

Member Data Documentation

◆ m_absWidth

NodeArray<double> ogdf::RadialTreeLayout::m_absWidth
private

the absolute width of the subtree.

Definition at line 86 of file RadialTreeLayout.h.

◆ m_angle

NodeArray<double> ogdf::RadialTreeLayout::m_angle
private

The angle of node center (for placement).

Definition at line 88 of file RadialTreeLayout.h.

◆ m_children

NodeArray<SListPure<node> > ogdf::RadialTreeLayout::m_children
private

The children of a node.

Definition at line 80 of file RadialTreeLayout.h.

◆ m_diameter

NodeArray<double> ogdf::RadialTreeLayout::m_diameter
private

The diameter of a circle bounding a node.

Definition at line 91 of file RadialTreeLayout.h.

◆ m_level

NodeArray<int> ogdf::RadialTreeLayout::m_level
private

The level of a node.

Definition at line 77 of file RadialTreeLayout.h.

◆ m_levelDistance

double ogdf::RadialTreeLayout::m_levelDistance
private

The minimal distance between levels.

Definition at line 70 of file RadialTreeLayout.h.

◆ m_maxDiameter

Array<double> ogdf::RadialTreeLayout::m_maxDiameter
private

The maximal diameter on a level.

Definition at line 92 of file RadialTreeLayout.h.

◆ m_nodes

Array<SListPure<node> > ogdf::RadialTreeLayout::m_nodes
private

The nodes at a level.

Definition at line 79 of file RadialTreeLayout.h.

◆ m_numLevels

int ogdf::RadialTreeLayout::m_numLevels
private

The number of levels (root is on level 0).

Definition at line 76 of file RadialTreeLayout.h.

◆ m_parent

NodeArray<node> ogdf::RadialTreeLayout::m_parent
private

The parent of a node (nullptr if root).

Definition at line 78 of file RadialTreeLayout.h.

◆ m_radius

Array<double> ogdf::RadialTreeLayout::m_radius
private

The width of a level.

Definition at line 94 of file RadialTreeLayout.h.

◆ m_relWidth

NodeArray<double> ogdf::RadialTreeLayout::m_relWidth
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 82 of file RadialTreeLayout.h.

◆ m_root

node ogdf::RadialTreeLayout::m_root
private

The root of the tree.

Definition at line 74 of file RadialTreeLayout.h.

◆ m_selectRoot

RootSelectionType ogdf::RadialTreeLayout::m_selectRoot
private

Specifies how to determine the root.

Definition at line 72 of file RadialTreeLayout.h.

◆ m_wedge

NodeArray<double> ogdf::RadialTreeLayout::m_wedge
private

The wedge reserved for subtree.

Definition at line 89 of file RadialTreeLayout.h.


The documentation for this class was generated from the following file: