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.

template <br />

string GW.set obj label(GeoBaseScene ∗ sc, void ∗ adr, string lb)<br />

sets the label of the object at (∗adr) to lb.<br />

template <br />

string GW.set obj label(GeoBaseScene ∗ sc, typename T :: iterator it,<br />

string lb)<br />

sets the label of the object it points to to lb.<br />

Object texts<br />

<strong>The</strong> following operations can be used to add/retrieve objects of type geowin text to objects<br />

in scenes. <strong>The</strong> class geowin text is used to store graphical representations of texts. It stores<br />

a string (the text) and the following attributes:<br />

Name Type Description<br />

font type geowin font type font type<br />

size double font size<br />

text color color color of the text<br />

user font string font name (if font type = user font)<br />

x offset double offset in x-direction to drawing position<br />

y offset double offset in y-direction to drawing position<br />

<strong>The</strong> enumeration type geowin font type has the following set of integral constants:<br />

roman font, bold font, italic font, fixed font and user font.<br />

<strong>The</strong> class geowin text has the following constructors:<br />

geowin_text(string t, double ox, double oy, geowin_font_type ft,<br />

double sz, string uf, color c = black);<br />

geowin_text(string t, geowin_font_type ft, double sz);<br />

geowin_text(string t);<br />

<strong>The</strong> arguments are: t - the text, ox, oy - the x/y offsets, ft - the font type, sz - the font<br />

size, uf - the user font and c - the text color. If a text is associated with an object, it<br />

will be drawn centered at the center of the bounding box of the object translated by the<br />

x/y - offset parameters. Note that it is also possible to add texts to a whole scene and<br />

to instances of class GeoWin. <strong>The</strong>n the x/y - offset parameters specify the position (see<br />

add text operation).<br />

template <br />

bool GW.get obj text(GeoBaseScene ∗ sc, void ∗ adr, geowin text& gt)<br />

Gets the text associated with the object at adr in the<br />

container of scene sc and assigns it to gt. If no text<br />

is associated with the object, false will be returned,<br />

otherwise true.

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

Saved successfully!

Ooh no, something went wrong!