The LP-based hierarchy layout algorithm. More...
#include <ogdf/layered/OptimalHierarchyLayout.h>
Inheritance diagram for ogdf::OptimalHierarchyLayout:Public Member Functions | |
| OptimalHierarchyLayout () | |
| Creates an instance of optimal hierarchy layout. | |
| OptimalHierarchyLayout (const OptimalHierarchyLayout &) | |
| Copy constructor. | |
| ~OptimalHierarchyLayout () | |
| OptimalHierarchyLayout & | operator= (const OptimalHierarchyLayout &) |
| Assignment operator. | |
Optional parameters | |
| double | nodeDistance () const |
| Returns the minimal allowed x-distance between nodes on a layer. | |
| void | nodeDistance (double x) |
Sets the minimal allowed x-distance between nodes on a layer to x. | |
| double | layerDistance () const |
| Returns the minimal allowed y-distance between layers. | |
| void | layerDistance (double x) |
Sets the minimal allowed y-distance between layers to x. | |
| bool | fixedLayerDistance () const |
| Returns the current setting of option fixedLayerDistance. | |
| void | fixedLayerDistance (bool b) |
Sets the option fixedLayerDistance to b. | |
| double | weightSegments () const |
| Returns the weight of edge segments connecting to vertical segments. | |
| void | weightSegments (double w) |
Sets the weight of edge segments connecting to vertical segments to w. | |
| double | weightBalancing () const |
| Returns the weight for balancing successors below a node; 0.0 means no balancing. | |
| void | weightBalancing (double w) |
Sets the weight for balancing successors below a node to w; 0.0 means no balancing. | |
Public Member Functions inherited from ogdf::HierarchyLayoutModule | |
| HierarchyLayoutModule () | |
| Initializes a hierarchy layout module. | |
| virtual | ~HierarchyLayoutModule () |
| void | call (const HierarchyLevelsBase &levels, GraphAttributes &GA) |
Computes a hierarchy layout of levels in GA. | |
Protected Member Functions | |
| virtual void | doCall (const HierarchyLevelsBase &levels, GraphAttributes &AGC) override |
| Implements the algorithm call. | |
Private Member Functions | |
| void | computeXCoordinates (const HierarchyLevelsBase &levels, GraphAttributes &AGC) |
| void | computeYCoordinates (const HierarchyLevelsBase &levels, GraphAttributes &AGC) |
Private Attributes | |
| bool | m_fixedLayerDistance |
| Use fixed layer distances? | |
| double | m_layerDistance |
| The minimal distance between layers. | |
| double | m_nodeDistance |
| The minimal distance between nodes. | |
| double | m_weightBalancing |
| The weight for balancing. | |
| double | m_weightSegments |
| The weight of edge segments. | |
Additional Inherited Members | |
Static Public Member Functions inherited from ogdf::HierarchyLayoutModule | |
| static void | dynLayerDistance (GraphAttributes &AGC, HierarchyLevelsBase &levels) |
Static Protected Member Functions inherited from ogdf::HierarchyLayoutModule | |
| static double | getHeight (const GraphAttributes &GA, const HierarchyLevelsBase &levels, node v) |
Returns the GA height of node v or 0 if it is a dummy node in the hierarchy of levels. | |
| static double | getWidth (const GraphAttributes &GA, const HierarchyLevelsBase &levels, node v) |
Returns the GA width of node v or 0 if it is a dummy node in the hierarchy of levels. | |
The LP-based hierarchy layout algorithm.
OptimalHierarchyLayout implements a hierarchy layout algorithm that is based on an LP-formulation. It is only available if OGDF is compiled with LP-solver support (e.g., Coin).
The used model avoids Spaghetti-effect like routing of edges by using long vertical segments as in FastHierarchyLayout. An additional balancing can be used which balances the successors below a node.
| Option | Type | Default | Description |
|---|---|---|---|
| nodeDistance | double | 3.0 | The minimal allowed x-distance between nodes on a layer. |
| layerDistance | double | 3.0 | The minimal allowed y-distance between layers. |
| fixedLayerDistance | bool | false | If set to true, the distance between neighboured layers is always layerDistance; otherwise the distance is adjusted (increased) to improve readability. |
| weightSegments | double | 2.0 | The weight of edge segments connecting to vertical segments. |
| weightBalancing | double | 0.1 | The weight for balancing successors below a node; 0.0 means no balancing. |
Definition at line 76 of file OptimalHierarchyLayout.h.
| ogdf::OptimalHierarchyLayout::OptimalHierarchyLayout | ( | ) |
Creates an instance of optimal hierarchy layout.
| ogdf::OptimalHierarchyLayout::OptimalHierarchyLayout | ( | const OptimalHierarchyLayout & | ) |
Copy constructor.
|
inline |
Definition at line 85 of file OptimalHierarchyLayout.h.
|
private |
|
private |
|
overrideprotectedvirtual |
Implements the algorithm call.
Implements ogdf::HierarchyLayoutModule.
|
inline |
Returns the current setting of option fixedLayerDistance.
If set to true, the distance is always layerDistance; otherwise the distance is adjusted (increased) to improve readability.
Definition at line 120 of file OptimalHierarchyLayout.h.
Sets the option fixedLayerDistance to b.
Definition at line 123 of file OptimalHierarchyLayout.h.
|
inline |
Returns the minimal allowed y-distance between layers.
Definition at line 106 of file OptimalHierarchyLayout.h.
Sets the minimal allowed y-distance between layers to x.
Definition at line 109 of file OptimalHierarchyLayout.h.
|
inline |
Returns the minimal allowed x-distance between nodes on a layer.
Definition at line 96 of file OptimalHierarchyLayout.h.
Sets the minimal allowed x-distance between nodes on a layer to x.
Definition at line 99 of file OptimalHierarchyLayout.h.
| OptimalHierarchyLayout & ogdf::OptimalHierarchyLayout::operator= | ( | const OptimalHierarchyLayout & | ) |
Assignment operator.
|
inline |
Returns the weight for balancing successors below a node; 0.0 means no balancing.
Definition at line 136 of file OptimalHierarchyLayout.h.
Sets the weight for balancing successors below a node to w; 0.0 means no balancing.
Definition at line 139 of file OptimalHierarchyLayout.h.
|
inline |
Returns the weight of edge segments connecting to vertical segments.
Definition at line 126 of file OptimalHierarchyLayout.h.
Sets the weight of edge segments connecting to vertical segments to w.
Definition at line 129 of file OptimalHierarchyLayout.h.
|
private |
Use fixed layer distances?
Definition at line 158 of file OptimalHierarchyLayout.h.
|
private |
The minimal distance between layers.
Definition at line 157 of file OptimalHierarchyLayout.h.
|
private |
The minimal distance between nodes.
Definition at line 156 of file OptimalHierarchyLayout.h.
|
private |
The weight for balancing.
Definition at line 161 of file OptimalHierarchyLayout.h.
|
private |
The weight of edge segments.
Definition at line 160 of file OptimalHierarchyLayout.h.