31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

e inserted in the result scene. In the third variant the contents of the result scene will<br />

be cleared, and then the object returned by (∗f) will be inserted in the result scene. <strong>The</strong><br />

class geowin update has also the following virtual functions:<br />

bool insert(const InpObject& new)<br />

bool del(const InpObject& new)<br />

bool change(const InpObject& old obj , const InpObject& new obj )<br />

where new is a new inserted or deleted object and old obj and new obj are objects before<br />

and after a change. InpObject is the value type of the container of the input scene.<br />

With these functions it is possible to support incremental algorithms. <strong>The</strong> functions<br />

will be called, when in the input scene new objects are added (insert), deleted (del)<br />

or changed when performing a move or rotate operation (change). In the base class<br />

geowin update these functions return false. That means, that the standard updatefunction<br />

of the update object should be used. But in derived classes it is possible to<br />

overwrite these functions and provide user-defined update operations for these three incremental<br />

operations. <strong>The</strong>n the function has to return true. That means, that the standard<br />

update function of the update object should not be used. Instead the incremental<br />

operation performs the update-operation.<br />

It is also possible to provide user defined redraw for a scene. For this purpose we use<br />

redraw objects derived from geowin redraw. <strong>The</strong> derived class has to overwrite the virtual<br />

redraw function<br />

void draw(window& W, color c1 , color c2 , double x1 , double y1 , double x2 , double y2 )<br />

of the base class to provide a user defined redraw function. <strong>The</strong> first 3 parameters of this<br />

function are the redraw window and the first and second drawing color (color and color2)<br />

of the scene. <strong>The</strong> class geowin redraw has also a virtual method<br />

bool draw container( )<br />

that returns false in the base class. If you want the user defined redraw of the scene<br />

(provided by the redraw function draw) and the execution of the ’normal’ redraw of<br />

the scene as well (output of the objects stored in the container of the scene), you have<br />

to overwrite draw container in a derived class by a function returning true. A virtual<br />

method<br />

bool write postscript(ps file& PS, color c1 , color c2 )<br />

is provided for output to a <strong>LEDA</strong> postscript file PS. c1 and c2 are the first and second<br />

drawing color (color and color2 ) of the scene. Another class that can be used for user<br />

defined redraw is the templated class geowin redraw container. This class<br />

has as well virtual functions for redraw and postscript output, but provides a slighly<br />

changed interface:<br />

bool draw(const CONTAINER& c, window& w, color c1 , color c2 ,<br />

double, double, double, double)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!