next up previous contents index
Next: Concept for LEDA Graphs Up: Implementation of Layout Algorithms Previous: Implementation of Layout Algorithms   Contents   Index


Implementation of Layout Algorithms ( LayoutModuleImpl )

Baseclasses


\begin{picture}(8,4)
\thicklines
\put(2.2,3){\framebox (5,1){\bf AGDModule}}...
...,0){\framebox (10.2,1){\bf LayoutModuleImpl{\tt <}CONCEPT{\tt >}}}
\end{picture}

Definition

The class LayoutModuleImpl< CONCEPT > represents a generic method for implementing layout algorithms. The template argument CONCEPT is the class which represents the used implementation concept. It is responsible for allocating the data structures used by the layout algorithm and for translating the layout computed by the algorithm into a layout for the input graph. A class used as template argument CONCEPT must provide the following constructors:

CONCEPT(const graph &G,LayoutInterface &A)
  allocate data structures for graph G with layout interface A.
CONCEPT(const graph &G,face f,LayoutInterface &A)
  allocate data structures for planar map G with exterior face f and layout interface A.
CONCEPT(PlaneGraphCopy &PG,face f,LayoutInterface &A)
  allocate data structures for plane graph copy PG with exterior face f and layout interface A.
These constructors correspond to call() methods inherited by LayoutModule. If an exterior face f is passed, it may be nil indicating that the algorithm chooses an appropriate exterior face. Moreover, the following operations are required:
void update()
  transforms the computed layout into a layout for the input graph.
static void set_postcondition(list<AgdKey> &post)
  assigns the general postcondition to post, i.e., adds key::planar_map_callable to post if calls for planar maps (second constructor) are supported, and adds key::PlaneGraphCopy_callable to post if calls for PlaneGraphCopy's (third constructor) are supported.
LayoutModuleImpl< CONCEPT > implements all call() methods inherited by LayoutModule. The computation of a layout (call() methods) works as follows:
  1. An object C of type CONCEPT is constructed using the constructor corresponding to the call() parameter list.
  2. The actual computation of the grid layout is performed by calling pure virtual method do_call(C).
  3. The computed layout is transformed into a layout for the input graph by calling update() of C.
Thus, it is sufficient to implement do_call(C). All necessary transformations are performed by the implementation concept class.

#include < AGD/LayoutModuleImpl.h >

Operations

LayoutModuleImpl< CONCEPT > implements the call() methods of its base class. Furthermore, there is the following protected overridable:

void L.do_call(CONCEPT& C) implements the algorithm.


next up previous contents index
Next: Concept for LEDA Graphs Up: Implementation of Layout Algorithms Previous: Implementation of Layout Algorithms   Contents   Index

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