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.

window& W ≫ segment& s reads a segment s: use the left button to define the<br />

start and end point of s.<br />

window& W ≫ ray& r reads a ray r: use the left button to define the start<br />

point and a second point on r.<br />

window& W ≫ line& l reads a line l: use the left button to define two<br />

different points on l.<br />

window& W ≫ circle& C reads a circle C: use the left button to define the<br />

center of C and a point on C.<br />

window& W ≫ rectangle& R reads a rectangle R: use the left button to define<br />

two opposite corners of R.<br />

window& W ≫ triangle& T reads a triangle T : use the left button to define the<br />

corners of T .<br />

window& W ≫ polygon& P reads a polygon P : use the left button to define<br />

the sequence of vertices of P , end the sequence by<br />

clicking the right button.<br />

window&<br />

W ≫ gen polygon& P<br />

reads a generalized polygon P ; input the polygons<br />

defining P and end the input by clicking the middle<br />

button.<br />

list W.read polygon( ) as above, however, returns list of vertices.<br />

As long as an input operation has not been completed the last read point can be erased<br />

by simultaneously pressing the shift key and the left mouse button.<br />

3.8 Non-Member Functions<br />

int read mouse(window ∗ & w, double& x, double& y)<br />

int get mouse(window ∗ & w, double& x, double& y)<br />

waits for mouse input, assigns a pointer to the corresponding<br />

window to w and the position in ∗w to<br />

(x, y) and returns the pressed button.<br />

non-blocking variant of read mouse, returns<br />

NO BUTTON if no button was pressed.<br />

void put back event( ) puts last handled event back to the event queue.<br />

3.9 Panel Operations<br />

<strong>The</strong> panel section of a window is used for displaying text messages and for updating the<br />

values of variables. It consists of a list of panel items and a list of buttons. <strong>The</strong> operations

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

Saved successfully!

Ooh no, something went wrong!