class OSGTEXT_EXPORT osgText::Text


Inheritance:


Public Methods

[more] Text()
[more] Text(const Text& text, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY)
[more]virtual osg::Object* cloneType() const
[more]virtual osg::Object* clone(const osg::CopyOp& copyop) const
[more]virtual bool isSameKindAs(const osg::Object* obj) const
[more]virtual const char* className() const
[more]virtual const char* libraryName() const
[more]void setFont(Font* font=0)
Set the Font to use to render the text.
[more]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
[more]const Font* getFont() const
Get the font.
[more]void setFontSize(unsigned int width, unsigned int height)
[more]void setFontResolution(unsigned int width, unsigned int height)
Set the Font reference width and height resolution in texels.
[more]unsigned int getFontWidth() const
[more]unsigned int getFontHeight() const
[more]void setText(const String& text)
Set the text using a osgText::String
[more]void setText(const std::string& text)
Set the text using a std::string, which is converted to an internal TextString
[more]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.
[more]void setText(const wchar_t* text)
Set the text using a wchar_t string, which is converted to an internal TextString
[more]String& getText()
Get the text string.
[more]const String& getText() const
Get the const text string
[more]void update()
update internal glyph respresnetation used for rendering, and bounding volume
[more]void setCharacterSize(float height, float aspectRatio=1.0f)
Set the rendered character size in object coordinates
[more]float getCharacterHeight() const
[more]float getCharacterAspectRatio() const
[more]void setCharacterSizeMode(CharacterSizeMode mode)
Set how the CharacterSize value relates to the final rendered character
[more]CharacterSizeMode getCharacterSizeMode() const
Get the CharacterSizeMode
[more]void setMaximumWidth(float maximumWidth)
Set the maximum width of the text box.
[more]float getMaximumWidth() const
Get the maximim width of the text box
[more]void setMaximumHeight(float maximumHeight)
Set the maximum height of the text box.
[more]float getMaximumHeight() const
Get the maximum height of the text box
[more]void setPosition(const osg::Vec3& pos)
Set the position of text
[more]const osg::Vec3& getPosition() const
Get the position of text
[more]void setAlignment(AlignmentType alignment)
[more]AlignmentType getAlignment() const
[more]void setAxisAlignment(AxisAlignment axis)
[more]void setRotation(const osg::Quat& quat)
[more]const osg::Quat& getRotation() const
[more]void setAutoRotateToScreen(bool autoRotateToScreen)
[more]bool getAutoRotateToScreen() const
[more]void setLayout(Layout layout)
[more]Layout getLayout() const
[more]void setColor(const osg::Vec4& color)
[more]const osg::Vec4& getColor() const
[more]void setDrawMode(unsigned int mode)
[more]unsigned int getDrawMode() const
[more]void setKerningType(KerningType kerningType)
[more]KerningType getKerningType() const
[more]virtual void drawImplementation(osg::State& state) const
Draw the text
[more]virtual bool supports(osg::Drawable::AttributeFunctor&) const
return false, osgText::Text does not support accept(AttributeFunctor&)
[more]virtual bool supports(osg::Drawable::ConstAttributeFunctor&) const
return true, osgText::Text does support accept(ConstAttributeFunctor&)
[more]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
[more]virtual bool supports(osg::Drawable::PrimitiveFunctor&) const
return true, osgText::Text does support accept(PrimitiveFunctor&)
[more]virtual void accept(osg::Drawable::PrimitiveFunctor& pf) const
accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has
[more]const GlyphQuads* getGlyphQuads(osg::StateSet* stateSet) const
Direct Access to GlyphQuads

Public Members

[more]enum CharacterSizeMode
[more]enum AlignmentType
[more]enum AxisAlignment
[more]enum Layout
[more]enum DrawModeMask
[more]struct OSGTEXT_EXPORT GlyphQuads
[more]typedef std::map<osg::ref_ptr<osg::StateSet>,GlyphQuads> TextureGlyphQuadMap

Protected Fields

[more]osg::ref_ptr<Font> _font
[more]unsigned int _fontWidth
[more]unsigned int _fontHeight
[more]float _characterHeight
[more]float _characterAspectRatio
[more]CharacterSizeMode _characterSizeMode
[more]float _maximumWidth
[more]float _maximumHeight
[more]String _text
[more]osg::Vec3 _position
[more]AlignmentType _alignment
[more]osg::Quat _rotation
[more]bool _autoRotateToScreen
[more]Layout _layout
[more]osg::Vec4 _color
[more]unsigned int _drawMode
[more]KerningType _kerningType
[more]mutable TextureGlyphQuadMap _textureGlyphQuadMap
[more]mutable osg::buffered_object<AutoTransformCache> _autoTransformCache
[more]mutable osg::Vec3 _offset
[more]mutable osg::Vec3 _normal
[more]mutable osg::BoundingBox _textBB

Protected Methods

[more]virtual ~Text()
[more]virtual bool computeBound() const
[more]Font* getActiveFont()
[more]const Font* getActiveFont() const
[more]String::iterator computeLastCharacterOnLine(osg::Vec2 cursor, String::iterator first, String::iterator last)
[more]void computeGlyphRepresentation()
[more]void computePositions()
[more]void computePositions(unsigned int contextID) const

Protected Members

[more]struct AutoTransformCache


Documentation

o Text()

o Text(const Text& text, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY)

ovirtual osg::Object* cloneType() const

ovirtual osg::Object* clone(const osg::CopyOp& copyop) const

ovirtual bool isSameKindAs(const osg::Object* obj) const

ovirtual const char* className() const

ovirtual const char* libraryName() const

ovoid setFont(Font* font=0)
Set the Font to use to render the text. setFont(0) sets the use of the default font.

ovoid 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

oconst Font* getFont() const
Get the font. Return 0 if default is being used.

ovoid setFontSize(unsigned int width, unsigned int height)

ovoid setFontResolution(unsigned int width, unsigned int height)
Set the Font reference width and height resolution in texels. Note, the size may not be supported by current font, the closest supported font size will be selected.

ounsigned int getFontWidth() const

ounsigned int getFontHeight() const

ovoid setText(const String& text)
Set the text using a osgText::String

ovoid setText(const std::string& text)
Set the text using a std::string, which is converted to an internal TextString

ovoid setText(const std::string& text, String::Encoding encoding)
Set the text using a Unicode encoded std::string, which is converted to an internal TextString. The encoding parameter specificies which Unicode encodeding is used in the std::string.

ovoid setText(const wchar_t* text)
Set the text using a wchar_t string, which is converted to an internal TextString

oString& getText()
Get the text string. Note, if you modify the string you must call Text::update() for the internal glyph reprentation to be updated.

oconst String& getText() const
Get the const text string

ovoid update()
update internal glyph respresnetation used for rendering, and bounding volume

ovoid setCharacterSize(float height, float aspectRatio=1.0f)
Set the rendered character size in object coordinates

ofloat getCharacterHeight() const

ofloat getCharacterAspectRatio() const

oenum CharacterSizeMode

o OBJECT_COORDS

o SCREEN_COORDS
default

o OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT
internally scale the characters to be constant screen size

ovoid setCharacterSizeMode(CharacterSizeMode mode)
Set how the CharacterSize value relates to the final rendered character

oCharacterSizeMode getCharacterSizeMode() const
Get the CharacterSizeMode

ovoid setMaximumWidth(float maximumWidth)
Set the maximum width of the text box. With horizontal layouts any characters which do not fit are wrapped around. 0 or negative values indicate that no maximum width is set, lines can be as long as they need be to fit thre required text

ofloat getMaximumWidth() const
Get the maximim width of the text box

ovoid setMaximumHeight(float maximumHeight)
Set the maximum height of the text box. With horizontal layouts any characters which do not fit are wrapped around. 0 or negative values indicate that no maximum height is set, lines can be as long as they need be to fit thre required text

ofloat getMaximumHeight() const
Get the maximum height of the text box

ovoid setPosition(const osg::Vec3& pos)
Set the position of text

oconst osg::Vec3& getPosition() const
Get the position of text

oenum AlignmentType

o LEFT_TOP

o LEFT_CENTER

o LEFT_BOTTOM

o CENTER_TOP

o CENTER_CENTER

o CENTER_BOTTOM

o RIGHT_TOP

o RIGHT_CENTER

o RIGHT_BOTTOM

o LEFT_BASE_LINE

o CENTER_BASE_LINE

o RIGHT_BASE_LINE

o BASE_LINE

ovoid setAlignment(AlignmentType alignment)

oAlignmentType getAlignment() const

oenum AxisAlignment

o XY_PLANE

o XZ_PLANE

o YZ_PLANE

o SCREEN

ovoid setAxisAlignment(AxisAlignment axis)

ovoid setRotation(const osg::Quat& quat)

oconst osg::Quat& getRotation() const

ovoid setAutoRotateToScreen(bool autoRotateToScreen)

obool getAutoRotateToScreen() const

oenum Layout

o LEFT_TO_RIGHT

o RIGHT_TO_LEFT
default

o VERTICAL

ovoid setLayout(Layout layout)

oLayout getLayout() const

ovoid setColor(const osg::Vec4& color)

oconst osg::Vec4& getColor() const

oenum DrawModeMask

o TEXT

o BOUNDINGBOX
default

o ALIGNMENT

ovoid setDrawMode(unsigned int mode)

ounsigned int getDrawMode() const

ovoid setKerningType(KerningType kerningType)

oKerningType getKerningType() const

ovirtual void drawImplementation(osg::State& state) const
Draw the text

ovirtual bool supports(osg::Drawable::AttributeFunctor&) const
return false, osgText::Text does not support accept(AttributeFunctor&)

ovirtual bool supports(osg::Drawable::ConstAttributeFunctor&) const
return true, osgText::Text does support accept(ConstAttributeFunctor&)

ovirtual 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

ovirtual bool supports(osg::Drawable::PrimitiveFunctor&) const
return true, osgText::Text does support accept(PrimitiveFunctor&)

ovirtual void accept(osg::Drawable::PrimitiveFunctor& pf) const
accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has

ostruct OSGTEXT_EXPORT GlyphQuads

otypedef std::vector<Font::Glyph*> Glyphs

otypedef std::vector<osg::Vec2> Coords2

otypedef std::vector<osg::Vec3> Coords3

otypedef std::vector<osg::Vec2> TexCoords

oGlyphs _glyphs

oCoords2 _coords

oosg::buffered_object<Coords3> _transformedCoords

oTexCoords _texcoords

oGlyphs getGlyphs()

oconst Glyphs getGlyphs() const

oCoords2& getCoords()

oconst Coords2& getCoords() const

oCoords3& getTransformedCoords(unsigned int contexID)

oconst Coords3& getTransformedCoords(unsigned int contexID) const

oTexCoords& getTexCoords()

oconst TexCoords& getTexCoords() const

otypedef std::map<osg::ref_ptr<osg::StateSet>,GlyphQuads> TextureGlyphQuadMap

oconst GlyphQuads* getGlyphQuads(osg::StateSet* stateSet) const
Direct Access to GlyphQuads

ovirtual ~Text()

ovirtual bool computeBound() const

oFont* getActiveFont()

oconst Font* getActiveFont() const

oString::iterator computeLastCharacterOnLine(osg::Vec2 cursor, String::iterator first, String::iterator last)

oosg::ref_ptr<Font> _font

ounsigned int _fontWidth

ounsigned int _fontHeight

ofloat _characterHeight

ofloat _characterAspectRatio

oCharacterSizeMode _characterSizeMode

ofloat _maximumWidth

ofloat _maximumHeight

oString _text

oosg::Vec3 _position

oAlignmentType _alignment

oosg::Quat _rotation

obool _autoRotateToScreen

oLayout _layout

oosg::Vec4 _color

ounsigned int _drawMode

oKerningType _kerningType

omutable TextureGlyphQuadMap _textureGlyphQuadMap

ovoid computeGlyphRepresentation()

ostruct AutoTransformCache

o AutoTransformCache()

oint _traversalNumber

oint _width

oint _height

oosg::Vec3 _transformedPosition

oosg::Matrix _modelview

oosg::Matrix _projection

oosg::Matrix _matrix

omutable osg::buffered_object<AutoTransformCache> _autoTransformCache

omutable osg::Vec3 _offset

omutable osg::Vec3 _normal

omutable osg::BoundingBox _textBB

ovoid computePositions()

ovoid computePositions(unsigned int contextID) const


This class has no child classes.
Friends:
class Font

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.