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)
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 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]AxisAlignment getAxisAlignment() const
[more]void setRotation(const osg::Quat& quat)
[more]const osg::Quat& getRotation() 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]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

Public Members

[more]enum AlignmentType
[more]enum AxisAlignment
[more]enum Layout
[more]enum DrawModeMask

Protected Fields

[more]osg::ref_ptr<Font> _font
[more]unsigned int _fontWidth
[more]unsigned int _fontHeight
[more]float _characterHeight
[more]float _characterAspectRatio
[more]float _maximumWidth
[more]float _maximumHeight
[more]String _text
[more]osg::Vec3 _position
[more]AlignmentType _alignment
[more]AxisAlignment _axisAlignment
[more]osg::Quat _rotation
[more]Layout _layout
[more]osg::Vec4 _color
[more]unsigned int _drawMode
[more]TextureGlyphQuadMap _textureGlyphQuadMap
[more]osg::Matrix _matrix
[more]osg::Vec3 _offset
[more]mutable osg::BoundingBox _textBB

Protected Methods

[more]virtual ~Text()
[more]virtual bool computeBound() const
[more]Font* getActiveFont()
[more]const Font* getActiveFont() const
[more]void computeGlyphRepresentation()
[more]void computePositions()

Protected Members

[more]struct GlyphQuads
[more]typedef std::map<osg::ref_ptr<osg::StateSet>,GlyphQuads> TextureGlyphQuadMap


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)
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

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 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)

oAxisAlignment getAxisAlignment() const

ovoid setRotation(const osg::Quat& quat)

oconst osg::Quat& getRotation() 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

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

ovirtual ~Text()

ovirtual bool computeBound() const

oFont* getActiveFont()

oconst Font* getActiveFont() const

oosg::ref_ptr<Font> _font

ounsigned int _fontWidth

ounsigned int _fontHeight

ofloat _characterHeight

ofloat _characterAspectRatio

ofloat _maximumWidth

ofloat _maximumHeight

oString _text

oosg::Vec3 _position

oAlignmentType _alignment

oAxisAlignment _axisAlignment

oosg::Quat _rotation

oLayout _layout

oosg::Vec4 _color

ounsigned int _drawMode

ostruct GlyphQuads

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

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

oCoords _coords

oTexCoords _texcoords

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

oTextureGlyphQuadMap _textureGlyphQuadMap

ovoid computeGlyphRepresentation()

oosg::Matrix _matrix

oosg::Vec3 _offset

omutable osg::BoundingBox _textBB

ovoid computePositions()


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++.