|
Public Types |
typedef std::map< osg::ref_ptr<
osg::StateSet >, GlyphQuads > | TextureGlyphQuadMap |
| enum | CharacterSizeMode { OBJECT_COORDS,
SCREEN_COORDS,
OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT
} |
| enum | AlignmentType {
LEFT_TOP,
LEFT_CENTER,
LEFT_BOTTOM,
CENTER_TOP,
CENTER_CENTER,
CENTER_BOTTOM,
RIGHT_TOP,
RIGHT_CENTER,
RIGHT_BOTTOM,
LEFT_BASE_LINE,
CENTER_BASE_LINE,
RIGHT_BASE_LINE,
LEFT_BOTTOM_BASE_LINE,
CENTER_BOTTOM_BASE_LINE,
RIGHT_BOTTOM_BASE_LINE,
BASE_LINE = LEFT_BASE_LINE
} |
| enum | AxisAlignment {
XY_PLANE,
REVERSED_XY_PLANE,
XZ_PLANE,
REVERSED_XZ_PLANE,
YZ_PLANE,
REVERSED_YZ_PLANE,
SCREEN
} |
| enum | Layout { LEFT_TO_RIGHT,
RIGHT_TO_LEFT,
VERTICAL
} |
| enum | DrawModeMask { TEXT = 1,
BOUNDINGBOX = 2,
ALIGNMENT = 4
} |
Public Member Functions |
| | Text () |
| | Text (const Text &text, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) |
| virtual osg::Object * | cloneType () const |
| | Clone the type of an object, with Object* return type.
|
| virtual osg::Object * | clone (const osg::CopyOp ©op) const |
| virtual bool | isSameKindAs (const osg::Object *obj) const |
| virtual const char * | className () const |
| | return the name of the object's class type.
|
| virtual const char * | libraryName () const |
| | return the name of the object's library.
|
| void | setFont (Font *font=0) |
| | Set the Font to use to render the text.
|
| void | setFont (const std::string &fontfile) |
| | Set the font, loaded from the specified front file, to use to render the text, setFont("") sets the use of the default font.
|
| const Font * | getFont () const |
| | Get the font.
|
| void | setFontResolution (unsigned int width, unsigned int height) |
| | Set the Font reference width and height resolution in texels.
|
| unsigned int | getFontWidth () const |
| unsigned int | getFontHeight () const |
| void | setText (const String &text) |
| | Set the text using a osgText::String.
|
| void | setText (const std::string &text) |
| | Set the text using a std::string, which is converted to an internal TextString.
|
| void | setText (const std::string &text, String::Encoding encoding) |
| | Set the text using a Unicode encoded std::string, which is converted to an internal TextString.
|
| void | setText (const wchar_t *text) |
| | Set the text using a wchar_t string, which is converted to an internal TextString.
|
| String & | getText () |
| | Get the text string.
|
| const String & | getText () const |
| | Get the const text string.
|
| void | update () |
| | update internal glyph respresnetation used for rendering, and bounding volume.
|
| void | setCharacterSize (float height, float aspectRatio=1.0f) |
| | Set the rendered character size in object coordinates.
|
| float | getCharacterHeight () const |
| float | getCharacterAspectRatio () const |
| void | setCharacterSizeMode (CharacterSizeMode mode) |
| | Set how the CharacterSize value relates to the final rendered character.
|
| CharacterSizeMode | getCharacterSizeMode () const |
| | Get the CharacterSizeMode.
|
| void | setMaximumWidth (float maximumWidth) |
| | Set the maximum width of the text box.
|
| float | getMaximumWidth () const |
| | Get the maximim width of the text box.
|
| void | setMaximumHeight (float maximumHeight) |
| | Set the maximum height of the text box.
|
| float | getMaximumHeight () const |
| | Get the maximum height of the text box.
|
| void | setPosition (const osg::Vec3 &pos) |
| | Set the position of text.
|
| const osg::Vec3 & | getPosition () const |
| | Get the position of text.
|
| void | setAlignment (AlignmentType alignment) |
| AlignmentType | getAlignment () const |
| void | setAxisAlignment (AxisAlignment axis) |
| void | setRotation (const osg::Quat &quat) |
| const osg::Quat & | getRotation () const |
| void | setAutoRotateToScreen (bool autoRotateToScreen) |
| bool | getAutoRotateToScreen () const |
| void | setLayout (Layout layout) |
| Layout | getLayout () const |
| void | setColor (const osg::Vec4 &color) |
| const osg::Vec4 & | getColor () const |
| void | setDrawMode (unsigned int mode) |
| unsigned int | getDrawMode () const |
| void | setKerningType (KerningType kerningType) |
| KerningType | getKerningType () const |
| unsigned int | getLineCount () |
| | Get the number of wrapped lines - only valid after computeGlyphRepresentation() has been called, returns -1 otherwise.
|
| virtual void | drawImplementation (osg::State &state) const |
| | Draw the text.
|
| virtual bool | supports (const osg::Drawable::AttributeFunctor &) const |
| | return false, osgText::Text does not support accept(AttributeFunctor&).
|
| virtual bool | supports (const osg::Drawable::ConstAttributeFunctor &) const |
| | return true, osgText::Text does support accept(ConstAttributeFunctor&).
|
| virtual void | accept (osg::Drawable::ConstAttributeFunctor &af) const |
| | accept an ConstAttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has.
|
| virtual bool | supports (const osg::PrimitiveFunctor &) const |
| | return true, osgText::Text does support accept(PrimitiveFunctor&) .
|
| virtual void | accept (osg::PrimitiveFunctor &pf) const |
| | accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has.
|
| virtual void | releaseGLObjects (osg::State *state=0) const |
| | If State is non-zero, this function releases OpenGL objects for the specified graphics context.
|
| const GlyphQuads * | getGlyphQuads (osg::StateSet *stateSet) const |
| | Direct Access to GlyphQuads.
|
| const TextureGlyphQuadMap & | getTextureGlyphQuadMap () const |
| virtual osg::BoundingBox | computeBound () const |
| | Compute the bounding box around Drawables's geometry.
|
Protected Member Functions |
| virtual | ~Text () |
| Font * | getActiveFont () |
| const Font * | getActiveFont () const |
| String::iterator | computeLastCharacterOnLine (osg::Vec2 &cursor, String::iterator first, String::iterator last) |
| void | computeGlyphRepresentation () |
| void | computePositions () |
| void | computePositions (unsigned int contextID) const |
Protected Attributes |
| osg::ref_ptr< Font > | _font |
| unsigned int | _fontWidth |
| unsigned int | _fontHeight |
| float | _characterHeight |
| float | _characterAspectRatio |
| CharacterSizeMode | _characterSizeMode |
| float | _maximumWidth |
| float | _maximumHeight |
| String | _text |
| osg::Vec3 | _position |
| AlignmentType | _alignment |
| osg::Quat | _rotation |
| bool | _autoRotateToScreen |
| Layout | _layout |
| osg::Vec4 | _color |
| unsigned int | _drawMode |
| KerningType | _kerningType |
| unsigned int | _lineCount |
| TextureGlyphQuadMap | _textureGlyphQuadMap |
| osg::buffered_object< AutoTransformCache > | _autoTransformCache |
| osg::Vec3 | _offset |
| osg::Vec3 | _normal |
| osg::BoundingBox | _textBB |