Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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.
 
 ~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 IPointgridBoundingBox () 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< CrossingMinimizationModulem_crossMin
 The module for computing a planar subgraph.
 
int m_nCrossings
 The number of crossings in the computed layout.
 
std::unique_ptr< CCLayoutPackModulem_packer
 The module for arranging connected components.
 
double m_pageRatio
 The desired page ratio.
 
std::unique_ptr< GridLayoutPlanRepModulem_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.
 

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 92 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 97 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 152 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 110 of file PlanarizationGridLayout.h.

◆ pageRatio() [2/2]

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

Sets the option pageRatio to ratio.

Definition at line 113 of file PlanarizationGridLayout.h.

◆ setCrossMin()

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

Sets the module option for crossing minimization.

Definition at line 121 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 144 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 133 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 162 of file PlanarizationGridLayout.h.

◆ m_nCrossings

int ogdf::PlanarizationGridLayout::m_nCrossings
private

The number of crossings in the computed layout.

Definition at line 172 of file PlanarizationGridLayout.h.

◆ m_packer

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

The module for arranging connected components.

Definition at line 168 of file PlanarizationGridLayout.h.

◆ m_pageRatio

double ogdf::PlanarizationGridLayout::m_pageRatio
private

The desired page ratio.

Definition at line 170 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 165 of file PlanarizationGridLayout.h.


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