Open
Graph Drawing
Framework

 v.2012.05
 

ogdf::Hierarchy Class Reference

Representation of proper hierarchies used by Sugiyama-layout. More...

#include <ogdf/layered/Hierarchy.h>

List of all members.

Public Types

enum  TraversingDir { downward, upward }
 The traversing direction of the layer-by-layer sweep. More...

Public Member Functions

 Hierarchy ()
 Creates an empty hierarchy.
 Hierarchy (const Graph &G, const NodeArray< int > &rank)
 Creates an hierarchy of graph G with node ranks rank.
 ~Hierarchy ()
void createEmpty (const Graph &G)
void initByNodes (const List< node > &nodes, EdgeArray< edge > &eCopy, const NodeArray< int > &rank)
 operator const GraphCopy & () const
 Conversion to const GraphCopy reference.
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.
int size () const
 Returns the number of levels.
int high () const
 Returns the maximal array index of a level (= size()-1).
int rank (node v) const
 Returns the rank (level) of node v.
int pos (node v) const
 Returns the position of node v on its level.
const Array< node > & adjNodes (node v)
 Returns the adjacent nodes of v (according to direction()).
const Array< node > & adjNodes (node v, TraversingDir dir) const
 Returns the adjacent nodes of v.
const LeveladjLevel (int i) const
 Returns the adjacent level of level i (according to direction()).
bool isLongEdgeDummy (node v) const
const Leveloperator[] (int i) const
 Returns the i-th level.
Leveloperator[] (int i)
 Returns the i-th level.
int calculateCrossings (int i)
 Computes the number of crossings between level i and i+1.
int calculateCrossings ()
 Computes the total number of crossings.
int calculateCrossingsPlaneSweep (int i)
 Old version of counting crossings using plane-seep algorithm (only for testing purposes).
int calculateCrossingsPlaneSweep ()
 Old version of counting crossings using plane-seep algorithm (only for testing purposes).
int calculateCrossingsSimDraw (int i, const EdgeArray< unsigned int > *edgeSubGraph)
 Computes the number of crossings between level i and i+1 (for simultaneous drawing).
int calculateCrossingsSimDraw (const EdgeArray< unsigned int > *edgeSubGraph)
 Computes the total number of crossings (for simultaneous drawing).
void storePos (NodeArray< int > &oldPos)
 Stores the position of nodes in oldPos.
void restorePos (const NodeArray< int > &newPos)
 Restores the position of nodes from newPos.
void permute ()
 Permutes the order of nodes on each level.
void separateCCs (int numCC, NodeArray< int > &component)
 Adjusts node positions such that nodes are ordered according to components numbers.
bool transpose (node v)
void print (ostream &os)
void buildAdjNodes (int i)
void buildAdjNodes ()
void check ()

Private Member Functions

bool getMarkedNodes (NodeArray< bool > &markedNodes, int r, List< node > &result, List< int > &positions)
void doInit (const NodeArray< int > &rank)
int transposePart (const Array< node > &adjV, const Array< node > &adjW)

Private Attributes

Array< Level * > m_pLevel
 The array of all levels.
GraphCopy m_GC
 The graph copy representing the topology of the proper hierarchy.
NodeArray< int > m_pos
 The position of a node on its level.
NodeArray< int > m_rank
NodeArray< Array< node > > m_lowerAdjNodes
 (Sorted) adjacent nodes on lower level.
NodeArray< Array< node > > m_upperAdjNodes
 (Sorted) adjacent nodes on upper level.
NodeArray< int > m_nSet
 (Only used by buildAdjNodes().)
NodeArray< ListIterator< node > > m_lastOcc
 (Only used by calculateCrossingsPlaneSweep().)
TraversingDir m_direction
 The current direction of layer-by-layer sweep.

Friends

class Level
class LayerBasedUPRLayout
class HierarchyLayoutModule

Detailed Description

Representation of proper hierarchies used by Sugiyama-layout.

See also:
Level, SugiyamaLayout

Definition at line 63 of file Hierarchy.h.


Member Enumeration Documentation

The traversing direction of the layer-by-layer sweep.

Enumerator:
downward 
upward 

Definition at line 71 of file Hierarchy.h.


Constructor & Destructor Documentation

Creates an empty hierarchy.

Definition at line 116 of file Hierarchy.h.

ogdf::Hierarchy::Hierarchy ( const Graph G,
const NodeArray< int > &  rank 
)

Creates an hierarchy of graph G with node ranks rank.


Member Function Documentation

const Level& ogdf::Hierarchy::adjLevel ( int  i) const [inline]

Returns the adjacent level of level i (according to direction()).

Definition at line 166 of file Hierarchy.h.

const Array<node>& ogdf::Hierarchy::adjNodes ( node  v) [inline]

Returns the adjacent nodes of v (according to direction()).

Definition at line 154 of file Hierarchy.h.

const Array<node>& ogdf::Hierarchy::adjNodes ( node  v,
TraversingDir  dir 
) const [inline]

Returns the adjacent nodes of v.

Definition at line 160 of file Hierarchy.h.

Computes the number of crossings between level i and i+1.

Computes the total number of crossings.

Old version of counting crossings using plane-seep algorithm (only for testing purposes).

Old version of counting crossings using plane-seep algorithm (only for testing purposes).

int ogdf::Hierarchy::calculateCrossingsSimDraw ( int  i,
const EdgeArray< unsigned int > *  edgeSubGraph 
)

Computes the number of crossings between level i and i+1 (for simultaneous drawing).

int ogdf::Hierarchy::calculateCrossingsSimDraw ( const EdgeArray< unsigned int > *  edgeSubGraph)

Computes the total number of crossings (for simultaneous drawing).

void ogdf::Hierarchy::createEmpty ( const Graph G)

Returns the current direction of layer-by-layer sweep.

Definition at line 132 of file Hierarchy.h.

void ogdf::Hierarchy::direction ( TraversingDir  dir) [inline]

Sets the current direction of layer-by-layer sweep.

Definition at line 137 of file Hierarchy.h.

void ogdf::Hierarchy::doInit ( const NodeArray< int > &  rank) [private]
bool ogdf::Hierarchy::getMarkedNodes ( NodeArray< bool > &  markedNodes,
int  r,
List< node > &  result,
List< int > &  positions 
) [inline, private]

Definition at line 90 of file Hierarchy.h.

int ogdf::Hierarchy::high ( ) const [inline]

Returns the maximal array index of a level (= size()-1).

Definition at line 145 of file Hierarchy.h.

void ogdf::Hierarchy::initByNodes ( const List< node > &  nodes,
EdgeArray< edge > &  eCopy,
const NodeArray< int > &  rank 
)
bool ogdf::Hierarchy::isLongEdgeDummy ( node  v) const [inline]

Definition at line 171 of file Hierarchy.h.

ogdf::Hierarchy::operator const GraphCopy & ( ) const [inline]

Conversion to const GraphCopy reference.

Definition at line 129 of file Hierarchy.h.

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

Returns the i-th level.

Definition at line 176 of file Hierarchy.h.

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

Returns the i-th level.

Definition at line 179 of file Hierarchy.h.

Permutes the order of nodes on each level.

int ogdf::Hierarchy::pos ( node  v) const [inline]

Returns the position of node v on its level.

Definition at line 151 of file Hierarchy.h.

void ogdf::Hierarchy::print ( ostream &  os)
int ogdf::Hierarchy::rank ( node  v) const [inline]

Returns the rank (level) of node v.

Definition at line 148 of file Hierarchy.h.

void ogdf::Hierarchy::restorePos ( const NodeArray< int > &  newPos)

Restores the position of nodes from newPos.

void ogdf::Hierarchy::separateCCs ( int  numCC,
NodeArray< int > &  component 
)

Adjusts node positions such that nodes are ordered according to components numbers.

int ogdf::Hierarchy::size ( ) const [inline]

Returns the number of levels.

Definition at line 142 of file Hierarchy.h.

void ogdf::Hierarchy::storePos ( NodeArray< int > &  oldPos)

Stores the position of nodes in oldPos.

int ogdf::Hierarchy::transposePart ( const Array< node > &  adjV,
const Array< node > &  adjW 
) [private]

Friends And Related Function Documentation

friend class HierarchyLayoutModule [friend]

Definition at line 68 of file Hierarchy.h.

friend class LayerBasedUPRLayout [friend]

Definition at line 67 of file Hierarchy.h.

friend class Level [friend]

Definition at line 65 of file Hierarchy.h.


Member Data Documentation

The current direction of layer-by-layer sweep.

Definition at line 88 of file Hierarchy.h.

The graph copy representing the topology of the proper hierarchy.

Definition at line 75 of file Hierarchy.h.

(Only used by calculateCrossingsPlaneSweep().)

Definition at line 86 of file Hierarchy.h.

(Sorted) adjacent nodes on lower level.

Definition at line 79 of file Hierarchy.h.

(Only used by buildAdjNodes().)

Definition at line 83 of file Hierarchy.h.

The array of all levels.

Definition at line 74 of file Hierarchy.h.

The position of a node on its level.

Definition at line 76 of file Hierarchy.h.

The rank (level) of a node.

Definition at line 77 of file Hierarchy.h.

(Sorted) adjacent nodes on upper level.

Definition at line 81 of file Hierarchy.h.


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