Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::PlanarizationGridLayout Class Reference

The planarization grid layout algorithm. More...

#include <ogdf/planarity/PlanarizationGridLayout.h>

+ Inheritance diagram for ogdf::PlanarizationGridLayout:

Public Member Functions

 PlanarizationGridLayout ()
 Creates an instance of planarization layout and sets options to default values. More...
 
 ~PlanarizationGridLayout ()
 
Optional parameters
double pageRatio () const
 Returns the current setting of option pageRatio. More...
 
void pageRatio (double ratio)
 Sets the option pageRatio to ratio. More...
 
Module options
void setCrossMin (CrossingMinimizationModule *pCrossMin)
 Sets the module option for crossing minimization. More...
 
void setPlanarLayouter (GridLayoutPlanRepModule *pPlanarLayouter)
 Sets the module option for the planar grid layout algorithm. More...
 
void setPacker (CCLayoutPackModule *pPacker)
 Sets the module option for the arrangement of connected components. More...
 
Further information
int numberOfCrossings () const
 Returns the number of crossings in computed layout. 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 IPointgridBoundingBox () 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 (const Graph &G, GridLayout &gridLayout, IPoint &boundingBox) override
 Implements the algorithm call. More...
 

Private Attributes

std::unique_ptr< CrossingMinimizationModulem_crossMin
 The module for computing a planar subgraph. More...
 
int m_nCrossings
 The number of crossings in the computed layout. More...
 
std::unique_ptr< CCLayoutPackModulem_packer
 The module for arranging connected components. More...
 
double m_pageRatio
 The desired page ratio. More...
 
std::unique_ptr< GridLayoutPlanRepModulem_planarLayouter
 The module for computing a planar grid layout. More...
 

Additional Inherited Members

- Protected Attributes inherited from ogdf::GridLayoutModule
IPoint m_gridBoundingBox
 The computed bounding box of the grid layout. More...
 

Detailed Description

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.

Optional parameters

OptionTypeDefaultDescription
pageRatiodouble1.0 Specifies the desired ration of width / height of the computed layout. It is currently only used when packing connected components.

Module options

The various phases of the algorithm can be exchanged by setting module options allowing flexible customization. The algorithm provides the following module options:

OptionTypeDefaultDescription
crossMinCrossingMinimizationModuleSubgraphPlanarizer The module used for the crossing minimization step.
planarLayouterGridLayoutPlanRepModuleMixedModelLayout The planar layout algorithm used to compute a planar layout of the planarized representation resulting from the crossing minimization step.
packerCCLayoutPackModuleTileToRowsCCPacker The packer module used for arranging connected components.

Definition at line 96 of file PlanarizationGridLayout.h.

Constructor & Destructor Documentation

◆ PlanarizationGridLayout()

ogdf::PlanarizationGridLayout::PlanarizationGridLayout ( )

Creates an instance of planarization layout and sets options to default values.

◆ ~PlanarizationGridLayout()

ogdf::PlanarizationGridLayout::~PlanarizationGridLayout ( )
inline

Definition at line 101 of file PlanarizationGridLayout.h.

Member Function Documentation

◆ doCall()

virtual void ogdf::PlanarizationGridLayout::doCall ( const Graph G,
GridLayout gridLayout,
IPoint boundingBox 
)
overrideprotectedvirtual

Implements the algorithm call.

A derived algorithm must implement this method and return the computed grid layout in gridLayout.

Parameters
Gis the input graph.
gridLayoutis assigned the computed grid layout.
boundingBoxreturns 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.

◆ numberOfCrossings()

int ogdf::PlanarizationGridLayout::numberOfCrossings ( ) const
inline

Returns the number of crossings in computed layout.

Definition at line 156 of file PlanarizationGridLayout.h.

◆ pageRatio() [1/2]

double ogdf::PlanarizationGridLayout::pageRatio ( ) const
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 114 of file PlanarizationGridLayout.h.

◆ pageRatio() [2/2]

void ogdf::PlanarizationGridLayout::pageRatio ( double  ratio)
inline

Sets the option pageRatio to ratio.

Definition at line 117 of file PlanarizationGridLayout.h.

◆ setCrossMin()

void ogdf::PlanarizationGridLayout::setCrossMin ( CrossingMinimizationModule pCrossMin)
inline

Sets the module option for crossing minimization.

Definition at line 125 of file PlanarizationGridLayout.h.

◆ setPacker()

void ogdf::PlanarizationGridLayout::setPacker ( CCLayoutPackModule pPacker)
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 148 of file PlanarizationGridLayout.h.

◆ setPlanarLayouter()

void ogdf::PlanarizationGridLayout::setPlanarLayouter ( GridLayoutPlanRepModule pPlanarLayouter)
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 137 of file PlanarizationGridLayout.h.

Member Data Documentation

◆ m_crossMin

std::unique_ptr<CrossingMinimizationModule> ogdf::PlanarizationGridLayout::m_crossMin
private

The module for computing a planar subgraph.

Definition at line 166 of file PlanarizationGridLayout.h.

◆ m_nCrossings

int ogdf::PlanarizationGridLayout::m_nCrossings
private

The number of crossings in the computed layout.

Definition at line 176 of file PlanarizationGridLayout.h.

◆ m_packer

std::unique_ptr<CCLayoutPackModule> ogdf::PlanarizationGridLayout::m_packer
private

The module for arranging connected components.

Definition at line 172 of file PlanarizationGridLayout.h.

◆ m_pageRatio

double ogdf::PlanarizationGridLayout::m_pageRatio
private

The desired page ratio.

Definition at line 174 of file PlanarizationGridLayout.h.

◆ m_planarLayouter

std::unique_ptr<GridLayoutPlanRepModule> ogdf::PlanarizationGridLayout::m_planarLayouter
private

The module for computing a planar grid layout.

Definition at line 169 of file PlanarizationGridLayout.h.


The documentation for this class was generated from the following file: