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.

POLYGON<br />

POLYGON<br />

P (const list& pl,<br />

CHECK TYPE check = POLYGON :: WEAKLY SIMPLE,<br />

RESPECT TYPE respect orientation =<br />

POLYGON :: RESPECT ORIENTATION );<br />

introduces a variable P of type POLYGON . P is initialized<br />

to the polygon with vertex sequence pl. If respect orientation<br />

is DISREGARD ORIENTATION, the positive orientation is<br />

chosen.<br />

Precondition: If check is SIMPLE, pl must define a simple<br />

polygon, and if check is WEAKLY SIMPLE, pl must define<br />

a weakly simple polygon. If no test is to performed, the second<br />

argument has to be set to NO CHECK. <strong>The</strong> constants<br />

NO CHECK, SIMPLE, and WEAKLY SIMPLE are part of<br />

a local enumeration type CHECK TYPE.<br />

P (const polygon& Q, int prec = rat point :: default precision);<br />

introduces a variable P of type POLYGON . P is initialized<br />

to a rational approximation of the (floating point) polygon Q<br />

of coordinates with denominator at most prec. If prec is zero,<br />

the implementation chooses prec large enough such that there<br />

is no loss of precision in the conversion.<br />

4. Operations<br />

polygon P.to float( ) returns a floating point approximation of P .<br />

void P.normalize( ) simplifies the homogenous representation by<br />

calling p.normalize( ) for every vertex p of<br />

P .<br />

bool P.is simple( ) tests whether P is simple or not.<br />

bool P.is weakly simple( ) tests whether P is weakly simple or not.<br />

bool P.is weakly simple(list& L)<br />

POLYGON :: CHECK TYPE P.check simplicity( )<br />

as above, returns all proper points of intersection<br />

in L.<br />

returns the CHECK TYPE of P . <strong>The</strong> result<br />

can be SIMPLE, WEAKLY SIMPLE or<br />

NOT WEAKLY SIMPLE.<br />

bool P.is convex( ) returns true if P is convex, false otherwise.<br />

const list& P.vertices( )<br />

returns the sequence of vertices of P in counterclockwise<br />

ordering.

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

Saved successfully!

Ooh no, something went wrong!