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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

void<br />

GW.set selected objects(GeoEditScene ∗ sc,<br />

const list& LIT )<br />

selects the objects of scene sc described by the contents<br />

of container LIT .<br />

template <br />

void GW.set selected objects(GeoEditScene ∗ sc)<br />

selects all objects of scene sc.<br />

template <br />

void GW.set selected objects(GeoEditScene ∗ sc,<br />

const rectangle& R)<br />

selects all objects of scene sc contained in rectangle<br />

R.<br />

void GW.edit( ) starts the interactive mode of GW . <strong>The</strong> operation returns<br />

if either the DONE or Quit button was pressed.<br />

bool<br />

void<br />

GW.edit(geo scene sc)<br />

edits scene sc. Returns false if the Quit-Button was<br />

pressed, true otherwise.<br />

GW.register window(window& win, bool (∗ev fcn)(window ∗ w, int event,<br />

int but, double x, double y))<br />

if you enter the interactive mode of GW in an application,<br />

but you want to handle events of other windows<br />

as well, you can register a callback function ev fcn<br />

for your other window win that will be called when<br />

events associated with win occur. <strong>The</strong> parameters of<br />

ev fcn are the window causing the event, the event<br />

that ocurred, the button and the x and y coordinates<br />

of the position in win. <strong>The</strong> handler ev fcn has to return<br />

true if the interactive mode of GeoWin has to be<br />

stopped, false otherwise.<br />

Simple Animations<br />

<strong>The</strong> following operation can be used to perform simple animations. One can animate the<br />

movement of selected objects of a scene. This can be done in the following way: select<br />

a number of objects in an edit scene; then start the animation by calling the animate<br />

member function. <strong>The</strong> second parameter of this member function is an object anim of<br />

type geowin animation, the first parameter is the scene that will be animated. <strong>The</strong> object<br />

anim has to be derived from the abstract base class geowin animation. <strong>The</strong> derived class<br />

has to overwrite some methods of the base class:<br />

class geowin_animation {<br />

public:<br />

virtual void init(const GeoWin&) { }<br />

virtual void finish(const GeoWin&) { }

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

Saved successfully!

Ooh no, something went wrong!