Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::HierarchyLevels Class Reference

Representation of proper hierarchies used by Sugiyama-layout. More...

#include <ogdf/layered/HierarchyLevels.h>

+ Inheritance diagram for ogdf::HierarchyLevels:

Public Member Functions

 HierarchyLevels (const Hierarchy &H)
 
 ~HierarchyLevels ()
 
const LeveladjLevel (int i) const
 Returns the adjacent level of level i (according to direction()). More...
 
const Array< node > & adjNodes (node v) const
 Returns the adjacent nodes of v (according to direction()). More...
 
const Array< node > & adjNodes (node v, TraversingDir dir) const override
 Returns the adjacent nodes of v. More...
 
void buildAdjNodes ()
 
void buildAdjNodes (int i)
 
int calculateCrossingsSimDraw (const EdgeArray< uint32_t > *edgeSubGraphs) const
 Computes the total number of crossings (for simultaneous drawing). More...
 
int calculateCrossingsSimDraw (int i, const EdgeArray< uint32_t > *edgeSubGraphs) const
 Computes the number of crossings between level i and i+1 (for simultaneous drawing). More...
 
void check () const
 
TraversingDir direction () const
 Returns the current direction of layer-by-layer sweep. More...
 
void direction (TraversingDir dir)
 Sets the current direction of layer-by-layer sweep. More...
 
const Hierarchyhierarchy () const override
 
int high () const override
 Returns the maximal array index of a level (= size()-1). More...
 
Leveloperator[] (int i)
 Returns the i-th level. More...
 
const Leveloperator[] (int i) const override
 Returns the i-th level. More...
 
void permute ()
 Permutes the order of nodes on each level. More...
 
template<class RNG >
void permute (RNG &rng)
 
int pos (node v) const override
 Returns the position of node v on its level. More...
 
void print (std::ostream &os) const
 
void restorePos (const NodeArray< int > &newPos)
 Restores the position of nodes from newPos. More...
 
void separateCCs (int numCC, const NodeArray< int > &component)
 Adjusts node positions such that nodes are ordered according to components numbers. More...
 
int size () const override
 Returns the number of levels. More...
 
void storePos (NodeArray< int > &oldPos) const
 Stores the position of nodes in oldPos. More...
 
bool transpose (node v)
 
- Public Member Functions inherited from ogdf::HierarchyLevelsBase
 HierarchyLevelsBase ()=default
 
 HierarchyLevelsBase (const HierarchyLevelsBase &)=default
 
virtual ~HierarchyLevelsBase ()
 
virtual const Array< node > & adjNodes (node v, TraversingDir dir) const =0
 Returns the adjacent nodes of v. More...
 
int calculateCrossings () const
 Computes the total number of crossings. More...
 
int calculateCrossings (int i) const
 Computes the number of crossings between level i and i+1. More...
 
HierarchyLevelsBaseoperator= (const HierarchyLevelsBase &)=default
 

Private Member Functions

int transposePart (const Array< node > &adjV, const Array< node > &adjW)
 

Private Attributes

TraversingDir m_direction
 The current direction of layer-by-layer sweep. More...
 
const Hierarchym_H
 
NodeArray< Array< node > > m_lowerAdjNodes
 (Sorted) adjacent nodes on lower level. More...
 
NodeArray< int > m_nSet
 (Only used by buildAdjNodes().) More...
 
Array< Level * > m_pLevel
 The array of all levels. More...
 
NodeArray< int > m_pos
 The position of a node on its level. More...
 
NodeArray< Array< node > > m_upperAdjNodes
 (Sorted) adjacent nodes on upper level. More...
 

Friends

class LayerBasedUPRLayout
 
class Level
 

Additional Inherited Members

- Public Types inherited from ogdf::HierarchyLevelsBase
enum  TraversingDir { TraversingDir::downward, TraversingDir::upward }
 

Detailed Description

Representation of proper hierarchies used by Sugiyama-layout.

See also
Level, SugiyamaLayout

Definition at line 46 of file HierarchyLevels.h.

Constructor & Destructor Documentation

◆ HierarchyLevels()

ogdf::HierarchyLevels::HierarchyLevels ( const Hierarchy H)
explicit

◆ ~HierarchyLevels()

ogdf::HierarchyLevels::~HierarchyLevels ( )

Member Function Documentation

◆ adjLevel()

const Level& ogdf::HierarchyLevels::adjLevel ( int  i) const
inline

Returns the adjacent level of level i (according to direction()).

Definition at line 104 of file HierarchyLevels.h.

◆ adjNodes() [1/2]

const Array<node>& ogdf::HierarchyLevels::adjNodes ( node  v) const
inline

Returns the adjacent nodes of v (according to direction()).

Definition at line 92 of file HierarchyLevels.h.

◆ adjNodes() [2/2]

const Array<node>& ogdf::HierarchyLevels::adjNodes ( node  v,
TraversingDir  dir 
) const
inlineoverride

Returns the adjacent nodes of v.

Definition at line 98 of file HierarchyLevels.h.

◆ buildAdjNodes() [1/2]

void ogdf::HierarchyLevels::buildAdjNodes ( )

◆ buildAdjNodes() [2/2]

void ogdf::HierarchyLevels::buildAdjNodes ( int  i)

◆ calculateCrossingsSimDraw() [1/2]

int ogdf::HierarchyLevels::calculateCrossingsSimDraw ( const EdgeArray< uint32_t > *  edgeSubGraphs) const

Computes the total number of crossings (for simultaneous drawing).

◆ calculateCrossingsSimDraw() [2/2]

int ogdf::HierarchyLevels::calculateCrossingsSimDraw ( int  i,
const EdgeArray< uint32_t > *  edgeSubGraphs 
) const

Computes the number of crossings between level i and i+1 (for simultaneous drawing).

◆ check()

void ogdf::HierarchyLevels::check ( ) const

◆ direction() [1/2]

TraversingDir ogdf::HierarchyLevels::direction ( ) const
inline

Returns the current direction of layer-by-layer sweep.

Definition at line 73 of file HierarchyLevels.h.

◆ direction() [2/2]

void ogdf::HierarchyLevels::direction ( TraversingDir  dir)
inline

Sets the current direction of layer-by-layer sweep.

Definition at line 78 of file HierarchyLevels.h.

◆ hierarchy()

const Hierarchy& ogdf::HierarchyLevels::hierarchy ( ) const
inlineoverridevirtual

Implements ogdf::HierarchyLevelsBase.

Definition at line 70 of file HierarchyLevels.h.

◆ high()

int ogdf::HierarchyLevels::high ( ) const
inlineoverridevirtual

Returns the maximal array index of a level (= size()-1).

Reimplemented from ogdf::HierarchyLevelsBase.

Definition at line 86 of file HierarchyLevels.h.

◆ operator[]() [1/2]

Level& ogdf::HierarchyLevels::operator[] ( int  i)
inline

Returns the i-th level.

Definition at line 112 of file HierarchyLevels.h.

◆ operator[]() [2/2]

const Level& ogdf::HierarchyLevels::operator[] ( int  i) const
inlineoverridevirtual

Returns the i-th level.

Implements ogdf::HierarchyLevelsBase.

Definition at line 109 of file HierarchyLevels.h.

◆ permute() [1/2]

void ogdf::HierarchyLevels::permute ( )

Permutes the order of nodes on each level.

◆ permute() [2/2]

template<class RNG >
void ogdf::HierarchyLevels::permute ( RNG &  rng)

Definition at line 150 of file HierarchyLevels.h.

◆ pos()

int ogdf::HierarchyLevels::pos ( node  v) const
inlineoverridevirtual

Returns the position of node v on its level.

Implements ogdf::HierarchyLevelsBase.

Definition at line 89 of file HierarchyLevels.h.

◆ print()

void ogdf::HierarchyLevels::print ( std::ostream &  os) const

◆ restorePos()

void ogdf::HierarchyLevels::restorePos ( const NodeArray< int > &  newPos)

Restores the position of nodes from newPos.

◆ separateCCs()

void ogdf::HierarchyLevels::separateCCs ( int  numCC,
const NodeArray< int > &  component 
)

Adjusts node positions such that nodes are ordered according to components numbers.

◆ size()

int ogdf::HierarchyLevels::size ( ) const
inlineoverridevirtual

Returns the number of levels.

Implements ogdf::HierarchyLevelsBase.

Definition at line 83 of file HierarchyLevels.h.

◆ storePos()

void ogdf::HierarchyLevels::storePos ( NodeArray< int > &  oldPos) const

Stores the position of nodes in oldPos.

◆ transpose()

bool ogdf::HierarchyLevels::transpose ( node  v)

◆ transposePart()

int ogdf::HierarchyLevels::transposePart ( const Array< node > &  adjV,
const Array< node > &  adjW 
)
private

Friends And Related Function Documentation

◆ LayerBasedUPRLayout

friend class LayerBasedUPRLayout
friend

Definition at line 51 of file HierarchyLevels.h.

◆ Level

friend class Level
friend

Definition at line 50 of file HierarchyLevels.h.

Member Data Documentation

◆ m_direction

TraversingDir ogdf::HierarchyLevels::m_direction
private

The current direction of layer-by-layer sweep.

Definition at line 64 of file HierarchyLevels.h.

◆ m_H

const Hierarchy& ogdf::HierarchyLevels::m_H
private

Definition at line 54 of file HierarchyLevels.h.

◆ m_lowerAdjNodes

NodeArray<Array<node> > ogdf::HierarchyLevels::m_lowerAdjNodes
private

(Sorted) adjacent nodes on lower level.

Definition at line 59 of file HierarchyLevels.h.

◆ m_nSet

NodeArray<int> ogdf::HierarchyLevels::m_nSet
private

(Only used by buildAdjNodes().)

Definition at line 62 of file HierarchyLevels.h.

◆ m_pLevel

Array<Level *> ogdf::HierarchyLevels::m_pLevel
private

The array of all levels.

Definition at line 56 of file HierarchyLevels.h.

◆ m_pos

NodeArray<int> ogdf::HierarchyLevels::m_pos
private

The position of a node on its level.

Definition at line 57 of file HierarchyLevels.h.

◆ m_upperAdjNodes

NodeArray<Array<node> > ogdf::HierarchyLevels::m_upperAdjNodes
private

(Sorted) adjacent nodes on upper level.

Definition at line 60 of file HierarchyLevels.h.


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