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()). | |
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 Hierarchy & | hierarchy () const override |
int | high () const override |
Returns the maximal array index of a level (= size()-1). | |
Level & | operator[] (int i) |
Returns the i-th level. | |
const Level & | operator[] (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 . | |
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. | |
const Hierarchy & | m_H |
NodeArray< Array< node > > | m_lowerAdjNodes |
(Sorted) adjacent nodes on lower level. | |
NodeArray< int > | m_nSet |
(Only used by buildAdjNodes().) | |
Array< Level * > | m_pLevel |
The array of all levels. | |
NodeArray< int > | m_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 } |
Representation of proper hierarchies used by Sugiyama-layout.
Definition at line 46 of file HierarchyLevels.h.
ogdf::HierarchyLevels::~HierarchyLevels | ( | ) |
Returns the adjacent level of level i
(according to direction()).
Definition at line 96 of file HierarchyLevels.h.
Returns the adjacent nodes of v
(according to direction()).
Definition at line 86 of file HierarchyLevels.h.
|
inlineoverridevirtual |
Returns the adjacent nodes of v
.
Implements ogdf::HierarchyLevelsBase.
Definition at line 91 of file HierarchyLevels.h.
void ogdf::HierarchyLevels::buildAdjNodes | ( | ) |
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 71 of file HierarchyLevels.h.
|
inline |
Sets the current direction of layer-by-layer sweep.
Definition at line 74 of file HierarchyLevels.h.
Implements ogdf::HierarchyLevelsBase.
Definition at line 68 of file HierarchyLevels.h.
|
inlineoverridevirtual |
Returns the maximal array index of a level (= size()-1).
Reimplemented from ogdf::HierarchyLevelsBase.
Definition at line 80 of file HierarchyLevels.h.
Returns the i-th level.
Definition at line 104 of file HierarchyLevels.h.
Returns the i-th level.
Implements ogdf::HierarchyLevelsBase.
Definition at line 101 of file HierarchyLevels.h.
void ogdf::HierarchyLevels::permute | ( | ) |
Permutes the order of nodes on each level.
Definition at line 141 of file HierarchyLevels.h.
Returns the position of node v
on its level.
Implements ogdf::HierarchyLevelsBase.
Definition at line 83 of file HierarchyLevels.h.
void ogdf::HierarchyLevels::print | ( | std::ostream & | os | ) | const |
Restores the position of nodes from newPos
.
Adjusts node positions such that nodes are ordered according to components numbers.
|
inlineoverridevirtual |
Returns the number of levels.
Implements ogdf::HierarchyLevelsBase.
Definition at line 77 of file HierarchyLevels.h.
Stores the position of nodes in oldPos
.
|
private |
|
friend |
Definition at line 49 of file HierarchyLevels.h.
Definition at line 48 of file HierarchyLevels.h.
|
private |
The current direction of layer-by-layer sweep.
Definition at line 62 of file HierarchyLevels.h.
Definition at line 52 of file HierarchyLevels.h.
(Sorted) adjacent nodes on lower level.
Definition at line 57 of file HierarchyLevels.h.
(Only used by buildAdjNodes().)
Definition at line 60 of file HierarchyLevels.h.
The array of all levels.
Definition at line 54 of file HierarchyLevels.h.
The position of a node on its level.
Definition at line 55 of file HierarchyLevels.h.
(Sorted) adjacent nodes on upper level.
Definition at line 58 of file HierarchyLevels.h.