77 int size()
const override {
return m_pLevel.
size(); }
80 int high()
const override {
return m_pLevel.
high(); }
83 int pos(
node v)
const override {
return m_pos[v]; }
87 return (m_direction == TraversingDir::downward) ? m_lowerAdjNodes[v] : m_upperAdjNodes[v];
92 return (dir == TraversingDir::downward) ? m_lowerAdjNodes[v] : m_upperAdjNodes[v];
97 return (m_direction == TraversingDir::downward) ? *m_pLevel[i - 1] : *m_pLevel[i + 1];
142 for (
int i = 0; i <
m_pLevel.high(); ++i) {
145 for (
int j = 0;
j <= level.
high(); ++
j) {
Declaration of interfaces used in Sugiyama framework.
Declaration and implementation of EdgeArray class.
Declaration of graph copy classes.
Declaration of Hierarchy class.
Declaration and implementation of Level class.
The parameterized class Array implements dynamic arrays of type E.
INDEX high() const
Returns the maximal array index.
void permute(INDEX l, INDEX r)
Randomly permutes the subarray with index set [l..r].
INDEX size() const
Returns the size (number of elements) of the array.
Dynamic arrays indexed with edges.
Representation of proper hierarchies used by Sugiyama-layout.
Representation of proper hierarchies used by Sugiyama-layout.
Array< Level * > m_pLevel
The array of all levels.
const Array< node > & adjNodes(node v, TraversingDir dir) const override
Returns the adjacent nodes of v.
void separateCCs(int numCC, const NodeArray< int > &component)
Adjusts node positions such that nodes are ordered according to components numbers.
NodeArray< Array< node > > m_upperAdjNodes
(Sorted) adjacent nodes on upper level.
NodeArray< int > m_pos
The position of a node on its level.
const Level & operator[](int i) const override
Returns the i-th level.
NodeArray< Array< node > > m_lowerAdjNodes
(Sorted) adjacent nodes on lower level.
void storePos(NodeArray< int > &oldPos) const
Stores the position of nodes in oldPos.
Level & operator[](int i)
Returns the i-th level.
int size() const override
Returns the number of levels.
NodeArray< int > m_nSet
(Only used by buildAdjNodes().)
void permute()
Permutes the order of nodes on each level.
const Array< node > & adjNodes(node v) const
Returns the adjacent nodes of v (according to direction()).
int calculateCrossingsSimDraw(const EdgeArray< uint32_t > *edgeSubGraphs) const
Computes the total number of crossings (for simultaneous drawing).
void buildAdjNodes(int i)
const Hierarchy & hierarchy() const override
void restorePos(const NodeArray< int > &newPos)
Restores the position of nodes from newPos.
void direction(TraversingDir dir)
Sets the current direction of layer-by-layer sweep.
int high() const override
Returns the maximal array index of a level (= size()-1).
const Level & adjLevel(int i) const
Returns the adjacent level of level i (according to direction()).
TraversingDir direction() const
Returns the current direction of layer-by-layer sweep.
TraversingDir m_direction
The current direction of layer-by-layer sweep.
int calculateCrossingsSimDraw(int i, const EdgeArray< uint32_t > *edgeSubGraphs) const
Computes the number of crossings between level i and i+1 (for simultaneous drawing).
HierarchyLevels(const Hierarchy &H)
void print(std::ostream &os) const
int pos(node v) const override
Returns the position of node v on its level.
int transposePart(const Array< node > &adjV, const Array< node > &adjW)
Representation of levels in hierarchies.
int high() const override
Returns the maximal array index (= size()-1).
Array< node > m_nodes
The nodes on this level.
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.