next up previous contents index
Next: Grid Layouts Up: Grid Coordinate Mappers Previous: Mapping with Fixed Grid   Contents   Index


Mapping with Fixed Size ( FixedSizeMapper )

Baseclasses


\begin{picture}(8,4)
\thicklines
\put(0,3){\framebox (5.5,1){\bf AGDModule}}...
...vector(0,-1){1}}\put(3,0){\framebox (6,1){\bf FixedSizeMapper}}
\end{picture}

Definition

FixedSizeMapper provides a mapping with predefined grid width width_x in x-direction and width_y in y-direction. The size of nodes can be increased or decreased in order to adjust the size to settings of separation and minimal overhang.

The input grid sizes of nodes ( get_node_gride_size() function) are

\begin{eqnarray*}
\HTML{I}{grid\_width}(v) & = & \max\left( 0,\left\lceil \frac{...
...}(v)+\HTML{I}{sep\_y}}
{\HTML{I}{width\_y}}-1\right\rceil\right)
\end{eqnarray*}

The nodes are resized, such that a minimal overhang and separation is guaranteed. The minimal allowed width is 2min$ \_$overhang$ \_$x + grid$ \_$width(v)*width$ \_$x and the maximal allowed width is (1 + grid$ \_$width(v))*width$ \_$x - sep$ \_$x.

Analogously, the minimal allowed height is 2min$ \_$overhang$ \_$y + grid$ \_$height(v)*width$ \_$y and the maximal allowed height is (1 + grid$ \_$height(v))*width$ \_$y - sep$ \_$y.

FixedSizeMapper realizes the following mapping functions:

\begin{eqnarray*}
\varphi_x(\HTML{I}{column}) & = & (\HTML{I}{column} - \HTML{I}...
...ML{I}{ymin}) * \HTML{I}{width\_y} + \HTML{I}{origin}.\HTML{I}{y}
\end{eqnarray*}

The positions of nodes and the polylines of edges are given by the default implementations of GridCoordinateMapper using the mapping functions defined above.

Optional Parameters Instances of FixedSizeMapper provide the following optional parameters:

$ \bullet$
double width_x = 40
determines the predefined grid width in x-direction.
$ \bullet$
double width_y = 40
determines the predefined grid width in y-direction.
$ \bullet$
double min_overhang_x = 2
determines the minimal allowed overhang of each node in x-direction.
$ \bullet$
double min_overhang_y = 2
determines the minimal allowed overhang of each node in y-direction.
$ \bullet$
double sep_x = 20
determines the minimal distance (separation) between nodes in x-direction.
$ \bullet$
double sep_y = 20
determines the minimal distance between nodes in y-direction.
$ \bullet$
DPoint origin = (0, 0)
determines the origin of the coordinate system, that is the point to which the lower left grid point (xmin, ymin) is mapped.

#include < AGD/FixedSizeMapper.h >

Creation

FixedSizeMapper M(double width_x = 40, double width_y = 40, double min_overhang_x = 2, double min_overhang_y = 2, double sep_x = 20, double sep_y = 20, DPoint origin = DPoint(0, 0))
    creates an instance M of type FixedSizeMapper, and sets the optional parameters width_x, width_y, min_overhang_x, min_overhang_y, sep_x, sep_y and origin.

Operations

Standard Interface (Inherited Methods) The detailed description of these methods can be found in the manual entries of the base class (GridCoordinateMapper).

void M.get_node_grid_size(const leda_graph& G, GridLayout& gl, const LayoutInterface& A)

void M.get_node_grid_size(const GraphCopy& GC, GridLayout& gl, const LayoutInterface& A)

void M.call(const leda_graph& G, const GridLayout& gl, LayoutInterface& A)

void M.call(const GraphCopy& GC, const GridLayout& gl, LayoutInterface& A)

Access to Options

double M.width_x()

void M.width_x(double wx)

double M.width_y()

void M.width_y(double wy)

double M.min_overhang_x()

void M.min_overhang_x(double x)

double M.min_overhang_y()

void M.min_overhang_y(double y)

double M.sep_x()

void M.sep_x(double x)

double M.sep_y()

void M.sep_y(double y)

DPoint M.origin()

void M.origin(DPoint p)

Implementation

The get_node_size() function takes time $ \protectO$(n) and the call() function takes time $ \protectO$(n + m + b), where n is the number of nodes and m is the number of edges of G, and b is the total number of bend points.


next up previous contents index
Next: Grid Layouts Up: Grid Coordinate Mappers Previous: Mapping with Fixed Grid   Contents   Index

© Copyright 1998-2001, Algorithmic Solutions Software GmbH. All rights reserved.
2001-08-13