Open
Graph Drawing
Framework

 v.2012.07
 

ogdf::Level Class Reference

Representation of levels in hierarchies. More...

#include <ogdf/layered/Level.h>

List of all members.

Public Member Functions

 Level (Hierarchy *pHierarchy, int index, int num)
 Creates a level with index index in hierarchy pHierarchy.
 ~Level ()
const Array< node > & adjNodes (node v)
 Returns the (sorted) array of adjacent nodes of v (according to direction()).
const Hierarchyhierarchy () const
 Returns the hierarchy to which this level belongs.
int high () const
 Returns the maximal array index (= size()-1).
int index () const
 Returns the array index of this level in the hierarchy.
const nodeoperator[] (int i) const
 Returns the node at position i.
nodeoperator[] (int i)
 Returns the node at position i.
void recalcPos ()
int size () const
 Returns the number of nodes on this level.
void sort (NodeArray< double > &weight)
 Sorts the nodes according to weight using quicksort.
void sort (NodeArray< int > &weight, int minBucket, int maxBucket)
 Sorts the nodes according to weight using bucket sort.
void sortByWeightOnly (NodeArray< double > &weight)
 Sorts the nodes according to weight (without special placement for "isolated" nodes).
template<class C >
void sortOrder (C &orderComparer)
 Sorts the nodes according to orderComparer.
void swap (int i, int j)
 Exchanges nodes at position i and j.

Private Member Functions

void getIsolatedNodes (SListPure< Tuple2< node, int > > &isolated)
void setIsolatedNodes (SListPure< Tuple2< node, int > > &isolated)

Private Attributes

int m_index
 The index of this level.
Array< nodem_nodes
 The nodes on this level.
Hierarchym_pHierarchy
 The hierarchy to which this level belongs.

Friends

class Hierarchy
class HierarchyLayoutModule
class LayerBasedUPRLayout
ostream & operator<< (ostream &os, const Level &L)

Detailed Description

Representation of levels in hierarchies.

See also:
Hierarchy, SugiyamaLayout

Definition at line 81 of file Level.h.


Constructor & Destructor Documentation

ogdf::Level::Level ( Hierarchy pHierarchy,
int  index,
int  num 
)
inline

Creates a level with index index in hierarchy pHierarchy.

Parameters:
pHierarchyis a pointer to the hierarchy to which the created level will belong.
indexis the index of the level.
numis the number of nodes on this level.

Definition at line 99 of file Level.h.

ogdf::Level::~Level ( )
inline

Definition at line 103 of file Level.h.


Member Function Documentation

const Array<node>& ogdf::Level::adjNodes ( node  v)

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

void ogdf::Level::getIsolatedNodes ( SListPure< Tuple2< node, int > > &  isolated)
private
const Hierarchy& ogdf::Level::hierarchy ( ) const
inline

Returns the hierarchy to which this level belongs.

Definition at line 122 of file Level.h.

int ogdf::Level::high ( ) const
inline

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

Definition at line 113 of file Level.h.

int ogdf::Level::index ( ) const
inline

Returns the array index of this level in the hierarchy.

Definition at line 116 of file Level.h.

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

Returns the node at position i.

Definition at line 106 of file Level.h.

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

Returns the node at position i.

Definition at line 108 of file Level.h.

void ogdf::Level::recalcPos ( )
void ogdf::Level::setIsolatedNodes ( SListPure< Tuple2< node, int > > &  isolated)
private
int ogdf::Level::size ( ) const
inline

Returns the number of nodes on this level.

Definition at line 111 of file Level.h.

void ogdf::Level::sort ( NodeArray< double > &  weight)

Sorts the nodes according to weight using quicksort.

void ogdf::Level::sort ( NodeArray< int > &  weight,
int  minBucket,
int  maxBucket 
)

Sorts the nodes according to weight using bucket sort.

void ogdf::Level::sortByWeightOnly ( NodeArray< double > &  weight)

Sorts the nodes according to weight (without special placement for "isolated" nodes).

template<class C >
void ogdf::Level::sortOrder ( C &  orderComparer)
inline

Sorts the nodes according to orderComparer.

Definition at line 138 of file Level.h.

void ogdf::Level::swap ( int  i,
int  j 
)

Exchanges nodes at position i and j.


Friends And Related Function Documentation

friend class Hierarchy
friend

Definition at line 83 of file Level.h.

friend class HierarchyLayoutModule
friend

Definition at line 85 of file Level.h.

friend class LayerBasedUPRLayout
friend

Definition at line 84 of file Level.h.

ostream& operator<< ( ostream &  os,
const Level L 
)
friend

Definition at line 145 of file Level.h.


Member Data Documentation

int ogdf::Level::m_index
private

The index of this level.

Definition at line 89 of file Level.h.

Array<node> ogdf::Level::m_nodes
private

The nodes on this level.

Definition at line 87 of file Level.h.

Hierarchy* ogdf::Level::m_pHierarchy
private

The hierarchy to which this level belongs.

Definition at line 88 of file Level.h.


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