Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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.
 
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)=0
 Implements the algorithm call.
 

Protected Attributes

IPoint m_gridBoundingBox
 The computed bounding box of the grid layout.
 

Private Member Functions

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

Private Attributes

double m_separation
 The minimum distance between nodes.
 

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.

Constructor & Destructor Documentation

◆ GridLayoutModule()

ogdf::GridLayoutModule::GridLayoutModule ( )
inline

Initializes a grid layout module.

Definition at line 59 of file GridLayoutModule.h.

◆ ~GridLayoutModule()

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

Definition at line 61 of file GridLayoutModule.h.

Member Function Documentation

◆ 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
GAis 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
Gis the input graph.
gridLayoutis 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
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.

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

◆ gridBoundingBox()

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

Definition at line 99 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 89 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 97 of file GridLayoutModule.h.

Friends And Related Symbol Documentation

◆ GridLayoutPlanRepModule

Definition at line 54 of file GridLayoutModule.h.

◆ PlanarGridLayoutModule

Definition at line 55 of file GridLayoutModule.h.

Member Data Documentation

◆ m_gridBoundingBox

IPoint ogdf::GridLayoutModule::m_gridBoundingBox
protected

The computed bounding box of the grid layout.

Definition at line 116 of file GridLayoutModule.h.

◆ m_separation

double ogdf::GridLayoutModule::m_separation
private

The minimum distance between nodes.

Definition at line 119 of file GridLayoutModule.h.


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