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...
 
float GetBaseline () const GAZEBO_DEPRECATED(9.0)
 Get the baseline height in meters. More...
 
float GetCharHeight () const GAZEBO_DEPRECATED(9.0)
 Get the height of the characters in meters return Height of the characters. More...
 
const common::Color GetColor () const GAZEBO_DEPRECATED(9.0)
 Get the text color. More...
 
const std::string & GetFont () const GAZEBO_DEPRECATED(9.0)
 Get the font name. More...
 
bool GetShowOnTop () const GAZEBO_DEPRECATED(9.0)
 True = text is displayed on top. More...
 
float GetSpaceWidth () const GAZEBO_DEPRECATED(9.0)
 Get the width of spaces between words. More...
 
const std::string & GetText () const GAZEBO_DEPRECATED(9.0)
 Get the displayed text. More...
 
void Load (const std::string &_name, const std::string &_text, const std::string &_fontName, float _charHeight, const common::Color &_color) GAZEBO_DEPRECATED(9.0)
 Loads text and font info. 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 common::Color &_color) GAZEBO_DEPRECATED(9.0)
 Set the text color. 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

void _setupGeometry () GAZEBO_DEPRECATED(9.0)
 Setup the geometry. More...
 
void _updateColors () GAZEBO_DEPRECATED(9.0)
 Update colors. More...
 
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

enum HorizAlign

Horizontal alignment.

Enumerator
H_LEFT 

Left alignment.

H_CENTER 

Center alignment.

enum VertAlign

vertical alignment

Enumerator
V_BELOW 

Align below.

V_ABOVE 

Align above.

Constructor & Destructor Documentation

Constructor.

virtual ~MovableText ( )
virtual

Destructor.

Member Function Documentation

void _setupGeometry ( )
protected

Setup the geometry.

Deprecated:
Use SetupGeometry instead
void _updateColors ( )
protected

Update colors.

Deprecated:
Use UpdateColors instead
ignition::math::Box AABB ( )

Get the axis aligned bounding box of the text.

Returns
The axis aligned bounding box.
float Baseline ( ) const

Get the baseline height in meters.

Returns
Baseline height
See Also
SetBaseline()
float CharHeight ( ) const

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

See Also
SetCharHeight()
const ignition::math::Color& Color ( ) const

Get the text color.

Returns
Text color.
See Also
SetColor()
const std::string& FontName ( ) const

Get the font name.

Returns
The font name.
See Also
SetFontName()
float GetBaseline ( ) const

Get the baseline height in meters.

Returns
Baseline height
Deprecated:
See Baseline().
float getBoundingRadius ( ) const
overrideprotected
float GetCharHeight ( ) const

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

Deprecated:
See CharHeight.
const common::Color GetColor ( ) const

Get the text color.

Returns
Texture color.
Deprecated:
See function that returns ignition::math::Color.
const std::string& GetFont ( ) const

Get the font name.

Returns
The font name
Deprecated:
See FontName()
const Ogre::LightList& getLights ( ) const
overrideprotected
const Ogre::MaterialPtr& getMaterial ( ) const
overrideprotected
void getRenderOperation ( Ogre::RenderOperation &  _op)
overrideprotected
bool GetShowOnTop ( ) const

True = text is displayed on top.

Returns
True if MovableText::SetShownOnTop(true) was called.
Deprecated:
See ShowOnTop().
float GetSpaceWidth ( ) const

Get the width of spaces between words.

Returns
Space width
Deprecated:
See SpaceWidth()
float getSquaredViewDepth ( const Ogre::Camera *  _cam) const
overrideprotected
const std::string& GetText ( ) const

Get the displayed text.

Returns
The displayed text.
Deprecated:
See Text()
void getWorldTransforms ( Ogre::Matrix4 *  _xform) const
overrideprotected
void Load ( const std::string &  _name,
const std::string &  _text,
const std::string &  _fontName,
float  _charHeight,
const common::Color _color 
)

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
Deprecated:
See function that accepts ignition::math::Color.
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
void SetBaseline ( const float  _height)

Set the baseline height of the text.

Parameters
[in]_heightBaseline height
See Also
Baseline()
void SetCharHeight ( const float  _height)

Set the height of the character in meters.

Parameters
[in]_heightHeight of the characters.
See Also
CharHeight()
void SetColor ( const common::Color _color)

Set the text color.

Parameters
[in]_colorText color.
Deprecated:
See function that accepts ignition::math::Color.
void SetColor ( const ignition::math::Color &  _color)

Set the text color.

Parameters
[in]_colorText color.
See Also
Color()
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()
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()
void SetSpaceWidth ( const float  _width)

Set the width of spaces between words.

Parameters
[in]_widthSpace width
See Also
SpaceWidth()
void SetText ( const std::string &  _text)

Set the text to display.

Parameters
[in]_textThe text to display.
See Also
Text()
void SetTextAlignment ( const HorizAlign _hAlign,
const VertAlign _vAlign 
)

Set the alignment of the text.

Parameters
[in]_hAlignHorizontal alignment
[in]_vAlignVertical alignment
void SetupGeometry ( )
protected

Setup the geometry.

bool ShowOnTop ( ) const

Get whether the is displayed above other objects.

Returns
True if it is on top.
See Also
SetShowOnTop()
float SpaceWidth ( ) const

Get the width of spaces between words.

Returns
Space width
See Also
SetSpaceWidth()
const std::string& Text ( ) const

Get the displayed text.

Returns
The displayed text.
See Also
SetText()
void Update ( )

Update the text.

void UpdateColors ( )
protected

Update colors.

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

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