next up previous contents index
Next: Interface with Animation to Up: Layout Interfaces Previous: Layout Interfaces   Contents   Index


Interface to GraphWin ( GraphWinInterface )

Baseclasses


\begin{picture}(7,2.5)
\thicklines
\put(0,1.5){\framebox (5.5,1){\bf LayoutInt...
...ctor(0,-1){1}}\put(1,0){\framebox (6,1){\bf GraphWinInterface}}
\end{picture}

Definition

An instance A of type GraphWinInterface is an interface to the graphical attributes of a GraphWin object. GraphWinInterface posses an option flush, which determines if the update() method redraws the graph. If flush is set to false, the graph is not redrawn. This can be useful, if a subsequent operation, e.g. zoom_graph(), shall be called first, before the changes are displayed.

#include < AGD/GraphWinInterface.h >

Creation

GraphWinInterface A(GraphWin& GW) creates an instance A of type GraphWinInterface initialized to an interface to GW.

GraphWinInterface A(const GraphWinInterface& gwi)
    copy constructor.

Operations

void A.init(GraphWin& GW) initializes A for GW.

void A.flush(bool b) sets current flush to b, i.e., b is false calling update() will not redraw the graph.

bool A.flush() returns the current value of flush.


GraphWinInterface inherits the operations from its base class LayoutInterface (see Sect. Layout Interfaces).

Example

We use a GraphWinInterface to apply an AGD layout algorithm to a graph displayed in a GraphWin.


#include <LEDA/graphwin.h>
#include <AGD/GraphWinInterface.h>
#include <AGD/PlanarizationLayout.h>

int main()
{
  // create a GraphWin and let user edit a graph
  GraphWin GW;
  GW.open();

  // create an interface to GW for AGD alg's
  GraphWinInterface   GWI(GW);
  PlanarizationLayout L;

  // apply L and display the drawing in GW
  L.call(GW.get_graph(),GWI);

  // let the user edit the result
  GW.edit();
}


next up previous contents index
Next: Interface with Animation to Up: Layout Interfaces Previous: Layout Interfaces   Contents   Index

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