Base class for grid layout algorithms. More...
#include <ogdf/planarlayout/GridLayoutModule.h>
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 IPoint & | gridBoundingBox () 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 |
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.
|
inline |
Initializes a grid layout module.
Definition at line 59 of file GridLayoutModule.h.
|
inlinevirtual |
Definition at line 61 of file GridLayoutModule.h.
|
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().
GA | is the input graph; the new layout is also stored in GA . |
Implements ogdf::LayoutModule.
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().
G | is the input graph. |
gridLayout | is assigned the computed grid layout. |
|
protectedpure virtual |
Implements the algorithm call.
A derived algorithm must implement this method and return the computed grid layout in gridLayout
.
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::PlanarizationGridLayout, ogdf::PlanarGridLayoutModule, and ogdf::GridLayoutPlanRepModule.
Definition at line 99 of file GridLayoutModule.h.
|
private |
Internal transformation of grid coordinates to real coordinates.
|
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.
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.
|
friend |
Definition at line 54 of file GridLayoutModule.h.
|
friend |
Definition at line 55 of file GridLayoutModule.h.
|
protected |
The computed bounding box of the grid layout.
Definition at line 116 of file GridLayoutModule.h.
|
private |
The minimum distance between nodes.
Definition at line 119 of file GridLayoutModule.h.