Representation of a graph's grid layout. More...
#include <ogdf/basic/GridLayout.h>
Inheritance diagram for ogdf::GridLayout:Public Member Functions | |
| GridLayout () | |
| Creates an instance of a grid layout (associated with no graph). | |
| GridLayout (const Graph &G) | |
Creates an instance of a grid layout associated with G. | |
| virtual | ~GridLayout () |
| Destruction. | |
| EdgeArray< IPolyline > & | bends () |
| Returns a reference to the array storing the bend points of edges. | |
| const EdgeArray< IPolyline > & | bends () const |
| Returns a reference to the array storing the bend points of edges. | |
| IPolyline & | bends (edge e) |
Returns a reference to the bend point list of edge e. | |
| const IPolyline & | bends (edge e) const |
Returns a reference to the bend point list of edge e. | |
| bool | checkLayout () |
| Checks if the grid layout is reasonable. | |
| void | compactAllBends () |
| Removes all unnecessary bends. | |
| void | computeBoundingBox (int &xmin, int &xmax, int &ymin, int &ymax) |
| Computes the bounding box of the grid layout. | |
| IPolyline | getCompactBends (edge e) const |
Returns the bend point list of edge e without unnecessary bends. | |
| void | init () |
| Initializes the grid layout for no graph (frees memory). | |
| void | init (const Graph &G) |
Initializes the grid layout for graph G. | |
| int | manhattanEdgeLength (edge e) const |
| int | maxManhattanEdgeLength () const |
| int | numberOfBends () const |
| Computes the total number of bends in the grid layout. | |
| IPolyline | polyline (edge e) const |
Returns the polyline of edge e (including start and end point!). | |
| virtual void | remap (Layout &drawing) |
| Transforms the grid layout to a layout. | |
| double | totalEdgeLength () const |
| Computes the total (euclidean) edge length of the grid layout. | |
| int | totalManhattanEdgeLength () const |
| Computes the total manhattan edge length of the grid layout. | |
| NodeArray< int > & | x () |
| Returns a reference to the array storing the x-coordinates of nodes. | |
| const NodeArray< int > & | x () const |
| Returns a reference to the array storing the x-coordinates of nodes. | |
| int & | x (node v) |
Returns a reference to the x-coordinate of node v. | |
| const int & | x (node v) const |
Returns a reference to the x-coordinate of node v. | |
| NodeArray< int > & | y () |
| Returns a reference to the array storing the y-coordinates of nodes. | |
| const NodeArray< int > & | y () const |
| Returns a reference to the array storing the y-coordinates of nodes. | |
| int & | y (node v) |
Returns a reference to the y-coordinate of node v. | |
| const int & | y (node v) const |
Returns a reference to the y-coordinate of node v. | |
Static Public Member Functions | |
| static double | euclideanDistance (const IPoint &ip1, const IPoint &ip2) |
| static int | manhattanDistance (const IPoint &ip1, const IPoint &ip2) |
Protected Attributes | |
| EdgeArray< IPolyline > | m_bends |
| The bend points of edges. | |
| NodeArray< int > | m_x |
| The x-coordinates of nodes. | |
| NodeArray< int > | m_y |
| The y-coordinates of nodes. | |
Static Private Member Functions | |
| static void | compact (IPolyline &ip) |
| static bool | isRedundant (IPoint &p1, IPoint &p2, IPoint &p3) |
Representation of a graph's grid layout.
Definition at line 47 of file GridLayout.h.
|
inline |
Creates an instance of a grid layout (associated with no graph).
Definition at line 50 of file GridLayout.h.
|
inlineexplicit |
Creates an instance of a grid layout associated with G.
Definition at line 53 of file GridLayout.h.
|
inlinevirtual |
Destruction.
Definition at line 56 of file GridLayout.h.
Returns a reference to the array storing the bend points of edges.
Definition at line 74 of file GridLayout.h.
Returns a reference to the array storing the bend points of edges.
Definition at line 71 of file GridLayout.h.
Returns a reference to the bend point list of edge e.
Definition at line 92 of file GridLayout.h.
Returns a reference to the bend point list of edge e.
Definition at line 89 of file GridLayout.h.
| bool ogdf::GridLayout::checkLayout | ( | ) |
Checks if the grid layout is reasonable.
In particular, the following checks are performed:
|
staticprivate |
| void ogdf::GridLayout::compactAllBends | ( | ) |
Removes all unnecessary bends.
| void ogdf::GridLayout::computeBoundingBox | ( | int & | xmin, |
| int & | xmax, | ||
| int & | ymin, | ||
| int & | ymax | ||
| ) |
Computes the bounding box of the grid layout.
The returned bounding box is (0,0,0,0) if the associated graph is empty or no graph is associated with the grid layout.
| xmin | is assigned the minimum x-coordinate in the grid layout. |
| xmax | is assigned the maximum x-coordinate in the grid layout. |
| ymin | is assigned the minimum y-coordinate in the grid layout. |
| ymax | is assigned the maximum y-coordinate in the grid layout. |
Returns the bend point list of edge e without unnecessary bends.
|
inline |
Initializes the grid layout for no graph (frees memory).
Definition at line 105 of file GridLayout.h.
|
inline |
Initializes the grid layout for graph G.
Definition at line 98 of file GridLayout.h.
| int ogdf::GridLayout::manhattanEdgeLength | ( | edge | e | ) | const |
| int ogdf::GridLayout::maxManhattanEdgeLength | ( | ) | const |
| int ogdf::GridLayout::numberOfBends | ( | ) | const |
Computes the total number of bends in the grid layout.
Returns the polyline of edge e (including start and end point!).
|
virtual |
Transforms the grid layout to a layout.
This implementation only copies the grid coordinates to drawing; the derived class GridLayoutMapped performs the actual transformation of coordinates.
Reimplemented in ogdf::GridLayoutMapped.
| double ogdf::GridLayout::totalEdgeLength | ( | ) | const |
Computes the total (euclidean) edge length of the grid layout.
| int ogdf::GridLayout::totalManhattanEdgeLength | ( | ) | const |
Computes the total manhattan edge length of the grid layout.
|
inline |
Returns a reference to the array storing the x-coordinates of nodes.
Definition at line 62 of file GridLayout.h.
|
inline |
Returns a reference to the array storing the x-coordinates of nodes.
Definition at line 59 of file GridLayout.h.
|
inline |
Returns a reference to the x-coordinate of node v.
Definition at line 80 of file GridLayout.h.
|
inline |
Returns a reference to the x-coordinate of node v.
Definition at line 77 of file GridLayout.h.
|
inline |
Returns a reference to the array storing the y-coordinates of nodes.
Definition at line 68 of file GridLayout.h.
|
inline |
Returns a reference to the array storing the y-coordinates of nodes.
Definition at line 65 of file GridLayout.h.
|
inline |
Returns a reference to the y-coordinate of node v.
Definition at line 86 of file GridLayout.h.
|
inline |
Returns a reference to the y-coordinate of node v.
Definition at line 83 of file GridLayout.h.
The bend points of edges.
Definition at line 165 of file GridLayout.h.
|
protected |
The x-coordinates of nodes.
Definition at line 163 of file GridLayout.h.
|
protected |
The y-coordinates of nodes.
Definition at line 164 of file GridLayout.h.