Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::PlanarGridLayoutModule Class Referenceabstract

Base class for planar grid layout algorithms. More...

#include <ogdf/planarlayout/GridLayoutModule.h>

+ Inheritance diagram for ogdf::PlanarGridLayoutModule:

Public Member Functions

 PlanarGridLayoutModule ()
 Initializes a planar grid layout module.
 
virtual ~PlanarGridLayoutModule ()
 
void callFixEmbed (GraphAttributes &AG, adjEntry adjExternal=nullptr)
 Calls the grid layout algorithm with a fixed planar embedding (general call).
 
void callGridFixEmbed (const Graph &G, GridLayout &gridLayout, adjEntry adjExternal=nullptr)
 Calls the grid layout algorithm with a fixed planar embedding (call for GridLayout).
 
- 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, adjEntry adjExternal, GridLayout &gridLayout, IPoint &boundingBox, bool fixEmbedding)=0
 Implements the algorithm call.
 
virtual void doCall (const Graph &G, GridLayout &gridLayout, IPoint &boundingBox) override
 Implements the GridLayoutModule::doCall().
 
bool handleTrivial (const Graph &G, GridLayout &gridLayout, IPoint &boundingBox)
 Handles the special cases of graphs with less than 3 nodes.
 

Additional Inherited Members

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

Detailed Description

Base class for planar grid layout algorithms.

A planar grid layout algorithm is a grid layout algorithm that produces a crossing-free grid layout of a planar graph. It provides an additional call method for producing a planar layout with a predefined planar embedding.

Definition at line 133 of file GridLayoutModule.h.

Constructor & Destructor Documentation

◆ PlanarGridLayoutModule()

ogdf::PlanarGridLayoutModule::PlanarGridLayoutModule ( )
inline

Initializes a planar grid layout module.

Definition at line 136 of file GridLayoutModule.h.

◆ ~PlanarGridLayoutModule()

virtual ogdf::PlanarGridLayoutModule::~PlanarGridLayoutModule ( )
inlinevirtual

Definition at line 138 of file GridLayoutModule.h.

Member Function Documentation

◆ callFixEmbed()

void ogdf::PlanarGridLayoutModule::callFixEmbed ( GraphAttributes AG,
adjEntry  adjExternal = nullptr 
)

Calls the grid layout algorithm with a fixed planar embedding (general call).

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

Parameters
AGis the input graph; the new layout is also stored in AG.
adjExternalspecifies an adjacency entry on the external face, or is set to 0 if no particular external face shall be specified.

◆ callGridFixEmbed()

void ogdf::PlanarGridLayoutModule::callGridFixEmbed ( const Graph G,
GridLayout gridLayout,
adjEntry  adjExternal = nullptr 
)

Calls the grid layout algorithm with a fixed planar embedding (call for GridLayout).

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

Parameters
Gis the input graph.
gridLayoutis assigned the computed grid layout.
adjExternalspecifies an adjacency entry (of G) on the external face, or is set to 0 if no particular external face shall be specified.

◆ doCall() [1/2]

virtual void ogdf::PlanarGridLayoutModule::doCall ( const Graph G,
adjEntry  adjExternal,
GridLayout gridLayout,
IPoint boundingBox,
bool  fixEmbedding 
)
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.
adjExternalis an adjacency entry on the external face, or 0 if no external face is specified.
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.
fixEmbeddingdetermines if the input graph is embedded and that embedding has to be preserved (true), or if an embedding needs to be computed (false).

Implemented in ogdf::FPPLayout, ogdf::GridLayoutPlanRepModule, ogdf::PlanarDrawLayout, ogdf::PlanarStraightLayout, ogdf::SchnyderLayout, and ogdf::GridLayoutPlanRepModule.

◆ doCall() [2/2]

virtual void ogdf::PlanarGridLayoutModule::doCall ( const Graph G,
GridLayout gridLayout,
IPoint boundingBox 
)
inlineoverrideprotectedvirtual

Implements the GridLayoutModule::doCall().

Implements ogdf::GridLayoutModule.

Reimplemented in ogdf::GridLayoutPlanRepModule.

Definition at line 185 of file GridLayoutModule.h.

◆ handleTrivial()

bool ogdf::PlanarGridLayoutModule::handleTrivial ( const Graph G,
GridLayout gridLayout,
IPoint boundingBox 
)
protected

Handles the special cases of graphs with less than 3 nodes.

Returns
true iff the instance is handled

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