The planarization grid layout algorithm. More...
#include <ogdf/planarity/PlanarizationGridLayout.h>
Public Member Functions | |
PlanarizationGridLayout () | |
Creates an instance of planarization layout and sets options to default values. | |
~PlanarizationGridLayout () | |
Optional parameters | |
double | pageRatio () const |
Returns the current setting of option pageRatio. | |
void | pageRatio (double ratio) |
Sets the option pageRatio to ratio . | |
Module options | |
void | setCrossMin (CrossingMinimizationModule *pCrossMin) |
Sets the module option for crossing minimization. | |
void | setPlanarLayouter (GridLayoutPlanRepModule *pPlanarLayouter) |
Sets the module option for the planar grid layout algorithm. | |
void | setPacker (CCLayoutPackModule *pPacker) |
Sets the module option for the arrangement of connected components. | |
Further information | |
int | numberOfCrossings () const |
Returns the number of crossings in computed layout. | |
Public Member Functions inherited from ogdf::GridLayoutModule | |
GridLayoutModule () | |
Initializes a grid layout module. | |
virtual | ~GridLayoutModule () |
virtual void | call (GraphAttributes &GA) override final |
Calls the grid layout algorithm (general call). | |
void | callGrid (const Graph &G, GridLayout &gridLayout) |
Calls the grid layout algorithm (call for GridLayout). | |
const IPoint & | gridBoundingBox () const |
double | separation () const |
Returns the current setting of the minimum distance between nodes. | |
void | separation (double sep) |
Sets the minimum distance between nodes. | |
Public Member Functions inherited from ogdf::LayoutModule | |
LayoutModule () | |
Initializes a layout module. | |
virtual | ~LayoutModule () |
void | operator() (GraphAttributes &GA) |
Computes a layout of graph GA . | |
Protected Member Functions | |
virtual void | doCall (const Graph &G, GridLayout &gridLayout, IPoint &boundingBox) override |
Implements the algorithm call. | |
Private Attributes | |
std::unique_ptr< CrossingMinimizationModule > | m_crossMin |
The module for computing a planar subgraph. | |
int | m_nCrossings |
The number of crossings in the computed layout. | |
std::unique_ptr< CCLayoutPackModule > | m_packer |
The module for arranging connected components. | |
double | m_pageRatio |
The desired page ratio. | |
std::unique_ptr< GridLayoutPlanRepModule > | m_planarLayouter |
The module for computing a planar grid layout. | |
Additional Inherited Members | |
Protected Attributes inherited from ogdf::GridLayoutModule | |
IPoint | m_gridBoundingBox |
The computed bounding box of the grid layout. | |
The planarization grid layout algorithm.
The class PlanarizationGridLayout represents a customizable implementation of the planarization approach for drawing graphs. The class uses a planar grid layout algorithm as a subroutine and allows to generate a usual layout or a grid layout.
The implementation used in PlanarizationGridLayout is based on the following publication:
C. Gutwenger, P. Mutzel: An Experimental Study of Crossing Minimization Heuristics. 11th International Symposium on Graph Drawing 2003, Perugia (GD '03), LNCS 2912, pp. 13-24, 2004.
Option | Type | Default | Description |
---|---|---|---|
pageRatio | double | 1.0 | Specifies the desired ration of width / height of the computed layout. It is currently only used when packing connected components. |
The various phases of the algorithm can be exchanged by setting module options allowing flexible customization. The algorithm provides the following module options:
Option | Type | Default | Description |
---|---|---|---|
crossMin | CrossingMinimizationModule | SubgraphPlanarizer | The module used for the crossing minimization step. |
planarLayouter | GridLayoutPlanRepModule | MixedModelLayout | The planar layout algorithm used to compute a planar layout of the planarized representation resulting from the crossing minimization step. |
packer | CCLayoutPackModule | TileToRowsCCPacker | The packer module used for arranging connected components. |
Definition at line 92 of file PlanarizationGridLayout.h.
ogdf::PlanarizationGridLayout::PlanarizationGridLayout | ( | ) |
Creates an instance of planarization layout and sets options to default values.
|
inline |
Definition at line 97 of file PlanarizationGridLayout.h.
|
overrideprotectedvirtual |
Implements the algorithm call.
A derived algorithm must implement this method and return the computed grid layout in gridLayout
.
G | is the input graph. |
gridLayout | is assigned the computed grid layout. |
boundingBox | returns the bounding box of the grid layout. The lower left corner of the bounding box is always (0,0), thus this IPoint defines the upper right corner as well as the width and height of the grid layout. |
Implements ogdf::GridLayoutModule.
|
inline |
Returns the number of crossings in computed layout.
Definition at line 152 of file PlanarizationGridLayout.h.
|
inline |
Returns the current setting of option pageRatio.
This option specifies the desired ration width / height of the computed layout. It is currently only used for packing connected components.
Definition at line 110 of file PlanarizationGridLayout.h.
Sets the option pageRatio to ratio
.
Definition at line 113 of file PlanarizationGridLayout.h.
|
inline |
Sets the module option for crossing minimization.
Definition at line 121 of file PlanarizationGridLayout.h.
|
inline |
Sets the module option for the arrangement of connected components.
The planarization layout algorithm draws each connected component of the input graph seperately, and then arranges the resulting drawings using a packing algorithm.
Definition at line 144 of file PlanarizationGridLayout.h.
|
inline |
Sets the module option for the planar grid layout algorithm.
The planar layout algorithm is used to compute a planar layout of the planarized representation resulting from the crossing minimization step. Planarized representation means that edge crossings are replaced by dummy nodes of degree four, so the actual layout algorithm obtains a planar graph as input. By default, the planar layout algorithm produces an orthogonal drawing.
Definition at line 133 of file PlanarizationGridLayout.h.
|
private |
The module for computing a planar subgraph.
Definition at line 162 of file PlanarizationGridLayout.h.
|
private |
The number of crossings in the computed layout.
Definition at line 172 of file PlanarizationGridLayout.h.
|
private |
The module for arranging connected components.
Definition at line 168 of file PlanarizationGridLayout.h.
|
private |
The desired page ratio.
Definition at line 170 of file PlanarizationGridLayout.h.
|
private |
The module for computing a planar grid layout.
Definition at line 165 of file PlanarizationGridLayout.h.