Inheritance:
Public Methods
-
Text()
-
Text(const Text& text, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY)
-
virtual osg::Object* cloneType() const
-
virtual osg::Object* clone(const osg::CopyOp& copyop) const
-
virtual bool isSameKindAs(const osg::Object* obj) const
-
virtual const char* className() const
-
virtual const char* libraryName() const
-
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 setFontSize(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 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)
-
AxisAlignment getAxisAlignment() const
-
void setRotation(const osg::Quat& quat)
-
const osg::Quat& getRotation() 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
-
virtual void drawImplementation(osg::State& state) const
- Draw the text
-
virtual bool supports(osg::Drawable::AttributeFunctor&) const
- return false, osgText::Text does not support accept(AttributeFunctor&)
-
virtual bool supports(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(osg::Drawable::PrimitiveFunctor&) const
- return true, osgText::Text does support accept(PrimitiveFunctor&)
-
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
-
enum AlignmentType
-
enum AxisAlignment
-
enum Layout
-
enum DrawModeMask
Protected Fields
-
osg::ref_ptr<Font> _font
-
unsigned int _fontWidth
-
unsigned int _fontHeight
-
float _characterHeight
-
float _characterAspectRatio
-
float _maximumWidth
-
float _maximumHeight
-
String _text
-
osg::Vec3 _position
-
AlignmentType _alignment
-
AxisAlignment _axisAlignment
-
osg::Quat _rotation
-
Layout _layout
-
osg::Vec4 _color
-
unsigned int _drawMode
-
TextureGlyphQuadMap _textureGlyphQuadMap
-
osg::Matrix _matrix
-
osg::Vec3 _offset
-
mutable osg::BoundingBox _textBB
Protected Methods
-
virtual ~Text()
-
virtual bool computeBound() const
-
Font* getActiveFont()
-
const Font* getActiveFont() const
-
void computeGlyphRepresentation()
-
void computePositions()
Protected Members
-
struct GlyphQuads
-
typedef std::map<osg::ref_ptr<osg::StateSet>,GlyphQuads> TextureGlyphQuadMap
Documentation
Text()
Text(const Text& text, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY)
virtual osg::Object* cloneType() const
virtual osg::Object* clone(const osg::CopyOp& copyop) const
virtual bool isSameKindAs(const osg::Object* obj) const
virtual const char* className() const
virtual const char* libraryName() const
void setFont(Font* font=0)
- Set the Font to use to render the text.
setFont(0) sets the use of the default font.
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. Return 0 if default is being used.
void 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.
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.
The encoding parameter specificies which Unicode encodeding is used in the std::string.
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.
Note, if you modify the string you must call Text::update() for
the internal glyph reprentation to be updated.
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 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
float getMaximumWidth() const
- Get the maximim width of the text box
void 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
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
enum AlignmentType
LEFT_TOP
LEFT_CENTER
LEFT_BOTTOM
CENTER_TOP
CENTER_CENTER
CENTER_BOTTOM
RIGHT_TOP
RIGHT_CENTER
RIGHT_BOTTOM
BASE_LINE
void setAlignment(AlignmentType alignment)
AlignmentType getAlignment() const
enum AxisAlignment
XY_PLANE
XZ_PLANE
YZ_PLANE
SCREEN
void setAxisAlignment(AxisAlignment axis)
AxisAlignment getAxisAlignment() const
void setRotation(const osg::Quat& quat)
const osg::Quat& getRotation() const
enum Layout
LEFT_TO_RIGHT
RIGHT_TO_LEFT
- default
VERTICAL
void setLayout(Layout layout)
Layout getLayout() const
void setColor(const osg::Vec4& color)
const osg::Vec4& getColor() const
enum DrawModeMask
TEXT
BOUNDINGBOX
- default
ALIGNMENT
void setDrawMode(unsigned int mode)
unsigned int getDrawMode() const
virtual void drawImplementation(osg::State& state) const
- Draw the text
virtual bool supports(osg::Drawable::AttributeFunctor&) const
- return false, osgText::Text does not support accept(AttributeFunctor&)
virtual bool supports(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(osg::Drawable::PrimitiveFunctor&) const
- return true, osgText::Text does support accept(PrimitiveFunctor&)
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
virtual ~Text()
virtual bool computeBound() const
Font* getActiveFont()
const Font* getActiveFont() const
osg::ref_ptr<Font> _font
unsigned int _fontWidth
unsigned int _fontHeight
float _characterHeight
float _characterAspectRatio
float _maximumWidth
float _maximumHeight
String _text
osg::Vec3 _position
AlignmentType _alignment
AxisAlignment _axisAlignment
osg::Quat _rotation
Layout _layout
osg::Vec4 _color
unsigned int _drawMode
struct GlyphQuads
typedef std::vector<osg::Vec2> Coords
typedef std::vector<osg::Vec2> TexCoords
Coords _coords
TexCoords _texcoords
typedef std::map<osg::ref_ptr<osg::StateSet>,GlyphQuads> TextureGlyphQuadMap
TextureGlyphQuadMap _textureGlyphQuadMap
void computeGlyphRepresentation()
osg::Matrix _matrix
osg::Vec3 _offset
mutable osg::BoundingBox _textBB
void 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++.