MovableText Class Reference

Movable text. More...

#include <rendering/rendering.hh>

Inherits MovableObject, and Renderable.

Public Types

enum  HorizAlign { H_LEFT, H_CENTER }
 Horizontal alignment. More...
 
enum  VertAlign { V_BELOW, V_ABOVE }
 vertical alignment More...
 

Public Member Functions

 MovableText ()
 Constructor. More...
 
virtual ~MovableText ()
 Destructor. More...
 
ignition::math::Box AABB ()
 Get the axis aligned bounding box of the text. More...
 
float Baseline () const
 Get the baseline height in meters. More...
 
float CharHeight () const
 Get the height of the characters in meters return Height of the characters. More...
 
const ignition::math::Color & Color () const
 Get the text color. More...
 
const std::string & FontName () const
 Get the font name. More...
 
void Load (const std::string &_name, const std::string &_text, const std::string &_fontName="Arial", float _charHeight=1.0, const ignition::math::Color &_color=ignition::math::Color::White)
 Loads text and font info. More...
 
void SetBaseline (const float _height)
 Set the baseline height of the text. More...
 
void SetCharHeight (const float _height)
 Set the height of the character in meters. More...
 
void SetColor (const ignition::math::Color &_color)
 Set the text color. More...
 
void SetFontName (const std::string &_font)
 Set the font. More...
 
void SetShowOnTop (const bool _show)
 True = text always is displayed ontop. More...
 
void SetSpaceWidth (const float _width)
 Set the width of spaces between words. More...
 
void SetText (const std::string &_text)
 Set the text to display. More...
 
void SetTextAlignment (const HorizAlign &_hAlign, const VertAlign &_vAlign)
 Set the alignment of the text. More...
 
bool ShowOnTop () const
 Get whether the is displayed above other objects. More...
 
float SpaceWidth () const
 Get the width of spaces between words. More...
 
const std::string & Text () const
 Get the displayed text. More...
 
void Update ()
 Update the text. More...
 
virtual void visitRenderables (Ogre::Renderable::Visitor *_visitor, bool _debug=false) override
 

Protected Member Functions

float getBoundingRadius () const override
 
const Ogre::LightList & getLights () const override
 
const Ogre::MaterialPtr & getMaterial () const override
 
void getRenderOperation (Ogre::RenderOperation &_op) override
 
float getSquaredViewDepth (const Ogre::Camera *_cam) const override
 
void getWorldTransforms (Ogre::Matrix4 *_xform) const override
 
void SetupGeometry ()
 Setup the geometry. More...
 
void UpdateColors ()
 Update colors. More...
 

Detailed Description

Movable text.

Member Enumeration Documentation

◆ HorizAlign

enum HorizAlign

Horizontal alignment.

Enumerator
H_LEFT 

Left alignment.

H_CENTER 

Center alignment.

◆ VertAlign

enum VertAlign

vertical alignment

Enumerator
V_BELOW 

Align below.

V_ABOVE 

Align above.

Constructor & Destructor Documentation

◆ MovableText()

Constructor.

◆ ~MovableText()

virtual ~MovableText ( )
virtual

Destructor.

Member Function Documentation

◆ AABB()

ignition::math::Box AABB ( )

Get the axis aligned bounding box of the text.

Returns
The axis aligned bounding box.

◆ Baseline()

float Baseline ( ) const

Get the baseline height in meters.

Returns
Baseline height
See also
SetBaseline()

◆ CharHeight()

float CharHeight ( ) const

Get the height of the characters in meters return Height of the characters.

See also
SetCharHeight()

◆ Color()

const ignition::math::Color& Color ( ) const

Get the text color.

Returns
Text color.
See also
SetColor()

◆ FontName()

const std::string& FontName ( ) const

Get the font name.

Returns
The font name.
See also
SetFontName()

◆ getBoundingRadius()

float getBoundingRadius ( ) const
overrideprotected

◆ getLights()

const Ogre::LightList& getLights ( ) const
overrideprotected

◆ getMaterial()

const Ogre::MaterialPtr& getMaterial ( ) const
overrideprotected

◆ getRenderOperation()

void getRenderOperation ( Ogre::RenderOperation &  _op)
overrideprotected

◆ getSquaredViewDepth()

float getSquaredViewDepth ( const Ogre::Camera *  _cam) const
overrideprotected

◆ getWorldTransforms()

void getWorldTransforms ( Ogre::Matrix4 *  _xform) const
overrideprotected

◆ Load()

void Load ( const std::string &  _name,
const std::string &  _text,
const std::string &  _fontName = "Arial",
float  _charHeight = 1.0,
const ignition::math::Color &  _color = ignition::math::Color::White 
)

Loads text and font info.

Parameters
[in]_nameName of the text object
[in]_textText to render
[in]_fontNameFont to use
[in]_charHeightHeight of the characters
[in]_colorText color

◆ SetBaseline()

void SetBaseline ( const float  _height)

Set the baseline height of the text.

Parameters
[in]_heightBaseline height
See also
Baseline()

◆ SetCharHeight()

void SetCharHeight ( const float  _height)

Set the height of the character in meters.

Parameters
[in]_heightHeight of the characters.
See also
CharHeight()

◆ SetColor()

void SetColor ( const ignition::math::Color &  _color)

Set the text color.

Parameters
[in]_colorText color.
See also
Color()

◆ SetFontName()

void SetFontName ( const std::string &  _font)

Set the font.

Valid fonts are defined on media/fonts/Gazebo.fontdef

Parameters
[in]_fontName of the font
See also
FontName()

◆ SetShowOnTop()

void SetShowOnTop ( const bool  _show)

True = text always is displayed ontop.

Parameters
[in]_showSet to true to render the text on top of all other drawables.
See also
ShowOnTop()

◆ SetSpaceWidth()

void SetSpaceWidth ( const float  _width)

Set the width of spaces between words.

Parameters
[in]_widthSpace width
See also
SpaceWidth()

◆ SetText()

void SetText ( const std::string &  _text)

Set the text to display.

Parameters
[in]_textThe text to display.
See also
Text()

◆ SetTextAlignment()

void SetTextAlignment ( const HorizAlign _hAlign,
const VertAlign _vAlign 
)

Set the alignment of the text.

Parameters
[in]_hAlignHorizontal alignment
[in]_vAlignVertical alignment

◆ SetupGeometry()

void SetupGeometry ( )
protected

Setup the geometry.

◆ ShowOnTop()

bool ShowOnTop ( ) const

Get whether the is displayed above other objects.

Returns
True if it is on top.
See also
SetShowOnTop()

◆ SpaceWidth()

float SpaceWidth ( ) const

Get the width of spaces between words.

Returns
Space width
See also
SetSpaceWidth()

◆ Text()

const std::string& Text ( ) const

Get the displayed text.

Returns
The displayed text.
See also
SetText()

◆ Update()

void Update ( )

Update the text.

◆ UpdateColors()

void UpdateColors ( )
protected

Update colors.

◆ visitRenderables()

virtual void visitRenderables ( Ogre::Renderable::Visitor *  _visitor,
bool  _debug = false 
)
overridevirtual

The documentation for this class was generated from the following file: