Open
Graph Drawing
Framework

 v.2007.11
 

ogdf::GridLayout Class Reference

Representation of a graph's grid layout. More...

#include <GridLayout.h>

Inheritance diagram for ogdf::GridLayout:

ogdf::GridLayoutMapped

List of all members.

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 ()
const NodeArray< int > & x () const
 Returns a reference to the array storing the x-coordinates of nodes.
NodeArray< int > & x ()
 Returns a reference to the array storing the x-coordinates of nodes.
const NodeArray< int > & y () const
 Returns a reference to the array storing the y-coordinates of nodes.
NodeArray< int > & y ()
 Returns a reference to the array storing the y-coordinates of nodes.
const EdgeArray< IPolyline > & bends () const
 Returns a reference to the array storing the bend points of edges.
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.
int & x (node v)
 Returns a reference to the x-coordinate of node v.
const int & y (node v) const
 Returns a reference to the y-coordinate of node v.
int & y (node v)
 Returns a reference to the y-coordinate of node v.
const IPolylinebends (edge e) const
 Returns a reference to the bend point list of edge e.
IPolylinebends (edge e)
 Returns a reference to the bend point list of edge e.
IPolyline polyline (edge e) const
 Returns the polyline of edge e (including start and end point!).
void init (const Graph &G)
 Initializes the grid layout for graph G.
void init ()
 Initializes the grid layout for no graph (frees memory).
IPolyline getCompactBends (edge e) const
 Returns the bend point list of edge e without unnecessary bends.
void compactAllBends ()
 Removes all unnecessary bends.
bool checkLayout ()
 Checks if the grid layout is reasonable.
void computeBoundingBox (int &xmin, int &xmax, int &ymin, int &ymax)
 Computes the bounding box of the grid layout.
int totalManhattanEdgeLength () const
 Computes the total manhattan edge length of the grid layout.
double totalEdgeLength () const
 Computes the total (euclidean) edge length of the grid layout.
int numberOfBends () const
 Computes the total number of bends in the grid layout.
virtual void remap (Layout &drawing)
 Transforms the grid layout to a layout write grid layout to a layout.
void * operator new (size_t nBytes)
void * operator new (size_t, void *p)
void operator delete (void *p)

Static Public Member Functions

static int manhattanDistance (const IPoint &ip1, const IPoint &ip2)
static double euclideanDistance (const IPoint &ip1, const IPoint &ip2)

Protected Attributes

NodeArray< int > m_x
 The x-coordinates of nodes.
NodeArray< int > m_y
 The y-coordinates of nodes.
EdgeArray< IPolylinem_bends
 The bend points of edges.

Static Private Member Functions

static bool isRedundant (IPoint &p1, IPoint &p2, IPoint &p3)
static void compact (IPolyline &ip)


Detailed Description

Representation of a graph's grid layout.

Definition at line 72 of file GridLayout.h.


Constructor & Destructor Documentation

ogdf::GridLayout::GridLayout (  )  [inline]

Creates an instance of a grid layout (associated with no graph).

Definition at line 76 of file GridLayout.h.

ogdf::GridLayout::GridLayout ( const Graph G  )  [inline]

Creates an instance of a grid layout associated with G.

Definition at line 79 of file GridLayout.h.

virtual ogdf::GridLayout::~GridLayout (  )  [inline, virtual]

Definition at line 82 of file GridLayout.h.


Member Function Documentation

const NodeArray<int>& ogdf::GridLayout::x (  )  const [inline]

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

Definition at line 86 of file GridLayout.h.

NodeArray<int>& ogdf::GridLayout::x (  )  [inline]

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

Definition at line 88 of file GridLayout.h.

const NodeArray<int>& ogdf::GridLayout::y (  )  const [inline]

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

Definition at line 91 of file GridLayout.h.

NodeArray<int>& ogdf::GridLayout::y (  )  [inline]

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

Definition at line 93 of file GridLayout.h.

const EdgeArray<IPolyline>& ogdf::GridLayout::bends (  )  const [inline]

Returns a reference to the array storing the bend points of edges.

Definition at line 96 of file GridLayout.h.

EdgeArray<IPolyline>& ogdf::GridLayout::bends (  )  [inline]

Returns a reference to the array storing the bend points of edges.

Definition at line 98 of file GridLayout.h.

const int& ogdf::GridLayout::x ( node  v  )  const [inline]

Returns a reference to the x-coordinate of node v.

Definition at line 102 of file GridLayout.h.

int& ogdf::GridLayout::x ( node  v  )  [inline]

Returns a reference to the x-coordinate of node v.

Definition at line 104 of file GridLayout.h.

const int& ogdf::GridLayout::y ( node  v  )  const [inline]

Returns a reference to the y-coordinate of node v.

Definition at line 107 of file GridLayout.h.

int& ogdf::GridLayout::y ( node  v  )  [inline]

Returns a reference to the y-coordinate of node v.

Definition at line 109 of file GridLayout.h.

const IPolyline& ogdf::GridLayout::bends ( edge  e  )  const [inline]

Returns a reference to the bend point list of edge e.

Definition at line 113 of file GridLayout.h.

IPolyline& ogdf::GridLayout::bends ( edge  e  )  [inline]

Returns a reference to the bend point list of edge e.

Definition at line 115 of file GridLayout.h.

IPolyline ogdf::GridLayout::polyline ( edge  e  )  const

Returns the polyline of edge e (including start and end point!).

void ogdf::GridLayout::init ( const Graph G  )  [inline]

Initializes the grid layout for graph G.

Definition at line 122 of file GridLayout.h.

void ogdf::GridLayout::init (  )  [inline]

Initializes the grid layout for no graph (frees memory).

Definition at line 129 of file GridLayout.h.

IPolyline ogdf::GridLayout::getCompactBends ( edge  e  )  const

Returns the bend point list of edge e without unnecessary bends.

void ogdf::GridLayout::compactAllBends (  ) 

Removes all unnecessary bends.

bool ogdf::GridLayout::checkLayout (  ) 

Checks if the grid layout is reasonable.

In particular, the following checks are performed:

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.

Parameters:
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.

int ogdf::GridLayout::totalManhattanEdgeLength (  )  const

Computes the total manhattan edge length of the grid layout.

double ogdf::GridLayout::totalEdgeLength (  )  const

Computes the total (euclidean) edge length of the grid layout.

int ogdf::GridLayout::numberOfBends (  )  const

Computes the total number of bends in the grid layout.

virtual void ogdf::GridLayout::remap ( Layout drawing  )  [virtual]

Transforms the grid layout to a layout write 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.

static int ogdf::GridLayout::manhattanDistance ( const IPoint ip1,
const IPoint ip2 
) [static]

static double ogdf::GridLayout::euclideanDistance ( const IPoint ip1,
const IPoint ip2 
) [static]

static bool ogdf::GridLayout::isRedundant ( IPoint p1,
IPoint p2,
IPoint p3 
) [static, private]

static void ogdf::GridLayout::compact ( IPolyline ip  )  [static, private]

void* ogdf::GridLayout::operator new ( size_t  nBytes  )  [inline]

Definition at line 193 of file GridLayout.h.

void* ogdf::GridLayout::operator new ( size_t  ,
void *  p 
) [inline]

Definition at line 193 of file GridLayout.h.

void ogdf::GridLayout::operator delete ( void *  p  )  [inline]

Definition at line 193 of file GridLayout.h.


Member Data Documentation

NodeArray<int> ogdf::GridLayout::m_x [protected]

The x-coordinates of nodes.

Definition at line 184 of file GridLayout.h.

NodeArray<int> ogdf::GridLayout::m_y [protected]

The y-coordinates of nodes.

Definition at line 185 of file GridLayout.h.

EdgeArray<IPolyline> ogdf::GridLayout::m_bends [protected]

The bend points of edges.

Definition at line 186 of file GridLayout.h.


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

© 1999-2007 by oreas GmbH, © 2005-2007 by University Dortmund and University Cologne.

Generated on Thu Nov 22 19:40:08 2007 by doxygen 1.5.4.