Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::Level Class Reference

Representation of levels in hierarchies. More...

#include <ogdf/layered/Level.h>

+ Inheritance diagram for ogdf::Level:

Public Member Functions

 Level (HierarchyLevels *pLevels, int index, int num)
 Creates a level with index index in hierarchy pLevels.
 
 ~Level ()
 
const Array< node > & adjNodes (node v) const
 Returns the (sorted) array of adjacent nodes of v (according to direction()).
 
int high () const override
 Returns the maximal array index (= size()-1).
 
int index () const
 Returns the array index of this level in the hierarchy.
 
const HierarchyLevelslevels () const
 Returns the hierarchy to which this level belongs.
 
const nodeoperator[] (int i) const override
 Returns the node at position i.
 
nodeoperator[] (int i) override
 Returns the node at position i.
 
void recalcPos ()
 
int size () const override
 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.
 
- Public Member Functions inherited from ogdf::LevelBase
virtual ~LevelBase ()
 

Private Member Functions

void getIsolatedNodes (SListPure< Tuple2< node, int > > &isolated) const
 
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.
 
HierarchyLevelsm_pLevels
 The hierarchy to which this level belongs.
 

Friends

class HierarchyLayoutModule
 
class HierarchyLevels
 
class LayerBasedUPRLayout
 
std::ostream & operator<< (std::ostream &os, const Level &L)
 

Detailed Description

Representation of levels in hierarchies.

See also
Hierarchy, SugiyamaLayout

Definition at line 60 of file Level.h.

Constructor & Destructor Documentation

◆ Level()

ogdf::Level::Level ( HierarchyLevels pLevels,
int  index,
int  num 
)
inline

Creates a level with index index in hierarchy pLevels.

Parameters
pLevelsis 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 76 of file Level.h.

◆ ~Level()

ogdf::Level::~Level ( )
inline

Definition at line 80 of file Level.h.

Member Function Documentation

◆ adjNodes()

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

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

◆ getIsolatedNodes()

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

◆ high()

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

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

Implements ogdf::LevelBase.

Definition at line 92 of file Level.h.

◆ index()

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

Returns the array index of this level in the hierarchy.

Definition at line 95 of file Level.h.

◆ levels()

const HierarchyLevels & ogdf::Level::levels ( ) const
inline

Returns the hierarchy to which this level belongs.

Definition at line 101 of file Level.h.

◆ operator[]() [1/2]

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

Returns the node at position i.

Implements ogdf::LevelBase.

Definition at line 83 of file Level.h.

◆ operator[]() [2/2]

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

Returns the node at position i.

Implements ogdf::LevelBase.

Definition at line 86 of file Level.h.

◆ recalcPos()

void ogdf::Level::recalcPos ( )

◆ setIsolatedNodes()

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

◆ size()

int ogdf::Level::size ( ) const
inlineoverridevirtual

Returns the number of nodes on this level.

Implements ogdf::LevelBase.

Definition at line 89 of file Level.h.

◆ sort() [1/2]

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

Sorts the nodes according to weight using quicksort.

◆ sort() [2/2]

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

Sorts the nodes according to weight using bucket sort.

◆ sortByWeightOnly()

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

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

◆ sortOrder()

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

Sorts the nodes according to orderComparer.

Definition at line 117 of file Level.h.

◆ swap()

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

Exchanges nodes at position i and j.

Friends And Related Symbol Documentation

◆ HierarchyLayoutModule

Definition at line 62 of file Level.h.

◆ HierarchyLevels

Definition at line 61 of file Level.h.

◆ LayerBasedUPRLayout

Definition at line 63 of file Level.h.

◆ operator<<

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

Definition at line 124 of file Level.h.

Member Data Documentation

◆ m_index

int ogdf::Level::m_index
private

The index of this level.

Definition at line 67 of file Level.h.

◆ m_nodes

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

The nodes on this level.

Definition at line 65 of file Level.h.

◆ m_pLevels

HierarchyLevels* ogdf::Level::m_pLevels
private

The hierarchy to which this level belongs.

Definition at line 66 of file Level.h.


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