#include <FastHierarchyLayout.h>

Public Member Functions | |
| FastHierarchyLayout () | |
| Creates an instance of fast hierarchy layout. | |
| FastHierarchyLayout (const FastHierarchyLayout &) | |
| Copy constructor. | |
| virtual | ~FastHierarchyLayout () |
| FastHierarchyLayout & | operator= (const FastHierarchyLayout &) |
| Assignment operator. | |
| double | nodeDistance () const |
| Returns the option node distance. | |
| void | nodeDistance (double x) |
| Sets the option node distance to x. | |
| double | layerDistance () const |
| Returns the option layer distance. | |
| void | layerDistance (double x) |
| Sets the option layer distance to x. | |
| bool | fixedLayerDistance () const |
| Returns the option fixed layer distance. | |
| void | fixedLayerDistance (bool b) |
| Sets the option fixed layer distance to b. | |
Protected Member Functions | |
| void | doCall (const Hierarchy &H, GraphCopyAttributes &AGC) |
| Implements the actual algorithm call. | |
Private Member Functions | |
| void | decrTo (double &, double) |
| void | incrTo (double &, double) |
| bool | sameLayer (int, int) const |
| bool | isFirst (int) const |
| bool | isLast (int) const |
| void | sortLongEdges (int, int, double *, bool &, double &, int *, bool *) |
| bool | placeSingleNode (int, int, int, double &, int) |
| void | placeNodes (int, int, int, int, int) |
| void | moveLongEdge (int, int, bool *) |
| void | straightenEdge (int, bool *) |
| void | findPlacement () |
Private Attributes | |
| int | n |
| The number of nodes including virtual nodes. | |
| int | m |
| The number edge sections. | |
| int | k |
| The number of layers. | |
| int * | layer |
| Stores for every node its layer. | |
| int * | first |
| Stores for every layer the index of the first node. | |
| List< int > * | adj [2] |
| The list of neighbors in previous / next layer. | |
| List< int > ** | longEdge |
| The nodes belonging to a long edge. | |
| double | m_minNodeDist |
| The minimal node distance on a layer. | |
| double | m_minLayerDist |
| The minimal distance between layers. | |
| double * | breadth |
| for every node : breadth[node] = width of the node. | |
| double * | height |
| for every layer : height[layer] = height of max{height of node on layer}. | |
| double * | y |
| for every layer : y coordinate of layer. | |
| double * | x |
| for every node : x coordinate of node. | |
| double * | totalB |
| double * | mDist |
| Similar to totalB, used for temporary storage. | |
| bool | m_fixedLayerDist |
| 0 if distance between layers should be variable, 1 otherwise. | |
| bool * | virt |
| for every node : virt[node] = 1 if node is virtual, 0 otherwise. | |
| cmpWithKey | _cmp |
| Needed for sorting lists parameterized with withKey. | |
This class implements a hierarchy layout algorithm, i.e., it layouts hierarchies with a given order of nodes on each layer. It is used as a third phase of the Sugiyama algorithm.
All edges of the layout will have at most two bends. Additionally, for each edge having exactly two bends, the segment between them is drawn vertically. This applies in particular to the long edges arising in the first phase of the Sugiyama algorithm.
The implementation is based on:
Christoph Buchheim, Michael Jünger, Sebastian Leipert: A Fast Layout Algorithm for k-Level Graphs. LNCS 1984 (Proc. Graph Drawing 2000), pp. 229-240, 2001.
| Option | Type | Default | Description |
|---|---|---|---|
| node distance | double | 3.0 | the minimal horizontal distance between two nodes on the same layer |
| layer distance | double | 3.0 | the minimal vertical distance between two nodes on neighbored layers |
| fixed layer distance | bool | false | if true, the distance between neighbored layers is fixed, otherwise variable |
Definition at line 224 of file FastHierarchyLayout.h.
| ogdf::FastHierarchyLayout::FastHierarchyLayout | ( | ) |
Creates an instance of fast hierarchy layout.
| ogdf::FastHierarchyLayout::FastHierarchyLayout | ( | const FastHierarchyLayout & | ) |
Copy constructor.
| virtual ogdf::FastHierarchyLayout::~FastHierarchyLayout | ( | ) | [virtual] |
| void ogdf::FastHierarchyLayout::doCall | ( | const Hierarchy & | H, | |
| GraphCopyAttributes & | AGC | |||
| ) | [protected, virtual] |
Implements the actual algorithm call.
Must be implemented by derived classes.
| H | is the input hierarchy. | |
| AGC | has to be assigned the hierarchy layout. |
Implements ogdf::HierarchyLayoutModule.
| FastHierarchyLayout& ogdf::FastHierarchyLayout::operator= | ( | const FastHierarchyLayout & | ) |
Assignment operator.
| double ogdf::FastHierarchyLayout::nodeDistance | ( | ) | const |
Returns the option node distance.
| void ogdf::FastHierarchyLayout::nodeDistance | ( | double | x | ) |
Sets the option node distance to x.
| double ogdf::FastHierarchyLayout::layerDistance | ( | ) | const |
Returns the option layer distance.
| void ogdf::FastHierarchyLayout::layerDistance | ( | double | x | ) |
Sets the option layer distance to x.
| bool ogdf::FastHierarchyLayout::fixedLayerDistance | ( | ) | const |
Returns the option fixed layer distance.
| void ogdf::FastHierarchyLayout::fixedLayerDistance | ( | bool | b | ) |
Sets the option fixed layer distance to b.
| void ogdf::FastHierarchyLayout::decrTo | ( | double & | , | |
| double | ||||
| ) | [private] |
| void ogdf::FastHierarchyLayout::incrTo | ( | double & | , | |
| double | ||||
| ) | [private] |
| bool ogdf::FastHierarchyLayout::sameLayer | ( | int | , | |
| int | ||||
| ) | const [private] |
| bool ogdf::FastHierarchyLayout::isFirst | ( | int | ) | const [private] |
| bool ogdf::FastHierarchyLayout::isLast | ( | int | ) | const [private] |
| void ogdf::FastHierarchyLayout::sortLongEdges | ( | int | , | |
| int | , | |||
| double * | , | |||
| bool & | , | |||
| double & | , | |||
| int * | , | |||
| bool * | ||||
| ) | [private] |
| bool ogdf::FastHierarchyLayout::placeSingleNode | ( | int | , | |
| int | , | |||
| int | , | |||
| double & | , | |||
| int | ||||
| ) | [private] |
| void ogdf::FastHierarchyLayout::placeNodes | ( | int | , | |
| int | , | |||
| int | , | |||
| int | , | |||
| int | ||||
| ) | [private] |
| void ogdf::FastHierarchyLayout::moveLongEdge | ( | int | , | |
| int | , | |||
| bool * | ||||
| ) | [private] |
| void ogdf::FastHierarchyLayout::straightenEdge | ( | int | , | |
| bool * | ||||
| ) | [private] |
| void ogdf::FastHierarchyLayout::findPlacement | ( | ) | [private] |
int ogdf::FastHierarchyLayout::n [private] |
int ogdf::FastHierarchyLayout::m [private] |
int ogdf::FastHierarchyLayout::k [private] |
int* ogdf::FastHierarchyLayout::layer [private] |
int* ogdf::FastHierarchyLayout::first [private] |
Stores for every layer the index of the first node.
Definition at line 270 of file FastHierarchyLayout.h.
List<int>* ogdf::FastHierarchyLayout::adj[2] [private] |
The list of neighbors in previous / next layer.
for every node : adj[0][node] list of neighbors in previous layer; for every node : adj[1][node] list of neighbors in next layer
Definition at line 284 of file FastHierarchyLayout.h.
List<int>** ogdf::FastHierarchyLayout::longEdge [private] |
The nodes belonging to a long edge.
for every node : longEdge[node] is a pointer to a list containing all nodes that belong to the same long edge as node.
Definition at line 292 of file FastHierarchyLayout.h.
double ogdf::FastHierarchyLayout::m_minNodeDist [private] |
double ogdf::FastHierarchyLayout::m_minLayerDist [private] |
double* ogdf::FastHierarchyLayout::breadth [private] |
for every node : breadth[node] = width of the node.
Definition at line 296 of file FastHierarchyLayout.h.
double* ogdf::FastHierarchyLayout::height [private] |
for every layer : height[layer] = height of max{height of node on layer}.
Definition at line 297 of file FastHierarchyLayout.h.
double* ogdf::FastHierarchyLayout::y [private] |
double* ogdf::FastHierarchyLayout::x [private] |
double* ogdf::FastHierarchyLayout::totalB [private] |
for every node : minimal possible distance between the center of a node and first[layer[node]].
Definition at line 304 of file FastHierarchyLayout.h.
double* ogdf::FastHierarchyLayout::mDist [private] |
Similar to totalB, used for temporary storage.
Definition at line 306 of file FastHierarchyLayout.h.
bool ogdf::FastHierarchyLayout::m_fixedLayerDist [private] |
0 if distance between layers should be variable, 1 otherwise.
Definition at line 308 of file FastHierarchyLayout.h.
bool* ogdf::FastHierarchyLayout::virt [private] |
for every node : virt[node] = 1 if node is virtual, 0 otherwise.
Definition at line 309 of file FastHierarchyLayout.h.
cmpWithKey ogdf::FastHierarchyLayout::_cmp [private] |
Needed for sorting lists parameterized with withKey.
Definition at line 311 of file FastHierarchyLayout.h.