next up previous contents index
Next: Grid Layout Algorithms ( Up: Layout Algorithms Previous: Layout Algorithms   Contents   Index


Layout Algorithms ( LayoutModule )

Baseclasses


\begin{picture}(6.5,2.5)
\thicklines
\put(0,1.5){\framebox (5,1){\bf AGDModule...
...\vector(0,-1){1}}\put(1.5,0){\framebox (5,1){\bf LayoutModule}}
\end{picture}

Definition

The class LayoutModule defines the standard interface for layout algorithms.

A layout algorithm L gets as input a graph G and for each node v of G the size of the rectangle surrounding the graphics of v. L computes for each node v a point, which will be the center of the graphics of v, and for each edge a list of bend points with a source and target anchor point. Layout algorithms are also allowed to change the size of the graphics of nodes.

Layout algorithms can be implemented by directly deriving from LayoutModule and overriding all pure virtual methods of the standard interface. More convenient is to derive from LayoutModuleImpl with a suitable implementation concept class. This is explained in detail in Chapter Chapter Implementation of Layout Algorithms. In the latter case, only one method (do_call()) has to be overridden. If the layout algorithm places vertices and bend points on integer grid coordinates, the algorithm should be implemented as grid layout algorithm (see GridLayoutModule, Sect. Grid Layout Algorithms).

Input and Output Parameters

input parameter: graph in_graph=1
output parameter: layout out_layout=1

The integer constants in_graph and out_layout denote the positions in the input and output parameter lists. The values can be used to reference the desired parameter when setting the pre- and postcondition.

#include < AGD/LayoutModule.h >

Initialization

LayoutModule L initializes a layout algorithm.

Operations

Standard Interface

bool L.check(const leda_graph& G, AgdKey& p)
    returns true if G satisfies the preconditions of L. Otherwise, false is returned and p contains a property that is not satisfied.

void L.call(const leda_graph& G, LayoutInterface& A)
    calls L for graph G with layout interface A. Precondition: A is a layout interface for G.

The following call interfaces are not supported by all layout algorithms. The general postcondition (L.postcondition(0)) declares, which call interfaces are supported.

void L.call(const leda_graph& G, leda_face f, LayoutInterface& A)
    calls L for graph G with layout interface A. Precondition: key : : planar$ \_$map$ \_$callable $ \in$ post(0), G represents a planar map, f is nil or a face in G, and A is a layout interface for G.

void L.call(PlaneGraphCopy& PG, leda_face f, LayoutInterface& A)
    calls L for plane graph copy PG with layout interface A. Precondition: key : : PlaneGraphCopy$ \_$callable $ \in$ post(0), f is nil or a face in PG, and A is a layout interface for PG.


next up previous contents index
Next: Grid Layout Algorithms ( Up: Layout Algorithms Previous: Layout Algorithms   Contents   Index

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