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.

All four variants initialize the coordinates of W to xmin = 0, xmax = 100 and ymin = 0.<br />

<strong>The</strong> init operation (see below) can later be used to change the window coordinates and<br />

scaling. Please note, that a window is not displayed before the function display is called<br />

for it.<br />

3. Operations<br />

3.1 Initialization<br />

void W.init(double x 0 , double x 1 , double y 0 )<br />

double W.set grid dist(double d)<br />

grid style W.set grid style(grid style s)<br />

sets xmin to x 0 , xmax to x 1 , and ymin to y 0 ,<br />

the scaling factor scaling to w/(xmax−xmin),<br />

and ymax to ymin + h/scaling. Here w and h<br />

are the width and height of the drawing section<br />

in pixels.<br />

sets the grid distance of W to d.<br />

sets the grid style of W to s.<br />

int<br />

int<br />

void<br />

W.set grid mode(int d) sets the grid distance of W to d pixels.<br />

W.set precision(int prec)<br />

sets the precision of W to prec.<br />

W.init(double x 0 , double x 1 , double y 0 , int d, bool erase = true)<br />

same as W .init(x 0 , x 1 , y 0 ) followed by<br />

W .set grid mode(d). If the optional flag<br />

erase is set to false the window will not be<br />

erased.<br />

void W.display( ) opens W and displays it with its right upper<br />

corner in the upper right corner of the screen.<br />

Note that W .display() has to be called before<br />

all drawing operations and that all operations<br />

adding panel items to W (cf. 17.2) have to be<br />

called before the first call of W .display().<br />

void<br />

W.display(int x, int y) opens W and displays it with its left upper corner<br />

at position (x, y). Special values for x and<br />

y are window :: min, window :: center, and<br />

window :: max for positioning W at the minimal<br />

or maximal x or y coordinate or centering<br />

it in the x or y dimension.

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

Saved successfully!

Ooh no, something went wrong!