76 const int &
x(
node v)
const {
return m_x[v]; }
78 int &
x(
node v) {
return m_x[v]; }
81 const int &
y(
node v)
const {
return m_y[v]; }
83 int &
y(
node v) {
return m_y[v]; }
113 void compactAllBends();
135 void computeBoundingBox(
int &xmin,
int &xmax,
int &ymin,
int &ymax);
138 int totalManhattanEdgeLength()
const;
140 int maxManhattanEdgeLength()
const;
141 int manhattanEdgeLength(
edge e)
const;
144 double totalEdgeLength()
const;
147 int numberOfBends()
const;
155 virtual void remap(
Layout &drawing);
157 static int manhattanDistance(
const IPoint &ip1,
const IPoint &ip2);
158 static double euclideanDistance(
const IPoint &ip1,
const IPoint &ip2);
Representation of a graph's grid layout.
const int & y(node v) const
Returns a reference to the y-coordinate of node v.
NodeArray< int > & x()
Returns a reference to the array storing the x-coordinates of nodes.
NodeArray< int > m_x
The x-coordinates of nodes.
Data type for general directed graphs (adjacency list representation).
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
const NodeArray< int > & y() const
Returns a reference to the array storing the y-coordinates of nodes.
NodeArray< int > m_y
The y-coordinates of nodes.
EdgeArray< IPolyline > m_bends
The bend points of edges.
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
GridLayout()
Creates an instance of a grid layout (associated with no graph).
EdgeArray< IPolyline > & bends()
Returns a reference to the array storing the bend points of edges.
const int & x(node v) const
Returns a reference to the x-coordinate of node v.
Dynamic arrays indexed with edges.
NodeArray< int > & y()
Returns a reference to the array storing the y-coordinates of nodes.
virtual ~GridLayout()
Destruction.
Declaration of class Layout.
int & x(node v)
Returns a reference to the x-coordinate of node v.
const EdgeArray< IPolyline > & bends() const
Returns a reference to the array storing the bend points of edges.
Declaration and implementation of EdgeArray class.
void init()
Initializes the grid layout for no graph (frees memory).
Class for the representation of edges.
void init(const Graph &G)
Initializes the grid layout for graph G.
Class for the representation of nodes.
Declaration and implementation of NodeArray class.
IPolyline & bends(edge e)
Returns a reference to the bend point list of edge e.
Polylines with PointType points.
int & y(node v)
Returns a reference to the y-coordinate of node v.
GridLayout(const Graph &G)
Creates an instance of a grid layout associated with G.
The namespace for all OGDF objects.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment, DPolygon, DRect, DIntersectableRect.
const IPolyline & bends(edge e) const
Returns a reference to the bend point list of edge e.
const NodeArray< int > & x() const
Returns a reference to the array storing the x-coordinates of nodes.
Stores a layout of a graph (coordinates of nodes, bend points of edges).