# OpenGraph DrawingFramework

v. 2022.02 (Dogwood)

ogdf::GridLayoutModule Class Referenceabstract

Base class for grid layout algorithms. More...

#include <ogdf/planarlayout/GridLayoutModule.h>

Inheritance diagram for ogdf::GridLayoutModule:

## Public Member Functions

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)=0
Implements the algorithm call. More...

## Protected Attributes

IPoint m_gridBoundingBox
The computed bounding box of the grid layout. More...

## Private Member Functions

void mapGridLayout (const Graph &G, GridLayout &gridLayout, GraphAttributes &AG)
Internal transformation of grid coordinates to real coordinates. More...

## Private Attributes

double m_separation
The minimum distance between nodes. More...

## Friends

class GridLayoutPlanRepModule

class PlanarGridLayoutModule

## Detailed Description

Base class for grid layout algorithms.

A grid layout algorithm computes a grid layout of a graph. Such a grid layout does not take real node sizes into account and places a node simply on a grid point; edges may be routed via bend points on grid points.

The class GridLayoutModule provides the infrastructure to transform a grid layout into a (usual) layout of a graph, turning a grid layout algorithm automatically into a LayoutModule.

Definition at line 53 of file GridLayoutModule.h.

## ◆ GridLayoutModule()

 ogdf::GridLayoutModule::GridLayoutModule ( )
inline

Initializes a grid layout module.

Definition at line 60 of file GridLayoutModule.h.

## ◆ ~GridLayoutModule()

 virtual ogdf::GridLayoutModule::~GridLayoutModule ( )
inlinevirtual

Definition at line 62 of file GridLayoutModule.h.

## ◆ call()

 virtual void ogdf::GridLayoutModule::call ( GraphAttributes & GA )
finaloverridevirtual

Calls the grid layout algorithm (general call).

This method implements the call function of the base class LayoutModule. A derived algorithm implements the call by implementing doCall().

Parameters
 GA is the input graph; the new layout is also stored in GA.

Implements ogdf::LayoutModule.

## ◆ callGrid()

 void ogdf::GridLayoutModule::callGrid ( const Graph & G, GridLayout & gridLayout )

Calls the grid layout algorithm (call for GridLayout).

A derived algorithm implements the call by implementing doCall().

Parameters
 G is the input graph. gridLayout is assigned the computed grid layout.

## ◆ doCall()

 virtual void ogdf::GridLayoutModule::doCall ( const Graph & G, GridLayout & gridLayout, IPoint & boundingBox )
protectedpure virtual

Implements the algorithm call.

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

Parameters
 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.

Implemented in ogdf::PlanarGridLayoutModule, and ogdf::PlanarizationGridLayout.

## ◆ gridBoundingBox()

 const IPoint& ogdf::GridLayoutModule::gridBoundingBox ( ) const
inline

Definition at line 101 of file GridLayoutModule.h.

## ◆ mapGridLayout()

 void ogdf::GridLayoutModule::mapGridLayout ( const Graph & G, GridLayout & gridLayout, GraphAttributes & AG )
private

Internal transformation of grid coordinates to real coordinates.

## ◆ separation() [1/2]

 double ogdf::GridLayoutModule::separation ( ) const
inline

Returns the current setting of the minimum distance between nodes.

This minimum distance is used for mapping grid coordinates to double coordinates as stored in GraphAttributes. This mapping occurs automatically when the grid layout algorithm is called with LayoutModule's call method.

Definition at line 91 of file GridLayoutModule.h.

## ◆ separation() [2/2]

 void ogdf::GridLayoutModule::separation ( double sep )
inline

Sets the minimum distance between nodes.

This minimum distance is used for mapping grid coordinates to double coordinates as stored in GraphAttributes. This mapping occurs automatically when the grid layout algorithm is called with LayoutModule's call method.

Definition at line 99 of file GridLayoutModule.h.

## ◆ GridLayoutPlanRepModule

 friend class GridLayoutPlanRepModule
friend

Definition at line 55 of file GridLayoutModule.h.

## ◆ PlanarGridLayoutModule

 friend class PlanarGridLayoutModule
friend

Definition at line 56 of file GridLayoutModule.h.

## ◆ m_gridBoundingBox

 IPoint ogdf::GridLayoutModule::m_gridBoundingBox
protected

The computed bounding box of the grid layout.

Definition at line 118 of file GridLayoutModule.h.

## ◆ m_separation

 double ogdf::GridLayoutModule::m_separation
private

The minimum distance between nodes.

Definition at line 121 of file GridLayoutModule.h.

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