Implementation of the Mixed-Model layout algorithm. More...
#include <ogdf/planarlayout/MixedModelLayout.h>
Public Member Functions | |
MixedModelLayout () | |
Constructs an instance of the Mixed-Model layout algorithm. More... | |
virtual | ~MixedModelLayout () |
Module options | |
void | setAugmenter (AugmentationModule *pAugmenter) |
Sets the augmentation module. More... | |
void | setShellingOrder (ShellingOrderModule *pOrder) |
Sets the shelling order module. More... | |
void | setCrossingsBeautifier (MixedModelCrossingsBeautifierModule *pBeautifier) |
Sets the crossings beautifier module. More... | |
void | setEmbedder (EmbedderModule *pEmbedder) |
Sets the module option for the graph embedding algorithm. More... | |
Public Member Functions inherited from ogdf::GridLayoutPlanRepModule | |
GridLayoutPlanRepModule () | |
Initializes a plan-rep grid layout module. More... | |
virtual | ~GridLayoutPlanRepModule () |
void | callGrid (const Graph &G, GridLayout &gridLayout) |
Calls the grid layout algorithm (call for GridLayout). More... | |
void | callGrid (PlanRep &PG, GridLayout &gridLayout) |
Calls the grid layout algorithm (call for GridLayout of a PlanRep). More... | |
void | callGridFixEmbed (const Graph &G, GridLayout &gridLayout, adjEntry adjExternal=nullptr) |
Calls the grid layout algorithm with a fixed planar embedding (call for GridLayout). More... | |
void | callGridFixEmbed (PlanRep &PG, GridLayout &gridLayout, adjEntry adjExternal=nullptr) |
Calls the grid layout algorithm with a fixed planar embedding (call for GridLayout of a PlanRep). More... | |
Public Member Functions inherited from ogdf::PlanarGridLayoutModule | |
PlanarGridLayoutModule () | |
Initializes a planar grid layout module. More... | |
virtual | ~PlanarGridLayoutModule () |
void | callFixEmbed (GraphAttributes &AG, adjEntry adjExternal=nullptr) |
Calls the grid layout algorithm with a fixed planar embedding (general call). More... | |
void | callGridFixEmbed (const Graph &G, GridLayout &gridLayout, adjEntry adjExternal=nullptr) |
Calls the grid layout algorithm with a fixed planar embedding (call for GridLayout). More... | |
Public Member Functions inherited from ogdf::GridLayoutModule | |
GridLayoutModule () | |
Initializes a grid layout module. More... | |
virtual | ~GridLayoutModule () |
virtual void | call (GraphAttributes &GA) override final |
Calls the grid layout algorithm (general call). More... | |
void | callGrid (const Graph &G, GridLayout &gridLayout) |
Calls the grid layout algorithm (call for GridLayout). More... | |
const IPoint & | gridBoundingBox () const |
double | separation () const |
Returns the current setting of the minimum distance between nodes. More... | |
void | separation (double sep) |
Sets the minimum distance between nodes. More... | |
Public Member Functions inherited from ogdf::LayoutModule | |
LayoutModule () | |
Initializes a layout module. More... | |
virtual | ~LayoutModule () |
void | operator() (GraphAttributes &GA) |
Computes a layout of graph GA . More... | |
Protected Member Functions | |
virtual void | doCall (PlanRep &PG, adjEntry adjExternal, GridLayout &gridLayout, IPoint &boundingBox, bool fixEmbedding) override |
Implements the algorithm call. More... | |
Protected Member Functions inherited from ogdf::GridLayoutPlanRepModule | |
void | doCall (const Graph &G, adjEntry adjExternal, GridLayout &gridLayout, IPoint &boundingBox, bool fixEmbedding) override |
Implements PlanarGridLayoutModule::doCall(). More... | |
virtual void | doCall (const Graph &G, adjEntry adjExternal, GridLayout &gridLayout, IPoint &boundingBox, bool fixEmbedding)=0 |
Implements the algorithm call. More... | |
virtual void | doCall (const Graph &G, GridLayout &gridLayout, IPoint &boundingBox) override |
Implements the GridLayoutModule::doCall(). More... | |
Protected Member Functions inherited from ogdf::PlanarGridLayoutModule | |
virtual void | doCall (const Graph &G, GridLayout &gridLayout, IPoint &boundingBox) override |
Implements the GridLayoutModule::doCall(). More... | |
bool | handleTrivial (const Graph &G, GridLayout &gridLayout, IPoint &boundingBox) |
Handles the special cases of graphs with less than 3 nodes. More... | |
Private Attributes | |
std::unique_ptr< AugmentationModule > | m_augmenter |
The augmentation module. More... | |
std::unique_ptr< ShellingOrderModule > | m_compOrder |
The shelling order module. More... | |
std::unique_ptr< MixedModelCrossingsBeautifierModule > | m_crossingsBeautifier |
The crossings beautifier module. More... | |
std::unique_ptr< EmbedderModule > | m_embedder |
The planar embedder module. More... | |
Additional Inherited Members | |
Protected Attributes inherited from ogdf::GridLayoutModule | |
IPoint | m_gridBoundingBox |
The computed bounding box of the grid layout. More... | |
Implementation of the Mixed-Model layout algorithm.
The class MixedModelLayout represents the Mixed-Model layout algorithm by Gutwenger and Mutzel, which is based upon ideas by Kant. In particular, Kant's algorithm has been changed concerning the placement phase and the vertex boxes, and it has been generalized to work for connected planar graphs.
This algorithm draws a d-planar graph G on a grid such that every edge has at most three bends and the minimum angle between two edges is at least 2/d radians. G must not contain self-loops or multiple edges. The grid size is at most (2n-6) * (3/2n-7/2), the number of bends is at most 5n-15, and every edge has length O(n), where G has n nodes.
The algorithm runs in several phases. In the preprocessing phase, vertices with degree one are temporarily deleted and the graph is being augmented to a biconnected planar graph using a planar biconnectivity augmentation module. Then, a shelling order for biconnected plane graphs is computed. In the next step, boxes around each vertex are defined in such a way that the incident edges appear regularly along the box. Finally, the coordinates of the vertex boxes are computed taking the degree-one vertices into account.
The implementation used in MixedModelLayout is based on the following publication:
C. Gutwenger, P. Mutzel: Planar Polyline Drawings with Good Angular Resolution. 6th International Symposium on Graph Drawing 1998, Montreal (GD '98), LNCS 1547, pp. 167-182, 1998.
The input graph needs to be planar and simple (i.e., no self-loops and no multiple edges).
Instances of type MixedModelLayout provide the following module options:
Option | Type | Default | Description |
---|---|---|---|
augmenter | AugmentationModule | PlanarAugmentation | Augments the graph by adding edges to obtain a planar graph with a certain connectivity (e.g., biconnected or triconnected). |
embedder | EmbedderModule | SimpleEmbedder | Planar embedding algorithm applied after planar augmentation. |
shellingOrder | ShellingOrderModule | BiconnectedShellingOrder | The algorithm to compute a shelling order. The connectivity assured by the planar augmentation module has to be sufficient for the shelling order module! |
crossingsBeautifier | MixedModelCrossingsBeautifierModule | MMDummyCrossingsBeautifier | The crossing beautifier is applied as preprocessing to dummy nodes in the graph that actually represent crossings. Such nodes arise when using the mixed-model layout algorithm in the planarization approach (see PlanarizationGridLayout). By default, crossings might look weird, since they are not drawn as two crossing horizontal and vertical lines; the other available crossings beautifier correct this. |
The computation of the layout takes time O(n), where n is the number of nodes of the input graph.
Definition at line 118 of file MixedModelLayout.h.
ogdf::MixedModelLayout::MixedModelLayout | ( | ) |
Constructs an instance of the Mixed-Model layout algorithm.
|
inlinevirtual |
Definition at line 123 of file MixedModelLayout.h.
|
overrideprotectedvirtual |
Implements the algorithm call.
Implements ogdf::GridLayoutPlanRepModule.
|
inline |
Sets the augmentation module.
The augmentation module needs to make sure that the graph gets the connectivity required for calling the shelling order module.
Definition at line 136 of file MixedModelLayout.h.
|
inline |
Sets the crossings beautifier module.
Definition at line 142 of file MixedModelLayout.h.
|
inline |
Sets the module option for the graph embedding algorithm.
Definition at line 147 of file MixedModelLayout.h.
|
inline |
Sets the shelling order module.
Definition at line 139 of file MixedModelLayout.h.
|
private |
The augmentation module.
Definition at line 158 of file MixedModelLayout.h.
|
private |
The shelling order module.
Definition at line 159 of file MixedModelLayout.h.
|
private |
The crossings beautifier module.
Definition at line 160 of file MixedModelLayout.h.
|
private |
The planar embedder module.
Definition at line 157 of file MixedModelLayout.h.