Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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()).
 
const Array< node > & adjNodes (node v) const
 Returns the adjacent nodes of v (according to direction()).
 
const Array< node > & adjNodes (node v, TraversingDir dir) const override
 Returns the adjacent nodes of v.
 
void buildAdjNodes ()
 
void buildAdjNodes (int i)
 
int calculateCrossingsSimDraw (const EdgeArray< uint32_t > *edgeSubGraphs) const
 Computes the total number of crossings (for simultaneous drawing).
 
int calculateCrossingsSimDraw (int i, const EdgeArray< uint32_t > *edgeSubGraphs) const
 Computes the number of crossings between level i and i+1 (for simultaneous drawing).
 
void check () const
 
TraversingDir direction () const
 Returns the current direction of layer-by-layer sweep.
 
void direction (TraversingDir dir)
 Sets the current direction of layer-by-layer sweep.
 
const Hierarchyhierarchy () const override
 
int high () const override
 Returns the maximal array index of a level (= size()-1).
 
Leveloperator[] (int i)
 Returns the i-th level.
 
const Leveloperator[] (int i) const override
 Returns the i-th level.
 
void permute ()
 Permutes the order of nodes on each level.
 
template<class RNG >
void permute (RNG &rng)
 
int pos (node v) const override
 Returns the position of node v on its level.
 
void print (std::ostream &os) const
 
void restorePos (const NodeArray< int > &newPos)
 Restores the position of nodes from newPos.
 
void separateCCs (int numCC, const NodeArray< int > &component)
 Adjusts node positions such that nodes are ordered according to components numbers.
 
int size () const override
 Returns the number of levels.
 
void storePos (NodeArray< int > &oldPos) const
 Stores the position of nodes in oldPos.
 
bool transpose (node v)
 
- Public Member Functions inherited from ogdf::HierarchyLevelsBase
 HierarchyLevelsBase ()=default
 
 HierarchyLevelsBase (const HierarchyLevelsBase &)=default
 
virtual ~HierarchyLevelsBase ()
 
int calculateCrossings () const
 Computes the total number of crossings.
 
int calculateCrossings (int i) const
 Computes the number of crossings between level i and i+1.
 
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.
 
const Hierarchym_H
 
NodeArray< Array< node > > m_lowerAdjNodes
 (Sorted) adjacent nodes on lower level.
 
NodeArray< intm_nSet
 (Only used by buildAdjNodes().)
 
Array< Level * > m_pLevel
 The array of all levels.
 
NodeArray< intm_pos
 The position of a node on its level.
 
NodeArray< Array< node > > m_upperAdjNodes
 (Sorted) adjacent nodes on upper level.
 

Friends

class LayerBasedUPRLayout
 
class Level
 

Additional Inherited Members

- Public Types inherited from ogdf::HierarchyLevelsBase
enum class  TraversingDir { downward , 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 96 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 86 of file HierarchyLevels.h.

◆ adjNodes() [2/2]

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

Returns the adjacent nodes of v.

Implements ogdf::HierarchyLevelsBase.

Definition at line 91 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 71 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 74 of file HierarchyLevels.h.

◆ hierarchy()

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

Implements ogdf::HierarchyLevelsBase.

Definition at line 68 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 80 of file HierarchyLevels.h.

◆ operator[]() [1/2]

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

Returns the i-th level.

Definition at line 104 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 101 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 141 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 83 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 77 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 Symbol Documentation

◆ LayerBasedUPRLayout

Definition at line 49 of file HierarchyLevels.h.

◆ Level

friend class Level
friend

Definition at line 48 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 62 of file HierarchyLevels.h.

◆ m_H

const Hierarchy& ogdf::HierarchyLevels::m_H
private

Definition at line 52 of file HierarchyLevels.h.

◆ m_lowerAdjNodes

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

(Sorted) adjacent nodes on lower level.

Definition at line 57 of file HierarchyLevels.h.

◆ m_nSet

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

(Only used by buildAdjNodes().)

Definition at line 60 of file HierarchyLevels.h.

◆ m_pLevel

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

The array of all levels.

Definition at line 54 of file HierarchyLevels.h.

◆ m_pos

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

The position of a node on its level.

Definition at line 55 of file HierarchyLevels.h.

◆ m_upperAdjNodes

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

(Sorted) adjacent nodes on upper level.

Definition at line 58 of file HierarchyLevels.h.


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