Representation of proper hierarchies used by Sugiyama-layout. More...
#include <ogdf/layered/HierarchyLevels.h>
Public Member Functions | |
HierarchyLevels (const Hierarchy &H) | |
~HierarchyLevels () | |
const Level & | adjLevel (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 Hierarchy & | hierarchy () const override |
int | high () const override |
Returns the maximal array index of a level (= size()-1). More... | |
Level & | operator[] (int i) |
Returns the i-th level. More... | |
const Level & | operator[] (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 () |
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... | |
HierarchyLevelsBase & | operator= (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 Hierarchy & | m_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 } |
Representation of proper hierarchies used by Sugiyama-layout.
Definition at line 51 of file HierarchyLevels.h.
|
explicit |
ogdf::HierarchyLevels::~HierarchyLevels | ( | ) |
|
inline |
Returns the adjacent level of level i
(according to direction()).
Definition at line 101 of file HierarchyLevels.h.
Returns the adjacent nodes of v
(according to direction()).
Definition at line 91 of file HierarchyLevels.h.
|
inlineoverridevirtual |
Returns the adjacent nodes of v
.
Implements ogdf::HierarchyLevelsBase.
Definition at line 96 of file HierarchyLevels.h.
void ogdf::HierarchyLevels::buildAdjNodes | ( | ) |
void ogdf::HierarchyLevels::buildAdjNodes | ( | int | i | ) |
int ogdf::HierarchyLevels::calculateCrossingsSimDraw | ( | const EdgeArray< uint32_t > * | edgeSubGraphs | ) | const |
Computes the total number of crossings (for simultaneous drawing).
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).
void ogdf::HierarchyLevels::check | ( | ) | const |
|
inline |
Returns the current direction of layer-by-layer sweep.
Definition at line 76 of file HierarchyLevels.h.
|
inline |
Sets the current direction of layer-by-layer sweep.
Definition at line 79 of file HierarchyLevels.h.
|
inlineoverridevirtual |
Implements ogdf::HierarchyLevelsBase.
Definition at line 73 of file HierarchyLevels.h.
|
inlineoverridevirtual |
Returns the maximal array index of a level (= size()-1).
Reimplemented from ogdf::HierarchyLevelsBase.
Definition at line 85 of file HierarchyLevels.h.
|
inline |
Returns the i-th level.
Definition at line 109 of file HierarchyLevels.h.
|
inlineoverridevirtual |
Returns the i-th level.
Implements ogdf::HierarchyLevelsBase.
Definition at line 106 of file HierarchyLevels.h.
void ogdf::HierarchyLevels::permute | ( | ) |
Permutes the order of nodes on each level.
void ogdf::HierarchyLevels::permute | ( | RNG & | rng | ) |
Definition at line 146 of file HierarchyLevels.h.
|
inlineoverridevirtual |
Returns the position of node v
on its level.
Implements ogdf::HierarchyLevelsBase.
Definition at line 88 of file HierarchyLevels.h.
void ogdf::HierarchyLevels::print | ( | std::ostream & | os | ) | const |
void ogdf::HierarchyLevels::restorePos | ( | const NodeArray< int > & | newPos | ) |
Restores the position of nodes from newPos
.
void ogdf::HierarchyLevels::separateCCs | ( | int | numCC, |
const NodeArray< int > & | component | ||
) |
Adjusts node positions such that nodes are ordered according to components numbers.
|
inlineoverridevirtual |
Returns the number of levels.
Implements ogdf::HierarchyLevelsBase.
Definition at line 82 of file HierarchyLevels.h.
void ogdf::HierarchyLevels::storePos | ( | NodeArray< int > & | oldPos | ) | const |
Stores the position of nodes in oldPos
.
bool ogdf::HierarchyLevels::transpose | ( | node | v | ) |
|
private |
|
friend |
Definition at line 54 of file HierarchyLevels.h.
|
friend |
Definition at line 53 of file HierarchyLevels.h.
|
private |
The current direction of layer-by-layer sweep.
Definition at line 67 of file HierarchyLevels.h.
|
private |
Definition at line 57 of file HierarchyLevels.h.
(Sorted) adjacent nodes on lower level.
Definition at line 62 of file HierarchyLevels.h.
|
private |
(Only used by buildAdjNodes().)
Definition at line 65 of file HierarchyLevels.h.
The array of all levels.
Definition at line 59 of file HierarchyLevels.h.
|
private |
The position of a node on its level.
Definition at line 60 of file HierarchyLevels.h.
(Sorted) adjacent nodes on upper level.
Definition at line 63 of file HierarchyLevels.h.