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.

int W.menu bar height( ) returns the height of the menu bar of W<br />

in pixels and 0 if W has no menu bar (see<br />

W.make menu bar( )).<br />

int W.xpos( ) returns the x-coordinate of the upper left corner<br />

of the frame of W .<br />

int W.ypos( ) returns the y-coordinate of the upper left corner<br />

of the frame of W .<br />

int W.get state( ) returns the state of W .<br />

void W.set state(int stat) sets the state of W to stat.<br />

bool W.contains(const point& p)<br />

3.4 Drawing Operations<br />

returns true if p lies in the drawing area.<br />

All drawing operations have an optional color argument at the end of the parameter list.<br />

If this argument is omitted the current foreground color (cf. section 17.2) of W is used.<br />

3.4.1 Drawing points<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

W.draw point(double x, double y, color c = window :: fgcol)<br />

draws the point (x, y) (a cross of two short segments).<br />

W.draw point(const point& p, color c = window :: fgcol)<br />

draws point p.<br />

W.draw pixel(double x, double y, color c = window :: fgcol)<br />

sets the color of the pixel at position (x, y) to c.<br />

W.draw pixel(const point& p, color c = window :: fgcol)<br />

sets the color of the pixel at position p to c.<br />

W.draw pixels(const list& L, color c = window :: fgcol)<br />

sets the color of all pixels in L to c.<br />

W.draw pixels(int n, double ∗ xcoord, double ∗ ycoord, color c = window :: fgcol)<br />

draws all pixels (xcoord[i], ycoord[i]) for 0 ≤ i ≤ n − 1.<br />

3.4.2 Drawing line segments<br />

void W.draw segment(double x 1 , double y 1 , double x 2 , double y 2 ,<br />

color c = window :: fgcol)<br />

draws a line segment from (x 1 , y 1 ) to (x 2 , y 2 ).<br />

void<br />

W.draw segment(const point& p, const point& q, color c = window :: fgcol)<br />

draws a line segment from point p to point q.

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

Saved successfully!

Ooh no, something went wrong!