Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
Layout.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
35#include <ogdf/basic/basic.h>
36#include <ogdf/basic/geometry.h>
37#include <ogdf/basic/memory.h>
38
39namespace ogdf {
40
41class GraphCopy;
42class PlanRep;
43
50public:
54 Layout() { }
55
64 explicit Layout(const Graph& G) : m_x(G, 0), m_y(G, 0), m_bends(G) { }
65
69 const NodeArray<double>& x() const { return m_x; }
70
74 NodeArray<double>& x() { return m_x; }
75
79 const NodeArray<double>& y() const { return m_y; }
80
84 NodeArray<double>& y() { return m_y; }
85
89 const double& x(node v) const { return m_x[v]; }
90
94 double& x(node v) { return m_x[v]; }
95
99 const double& y(node v) const { return m_y[v]; }
100
104 double& y(node v) { return m_y[v]; }
105
109 const DPolyline& bends(edge e) const { return m_bends[e]; }
110
114 DPolyline& bends(edge e) { return m_bends[e]; }
115
123 void computePolyline(GraphCopy& GC, edge eOrig, DPolyline& dpl) const;
124
138
140
146
149private:
153
155};
156
157}
Includes declaration of graph class.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
Basic declarations, included by all source files.
Class for the representation of edges.
Definition Graph_d.h:364
Polylines with PointType points.
Definition geometry.h:261
Copies of graphs supporting edge splitting.
Definition GraphCopy.h:390
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Stores a layout of a graph (coordinates of nodes, bend points of edges).
Definition Layout.h:49
DPolyline & bends(edge e)
Returns the bend point list of edge e.
Definition Layout.h:114
const NodeArray< double > & y() const
Returns a reference to the array storing y-coordinates of nodes.
Definition Layout.h:79
EdgeArray< DPolyline > m_bends
The bend points of edges.
Definition Layout.h:152
const DPolyline & bends(edge e) const
Returns the bend point list of edge e.
Definition Layout.h:109
NodeArray< double > & x()
Returns a reference to the array storing x-coordinates of nodes.
Definition Layout.h:74
double & y(node v)
Returns the y-coordinate of node v.
Definition Layout.h:104
void computePolylineClear(PlanRep &PG, edge eOrig, DPolyline &dpl)
Returns the polyline of edge eOrig in dpl and clears the bend points of the copies.
Layout()
Creates a layout associated with no graph.
Definition Layout.h:54
NodeArray< double > m_y
The y-coordinates of nodes.
Definition Layout.h:151
NodeArray< double > m_x
The x-coordinates of nodes.
Definition Layout.h:150
double & x(node v)
Returns the x-coordinate of node v.
Definition Layout.h:94
void computePolyline(GraphCopy &GC, edge eOrig, DPolyline &dpl) const
Returns the polyline of edge eOrig in dpl.
Layout(const Graph &G)
Creates a layout associated with graph G.
Definition Layout.h:64
const double & x(node v) const
Returns the x-coordinate of node v.
Definition Layout.h:89
const double & y(node v) const
Returns the y-coordinate of node v.
Definition Layout.h:99
const NodeArray< double > & x() const
Returns a reference to the array storing x-coordinates of nodes.
Definition Layout.h:69
NodeArray< double > & y()
Returns a reference to the array storing y-coordinates of nodes.
Definition Layout.h:84
DPoint computeBoundingBox(PlanRep &PG) const
Computes the bounding box of the layout, which is a drawing of PG.
Class for the representation of nodes.
Definition Graph_d.h:241
Planarized representations (of a connected component) of a graph.
Definition PlanRep.h:68
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition Graph_d.h:717
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
Definition memory.h:92
Declaration of memory manager for allocating small pieces of memory.
The namespace for all OGDF objects.