| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/text/deprecated/text.h>

Public Types | |
| enum | TextPlane { XY_PLANE, XZ_PLANE, YZ_PLANE } |
| enum | AlignmentH { LEFT, CENTER_H, RIGHT } |
| enum | AlignmentV { BOTTOM, CENTER_V, TOP } |
Public Member Functions | |
| VRS_SERIALIZABLE_CLASS_ENUM (TextPlane) | |
| defines references plane for polygonal text | |
| VRS_SERIALIZABLE_CLASS_ENUM (AlignmentH) | |
| VRS_SERIALIZABLE_CLASS_ENUM (AlignmentV) | |
| Text (Font *font, const std::string &text=std::string(), const Vector &position=Vector(0, 0, 0), const Vector &scaling=Vector(1, 1, 1), TextPlane textplane=Text::XY_PLANE, AlignmentH alignmentH=Text::LEFT, AlignmentV alignmentV=Text::BOTTOM, double haloedSize=0.0, const Color &haloedColor=Color::white, bool useModulateForTexturing=false) | |
| Constructor for standard string. | |
| Text (const Text &text) | |
| void | setFont (Font *newFont) |
| the name of the font to load | |
| Font * | getFont () const |
| void | setUnicodeText (const std::string &newText) |
| Sets the text using unicode characters. | |
| std::string | getUnicodeText () const |
| Returns the text, using unicode characters. | |
| void | setText (const std::string &newText) |
| Sets the text using normal characters. | |
| std::string | getText () const |
| Returns the text using normal characters. | |
| double | getLength () const |
| Get the length of the text displayed with the font. | |
| double | getHeight () const |
| Get the length of the text displayed with the font. | |
| Bounds | getPixelBoundingBox () const |
| Returns the bounding box of the text specified in pixel if the text uses a 2D font. | |
| void | setPosition (const Vector &newPosition) |
| The position denotes the lower left corner of the text. | |
| const Vector & | getPosition () const |
| void | setScaling (const Vector &newScaling) |
| const Vector & | getScaling () const |
| void | setFixedSize (double inches) |
| Specifies a size in inches. | |
| void | disableFixedSize () |
| Disable the fixed size mechanism, see setFixedSize. | |
| double | getHaloeSize () const |
| Returns the size of the haloe effect. | |
| void | setHaloeSize (double haloedSize) |
| Sets a new size for the haloe effect. | |
| const Color & | getHaloeColor () const |
| Returns the color used for the haloe effect. | |
| void | setHaloeColor (const Color &color) |
| Sets a new color for the haloe effect. | |
| TextPlane | getTextPlane () const |
| Returns the plane in which the text is painted. | |
| void | setTextPlane (TextPlane textplane) |
| Sets the plane in which the text is painted. | |
| AlignmentH | getAlignmentH () const |
| Returns the horizontal alignment of the text. | |
| void | setAlignmentH (AlignmentH newAlignment) |
| Sets a new value for the horizontal alignment of the text. | |
| AlignmentV | getAlignmentV () const |
| Returns the vertical alignment of the text. | |
| void | setAlignmentV (AlignmentV newAlignment) |
| Sets a new value for the vertical alignment of the text. | |
| bool | useModulateForTexturing () const |
| void | setUseModulateForTexturing (bool useModulateForTexturing) |
| virtual Bounds | boundingBox () const |
| Shapes define their bounding box in model coordinates. | |
| virtual void | modified () |
| VRS_TYPEINFO (Text, Shape) | |
| VRS_SERIALIZABLE (Text) | |
Protected Member Functions | |
| Text () | |
| for persistency | |
Friends | |
| class | TextPainterGL |
| enum VRS::Text::TextPlane |
| VRS::Text::Text | ( | Font * | font, | |
| const std::string & | text = std::string(), |
|||
| const Vector & | position = Vector(0, 0, 0), |
|||
| const Vector & | scaling = Vector(1, 1, 1), |
|||
| TextPlane | textplane = Text::XY_PLANE, |
|||
| AlignmentH | alignmentH = Text::LEFT, |
|||
| AlignmentV | alignmentV = Text::BOTTOM, |
|||
| double | haloedSize = 0.0, |
|||
| const Color & | haloedColor = Color::white, |
|||
| bool | useModulateForTexturing = false | |||
| ) |
Constructor for standard string.
| VRS::Text::Text | ( | const Text & | text | ) |
| VRS::Text::Text | ( | ) | [protected] |
for persistency
| VRS::Text::VRS_SERIALIZABLE_CLASS_ENUM | ( | TextPlane | ) |
defines references plane for polygonal text
| VRS::Text::VRS_SERIALIZABLE_CLASS_ENUM | ( | AlignmentH | ) |
| VRS::Text::VRS_SERIALIZABLE_CLASS_ENUM | ( | AlignmentV | ) |
| void VRS::Text::setFont | ( | Font * | newFont | ) |
the name of the font to load
| Font* VRS::Text::getFont | ( | ) | const |
| void VRS::Text::setUnicodeText | ( | const std::string & | newText | ) |
Sets the text using unicode characters.
| std::string VRS::Text::getUnicodeText | ( | ) | const |
Returns the text, using unicode characters.
| void VRS::Text::setText | ( | const std::string & | newText | ) |
Sets the text using normal characters.
| std::string VRS::Text::getText | ( | ) | const |
Returns the text using normal characters.
It is not suggested, to mix up the setUnicodeText- and getText- methods. You will receive the lower 8 bits of every unicode character in the returned string.
| double VRS::Text::getLength | ( | ) | const |
Get the length of the text displayed with the font.
Returns the length dependant on the current fonts type for 3D fonts returns returns the length in coordinates (considering the current scaling) for 2D fonts returns the length in pixel Take care when using a fixed size. Since the text can not determine its actual size in this case, it can not be ensured, that the value returned is always correct.
| double VRS::Text::getHeight | ( | ) | const |
Get the length of the text displayed with the font.
Returns the length dependant on the current fonts type for 3D fonts returns returns the length in coordinates (considering the current scaling) for 2D fonts returns the length in pixel Take care when using a fixed size. Since the text can not determine its actual size in this case, it can not be ensured, that the value returned is always correct.
| Bounds VRS::Text::getPixelBoundingBox | ( | ) | const |
Returns the bounding box of the text specified in pixel if the text uses a 2D font.
Take care when using a fixed size. Since the text can not determine its actual size in this case, it can not be ensured, that the box returned is always correct.
| void VRS::Text::setPosition | ( | const Vector & | newPosition | ) |
The position denotes the lower left corner of the text.
| const Vector& VRS::Text::getPosition | ( | ) | const |
| void VRS::Text::setScaling | ( | const Vector & | newScaling | ) |
The scaling coefficients define the geometric transformation applied to 3D texts. The width and height is scaled by the x and y coefficient; the z coefficient scales the text in depth in the case of extruded fonts. If a non-3D font is used, scaling has no effect.
| const Vector& VRS::Text::getScaling | ( | ) | const |
| void VRS::Text::setFixedSize | ( | double | inches | ) |
Specifies a size in inches.
When setFixedSize is called, the fixed size mechanism is activated and the painter will adjust the size of the text that it becomes inches inch tall when rendered. More precisely the text will be scaled that way that the height is inches inch at the position of the text. The size at the ends of the text may vary depending on the projection and the rotation of the text. (Considering a perspective projection and a horizontally centered text for example, the end of the text which is next to the camera will appear bigger than its center (which is scaled to be inches inch tall) and the other end which is more distant will appear smaller.) Note that calculating the size must take place every frame in order to work properly and therefore the text should not be cached. A compromise regarding the performance may be to cache it anyway and to ensure at certain points in time or at certain changes (for example the canvas size) that the rendering is updated (by calling modified for the text).
| void VRS::Text::disableFixedSize | ( | ) |
Disable the fixed size mechanism, see setFixedSize.
| double VRS::Text::getHaloeSize | ( | ) | const |
Returns the size of the haloe effect.
| void VRS::Text::setHaloeSize | ( | double | haloedSize | ) |
Sets a new size for the haloe effect.
Defines the size of the halo range (square with 2*haloedSize sidelength). If the text uses a pixel font (2D) or POLYGON the haloe range is specified in screen pixels. If the font type is TEXTURE, the haloe range is specified in texture pixels. So make sure, the range corresponds to the texture resolution, e. g. when using a texture resolution of 50, a haloe effect with the range set to 5 will become much bigger than with a texture with the resolution of 150. (suggested around 1/50 * texture resolution in this case) At last, when using the font type EXTRUDE, the haloe range is specified in coordinates (suggested around 0.02 in this case).
| const Color& VRS::Text::getHaloeColor | ( | ) | const |
Returns the color used for the haloe effect.
| void VRS::Text::setHaloeColor | ( | const Color & | color | ) |
Sets a new color for the haloe effect.
| TextPlane VRS::Text::getTextPlane | ( | ) | const |
Returns the plane in which the text is painted.
| void VRS::Text::setTextPlane | ( | TextPlane | textplane | ) |
Sets the plane in which the text is painted.
| AlignmentH VRS::Text::getAlignmentH | ( | ) | const |
Returns the horizontal alignment of the text.
Alignment only affects 3D fonts (TEXTURE, POLYGON, OUTLINE, EXTRUDE).
| void VRS::Text::setAlignmentH | ( | AlignmentH | newAlignment | ) |
Sets a new value for the horizontal alignment of the text.
Alignment only affects 3D fonts (TEXTURE, POLYGON, OUTLINE, EXTRUDE).
| AlignmentV VRS::Text::getAlignmentV | ( | ) | const |
Returns the vertical alignment of the text.
Alignment only affects 3D fonts (TEXTURE, POLYGON, OUTLINE, EXTRUDE).
| void VRS::Text::setAlignmentV | ( | AlignmentV | newAlignment | ) |
Sets a new value for the vertical alignment of the text.
Alignment only affects 3D fonts (TEXTURE, POLYGON, OUTLINE, EXTRUDE).
| bool VRS::Text::useModulateForTexturing | ( | ) | const |
| void VRS::Text::setUseModulateForTexturing | ( | bool | useModulateForTexturing | ) |
Specifies if the texture function is MODULATE or REPLACE for a TEXTURE font.
| virtual Bounds VRS::Text::boundingBox | ( | ) | const [virtual] |
| virtual void VRS::Text::modified | ( | ) | [virtual] |
Reimplemented from VRS::SharedObj.
| VRS::Text::VRS_SERIALIZABLE | ( | Text | ) |
friend class TextPainterGL [friend] |