Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::Layout Class Reference

Stores a layout of a graph (coordinates of nodes, bend points of edges). More...

#include <ogdf/basic/Layout.h>

Public Member Functions

 Layout ()
 Creates a layout associated with no graph. More...
 
 Layout (const Graph &G)
 Creates a layout associated with graph G. More...
 
const NodeArray< double > & x () const
 Returns a reference to the array storing x-coordinates of nodes. More...
 
NodeArray< double > & x ()
 Returns a reference to the array storing x-coordinates of nodes. More...
 
const NodeArray< double > & y () const
 Returns a reference to the array storing y-coordinates of nodes. More...
 
NodeArray< double > & y ()
 Returns a reference to the array storing y-coordinates of nodes. More...
 
const double & x (node v) const
 Returns the x-coordinate of node v. More...
 
double & x (node v)
 Returns the x-coordinate of node v. More...
 
const double & y (node v) const
 Returns the y-coordinate of node v. More...
 
double & y (node v)
 Returns the y-coordinate of node v. More...
 
const DPolylinebends (edge e) const
 Returns the bend point list of edge e. More...
 
DPolylinebends (edge e)
 Returns the bend point list of edge e. More...
 
void computePolyline (GraphCopy &GC, edge eOrig, DPolyline &dpl) const
 Returns the polyline of edge eOrig in dpl. More...
 
void computePolylineClear (PlanRep &PG, edge eOrig, DPolyline &dpl)
 Returns the polyline of edge eOrig in dpl and clears the bend points of the copies. More...
 
DPoint computeBoundingBox (PlanRep &PG) const
 Computes the bounding box of the layout, which is a drawing of PG. More...
 

Private Attributes

EdgeArray< DPolylinem_bends
 The bend points of edges. More...
 
NodeArray< double > m_x
 The x-coordinates of nodes. More...
 
NodeArray< double > m_y
 The y-coordinates of nodes. More...
 

Detailed Description

Stores a layout of a graph (coordinates of nodes, bend points of edges).

Definition at line 46 of file Layout.h.

Constructor & Destructor Documentation

◆ Layout() [1/2]

ogdf::Layout::Layout ( )
inline

Creates a layout associated with no graph.

Definition at line 52 of file Layout.h.

◆ Layout() [2/2]

ogdf::Layout::Layout ( const Graph G)
inlineexplicit

Creates a layout associated with graph G.

The layout is initialized such that all node positions are (0,0) and all bend point lists of edges are empty.

Parameters
Gis the corresponding graph .

Definition at line 62 of file Layout.h.

Member Function Documentation

◆ bends() [1/2]

DPolyline& ogdf::Layout::bends ( edge  e)
inline

Returns the bend point list of edge e.

Definition at line 114 of file Layout.h.

◆ bends() [2/2]

const DPolyline& ogdf::Layout::bends ( edge  e) const
inline

Returns the bend point list of edge e.

Definition at line 109 of file Layout.h.

◆ computeBoundingBox()

DPoint ogdf::Layout::computeBoundingBox ( PlanRep PG) const

Computes the bounding box of the layout, which is a drawing of PG.

Parameters
PGmust be the planarized representation associated with this layout.
Returns
a point representing the with and height of this layout, respecting the sizes of nodes as stored in PG.

◆ computePolyline()

void ogdf::Layout::computePolyline ( GraphCopy GC,
edge  eOrig,
DPolyline dpl 
) const

Returns the polyline of edge eOrig in dpl.

Parameters
GCis the input graph copy; GC must also be the associated graph.
eOrigis an edge in the original graph of GC.
dplis assigned the poyline of eOrig.

◆ computePolylineClear()

void ogdf::Layout::computePolylineClear ( PlanRep PG,
edge  eOrig,
DPolyline dpl 
)

Returns the polyline of edge eOrig in dpl and clears the bend points of the copies.

The bend point lists of all edges in the edge path corresponding to eOrig are empty afterwards! This is a faster version of computePolyline().

Parameters
PGis the input graph copy; PG must also be the associated graph. of this layout.
eOrigis an edge in the original graph of PG.
dplis assigned the poyline of eOrig.

◆ x() [1/4]

NodeArray<double>& ogdf::Layout::x ( )
inline

Returns a reference to the array storing x-coordinates of nodes.

Definition at line 73 of file Layout.h.

◆ x() [2/4]

const NodeArray<double>& ogdf::Layout::x ( ) const
inline

Returns a reference to the array storing x-coordinates of nodes.

Definition at line 68 of file Layout.h.

◆ x() [3/4]

double& ogdf::Layout::x ( node  v)
inline

Returns the x-coordinate of node v.

Definition at line 94 of file Layout.h.

◆ x() [4/4]

const double& ogdf::Layout::x ( node  v) const
inline

Returns the x-coordinate of node v.

Definition at line 89 of file Layout.h.

◆ y() [1/4]

NodeArray<double>& ogdf::Layout::y ( )
inline

Returns a reference to the array storing y-coordinates of nodes.

Definition at line 83 of file Layout.h.

◆ y() [2/4]

const NodeArray<double>& ogdf::Layout::y ( ) const
inline

Returns a reference to the array storing y-coordinates of nodes.

Definition at line 78 of file Layout.h.

◆ y() [3/4]

double& ogdf::Layout::y ( node  v)
inline

Returns the y-coordinate of node v.

Definition at line 104 of file Layout.h.

◆ y() [4/4]

const double& ogdf::Layout::y ( node  v) const
inline

Returns the y-coordinate of node v.

Definition at line 99 of file Layout.h.

Member Data Documentation

◆ m_bends

EdgeArray<DPolyline> ogdf::Layout::m_bends
private

The bend points of edges.

Definition at line 153 of file Layout.h.

◆ m_x

NodeArray<double> ogdf::Layout::m_x
private

The x-coordinates of nodes.

Definition at line 151 of file Layout.h.

◆ m_y

NodeArray<double> ogdf::Layout::m_y
private

The y-coordinates of nodes.

Definition at line 152 of file Layout.h.


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