Coordinate assignment phase for the Sugiyama algorithm by Buchheim et al.. More...
#include <ogdf/layered/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. | |
Coordinate assignment phase for the Sugiyama algorithm by Buchheim et al..
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 223 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::decrTo | ( | double & | , | |
| double | ||||
| ) | [private] |
| 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.
| void ogdf::FastHierarchyLayout::findPlacement | ( | ) | [private] |
| void ogdf::FastHierarchyLayout::fixedLayerDistance | ( | bool | b | ) |
Sets the option fixed layer distance to b.
| bool ogdf::FastHierarchyLayout::fixedLayerDistance | ( | ) | const |
Returns the option fixed layer distance.
| void ogdf::FastHierarchyLayout::incrTo | ( | double & | , | |
| double | ||||
| ) | [private] |
| bool ogdf::FastHierarchyLayout::isFirst | ( | int | ) | const [private] |
| bool ogdf::FastHierarchyLayout::isLast | ( | int | ) | const [private] |
| double ogdf::FastHierarchyLayout::layerDistance | ( | ) | const |
Returns the option layer distance.
| void ogdf::FastHierarchyLayout::layerDistance | ( | double | x | ) |
Sets the option layer distance to x.
| void ogdf::FastHierarchyLayout::moveLongEdge | ( | int | , | |
| int | , | |||
| bool * | ||||
| ) | [private] |
| void ogdf::FastHierarchyLayout::nodeDistance | ( | double | x | ) |
Sets the option node distance to x.
| double ogdf::FastHierarchyLayout::nodeDistance | ( | ) | const |
Returns the option node distance.
| FastHierarchyLayout& ogdf::FastHierarchyLayout::operator= | ( | const FastHierarchyLayout & | ) |
Assignment operator.
| void ogdf::FastHierarchyLayout::placeNodes | ( | int | , | |
| int | , | |||
| int | , | |||
| int | , | |||
| int | ||||
| ) | [private] |
| bool ogdf::FastHierarchyLayout::placeSingleNode | ( | int | , | |
| int | , | |||
| int | , | |||
| double & | , | |||
| int | ||||
| ) | [private] |
| bool ogdf::FastHierarchyLayout::sameLayer | ( | int | , | |
| int | ||||
| ) | const [private] |
| void ogdf::FastHierarchyLayout::sortLongEdges | ( | int | , | |
| int | , | |||
| double * | , | |||
| bool & | , | |||
| double & | , | |||
| int * | , | |||
| bool * | ||||
| ) | [private] |
| void ogdf::FastHierarchyLayout::straightenEdge | ( | int | , | |
| bool * | ||||
| ) | [private] |
cmpWithKey ogdf::FastHierarchyLayout::_cmp [private] |
Needed for sorting lists parameterized with withKey.
Definition at line 310 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 283 of file FastHierarchyLayout.h.
double* ogdf::FastHierarchyLayout::breadth [private] |
for every node : breadth[node] = width of the node.
Definition at line 295 of file FastHierarchyLayout.h.
int* ogdf::FastHierarchyLayout::first [private] |
Stores for every layer the index of the first node.
Definition at line 269 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 296 of file FastHierarchyLayout.h.
int ogdf::FastHierarchyLayout::k [private] |
The number of layers.
Definition at line 267 of file FastHierarchyLayout.h.
int* ogdf::FastHierarchyLayout::layer [private] |
Stores for every node its layer.
Definition at line 268 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 291 of file FastHierarchyLayout.h.
int ogdf::FastHierarchyLayout::m [private] |
The number edge sections.
Definition at line 266 of file FastHierarchyLayout.h.
bool ogdf::FastHierarchyLayout::m_fixedLayerDist [private] |
0 if distance between layers should be variable, 1 otherwise.
Definition at line 307 of file FastHierarchyLayout.h.
double ogdf::FastHierarchyLayout::m_minLayerDist [private] |
The minimal distance between layers.
Definition at line 294 of file FastHierarchyLayout.h.
double ogdf::FastHierarchyLayout::m_minNodeDist [private] |
The minimal node distance on a layer.
Definition at line 293 of file FastHierarchyLayout.h.
double* ogdf::FastHierarchyLayout::mDist [private] |
Similar to totalB, used for temporary storage.
Definition at line 305 of file FastHierarchyLayout.h.
int ogdf::FastHierarchyLayout::n [private] |
The number of nodes including virtual nodes.
Definition at line 265 of file FastHierarchyLayout.h.
double* ogdf::FastHierarchyLayout::totalB [private] |
for every node : minimal possible distance between the center of a node and first[layer[node]].
Definition at line 303 of file FastHierarchyLayout.h.
bool* ogdf::FastHierarchyLayout::virt [private] |
for every node : virt[node] = 1 if node is virtual, 0 otherwise.
Definition at line 308 of file FastHierarchyLayout.h.
double* ogdf::FastHierarchyLayout::x [private] |
for every node : x coordinate of node.
Definition at line 298 of file FastHierarchyLayout.h.
double* ogdf::FastHierarchyLayout::y [private] |
for every layer : y coordinate of layer.
Definition at line 297 of file FastHierarchyLayout.h.