82 int size()
const override {
return m_pLevel.
size(); }
85 int high()
const override {
return m_pLevel.
high(); }
88 int pos(
node v)
const override {
return m_pos[v]; }
92 return (m_direction == TraversingDir::downward) ? m_lowerAdjNodes[v] : m_upperAdjNodes[v];
97 return (dir == TraversingDir::downward) ? m_lowerAdjNodes[v] : m_upperAdjNodes[v];
102 return (m_direction == TraversingDir::downward) ? *m_pLevel[i - 1] : *m_pLevel[i + 1];
125 void permute(RNG& rng);
147 for (
int i = 0; i <
m_pLevel.high(); ++i) {
150 for (
int j = 0; j <= level.
high(); ++j) {
Declaration and implementation of Array class and Array algorithms.
Declaration of interfaces used in Sugiyama framework.
Includes declaration of graph class.
Declaration and implementation of Level class.
Basic declarations, included by all source files.
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.
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.
Class for the representation of nodes.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
RegisteredArray for nodes, edges and adjEntries of a graph.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
Declaration of memory manager for allocating small pieces of memory.
The namespace for all OGDF objects.