Algorithmic Solutions > LEDA > LEDA Guide > GeoWin > Programming Interface > Edit and Result Scenes

GeoWin Edit and Result Scenes

GeoWin provides three kinds of scenes: Basic Scenes, Edit Scenes, and Result Scenes. Edit and Result Scenes are derived from Basic Scenes. Basic Scenes are only used internally.

Edit Scenes

Edit Scenes are of type GeoEditScene<T>, where T is the type of container used for storing geometric objects, e.g., list<point>.

GeoWin is an editor of Edit Scenes, that is, the user can manipulate Edit Scenes directly using the interactive interface of GeoWin.

Result Scenes

Edit Scenes are of type GeoResultScene<I,R>, where I is the type of container used for storing geometric objects of the input and R is the type of container used for storing geometric objects of the result.

  • Result Scenes cannot be edited directly by the user.
  • Contents of R is computed by an update function or update object.
  • Contents of R is computed every time the contents of I changes.

The update function is of the following type

    void (*update)(const I& input, R& output);

On the right you see a screenshot of an Example for Result Scenes and Update Functions.

Example of GeoWin Edit and Result Scenes

Example Result Scenes and Update Functions

Important Notice: Update functions are member template functions. Unfortunately, MSVC++ 6 does not support such functions. Please use update objects with this compiler.

Creating Scenes

To create a scene the operation new_scene() of GeoWin is used.

You can create edit scenes with container T with

    template<class T> GeoEditScene<T>* geow.new_scene(T& t);
Result scenes can be created with
    template<class I, class R> GeoResultScene<I,R>* 
    geow.new_scene(void (*update)(const I&, R&), geo_scene sc, 
                   string sc_name);

This operation creates a new result scene with input scene sc and update function update(). The name of the scene will be sc_name. geo_scene is the scene item type of GeoWin (a pointer to the base class of all scenes). Scene sc has a container of type I. The update function will use this container evey time the input scene changes.

It is also possible to use update objects instead of update functions in result scenes.

    template<class I, class R> GeoResultScene<I,R>* 
    geow.new_scene(geowin_update<I,R>& up, geo_scene sc, 
                   string sc_name);
Using an update object it is also possible to provide a redraw object for the result scene.
    template<class I, class R> GeoResultScene<I,R>* 
    geow.new_scene(geowin_update<I,R>& up, geowin_redraw& rd,
                   geo_scene sc, string sc_name);

See also:

Programming Interface

GeoWin

Interactive Interface

Result Scenes and Update Objects


Linear Lists

Data Types for 2D Geometry


Manual Pages:

Manual Page GraphWin




Please send any suggestions, comments or questions to leda@algorithmic-solutions.com
© Copyright 2001-2003, Algorithmic Solutions Software GmbH