Gazebo Rendering

API Reference

3.7.2

Base implementation of a text geometry. More...

#include <BaseText.hh>

Public Member Functions

virtual ~BaseText ()
 Destructor. More...
 
virtual gz::math::AxisAlignedBox AABB () const override
 Get the axis aligned bounding box of the text. More...
 
virtual float Baseline () const override
 Get the baseline height in meters. More...
 
virtual float CharHeight () const override
 Get the height of the characters in meters return Height of the characters. More...
 
virtual gz::math::Color Color () const override
 Get the text color. More...
 
virtual void Destroy () override
 Destroy any resources associated with this object. Invoking any other functions after destroying an object will result in undefined behavior. More...
 
std::string FontName () const override
 Get the font name. More...
 
virtual TextHorizontalAlign HorizontalAlignment () const override
 Get the horizontal alignment of the text. More...
 
virtual void PreRender () override
 Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender. More...
 
virtual void SetBaseline (const float _baseline) override
 Set the baseline height of the text. More...
 
virtual void SetCharHeight (const float _height) override
 Set the height of the character in meters. More...
 
virtual void SetColor (const gz::math::Color &_color) override
 Set the text color. More...
 
void SetFontName (const std::string &_font) override
 Set the font. More...
 
void SetShowOnTop (const bool _onTop) override
 True = text always is displayed ontop. More...
 
virtual void SetSpaceWidth (const float _width) override
 Set the width of spaces between words. More...
 
virtual void SetTextAlignment (const TextHorizontalAlign &_hAlign, const TextVerticalAlign &_vAlign) override
 Set the alignment of the text. More...
 
virtual void SetTextString (const std::string &_text) override
 Set the text to display. More...
 
virtual bool ShowOnTop () const override
 Get whether the is displayed above other objects. More...
 
virtual float SpaceWidth () const override
 Get the width of spaces between words. More...
 
virtual std::string TextString () const override
 Get the displayed text. More...
 
virtual TextVerticalAlign VerticalAlignment () const override
 Get the vertical alignment of the text. More...
 
- Public Member Functions inherited from Text
 Text ()=default
 Constructor. More...
 
virtual ~Text ()=default
 Destructor. More...
 
- Public Member Functions inherited from Geometry
virtual ~Geometry ()
 Deconstructor. More...
 
virtual bool HasParent () const =0
 Determine if this Geometry is attached to a Visual. More...
 
virtual MaterialPtr Material () const =0
 Get the material of this geometry. More...
 
virtual VisualPtr Parent () const =0
 Get the parent Visual. More...
 
virtual void RemoveParent ()=0
 Detach this Geometry from its parent Visual. If this Geometry does not have a parent, no work will be done. More...
 
virtual void SetMaterial (const std::string &_name, bool _unique=true)=0
 Set the materials of this Geometry. The specified material will be retrieved from the parent Scene. If no material is registered by the given name, no work will be done. More...
 
virtual void SetMaterial (MaterialPtr _material, bool _unique=true)=0
 Set the materials of this Geometry. More...
 
- Public Member Functions inherited from Object
virtual ~Object ()
 Destructor. More...
 
virtual unsigned int Id () const =0
 Get the object ID. This ID will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual std::string Name () const =0
 Get the object name. This name will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual void PostRender ()=0
 Post process this object and any of its children after rendering. More...
 
virtual ScenePtr Scene () const =0
 Get the Scene that created this object. More...
 

Protected Member Functions

 BaseText ()
 Constructor. More...
 

Protected Attributes

float baseline = 0
 Baseline height in meters. More...
 
float charHeight = 1.0
 Character height in meters. More...
 
gz::math::Color color = gz::math::Color::White
 Text color. More...
 
std::string fontName = "Liberation Sans"
 Font name, such as "Liberation Sans". More...
 
TextHorizontalAlign horizontalAlign
 Horizontal alignment. More...
 
bool onTop = false
 True for text to be displayed on top of other objects in the scene. More...
 
float spaceWidth = 0
 Width of space between letters. More...
 
std::string text
 Text being displayed. More...
 
bool textDirty = false
 Flag to indicate text properties have changed. More...
 
TextVerticalAlign verticalAlign = TextVerticalAlign::BOTTOM
 Vertical alignment. More...
 

Detailed Description

template<class T>
class ignition::rendering::BaseText< T >

Base implementation of a text geometry.

Constructor & Destructor Documentation

◆ BaseText()

BaseText
protected

Constructor.

◆ ~BaseText()

~BaseText
virtual

Destructor.

Member Function Documentation

◆ AABB()

gz::math::AxisAlignedBox AABB ( ) const
overridevirtual

Get the axis aligned bounding box of the text.

Returns
The axis aligned bounding box.

Implements Text.

◆ Baseline()

float Baseline ( ) const
overridevirtual

Get the baseline height in meters.

Returns
Baseline height
See also
SetBaseline()

Implements Text.

◆ CharHeight()

float CharHeight ( ) const
overridevirtual

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

See also
SetCharHeight()

Implements Text.

◆ Color()

gz::math::Color Color ( ) const
overridevirtual

Get the text color.

Returns
Text color.
See also
SetColor()

Implements Text.

◆ Destroy()

void Destroy ( )
overridevirtual

Destroy any resources associated with this object. Invoking any other functions after destroying an object will result in undefined behavior.

Implements Object.

◆ FontName()

std::string FontName ( ) const
overridevirtual

Get the font name.

Returns
The font name.
See also
SetFontName()

Implements Text.

◆ HorizontalAlignment()

TextHorizontalAlign HorizontalAlignment ( ) const
overridevirtual

Get the horizontal alignment of the text.

Returns
Text horizontal alignment

Implements Text.

◆ PreRender()

void PreRender ( )
overridevirtual

Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender.

Implements Object.

Reimplemented in OgreText.

◆ SetBaseline()

void SetBaseline ( const float  _baseline)
overridevirtual

Set the baseline height of the text.

Parameters
[in]_baselineBaseline height
See also
Baseline()

Implements Text.

Reimplemented in OgreText.

◆ SetCharHeight()

void SetCharHeight ( const float  _height)
overridevirtual

Set the height of the character in meters.

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

Implements Text.

Reimplemented in OgreText.

◆ SetColor()

void SetColor ( const gz::math::Color &  _color)
overridevirtual

Set the text color.

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

Implements Text.

Reimplemented in OgreText.

◆ SetFontName()

void SetFontName ( const std::string _font)
overridevirtual

Set the font.

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

Implements Text.

◆ SetShowOnTop()

void SetShowOnTop ( const bool  _onTop)
overridevirtual

True = text always is displayed ontop.

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

Implements Text.

◆ SetSpaceWidth()

void SetSpaceWidth ( const float  _width)
overridevirtual

Set the width of spaces between words.

Parameters
[in]_widthSpace width
See also
SpaceWidth()

Implements Text.

Reimplemented in OgreText.

◆ SetTextAlignment()

void SetTextAlignment ( const TextHorizontalAlign _hAlign,
const TextVerticalAlign _vAlign 
)
overridevirtual

Set the alignment of the text.

Parameters
[in]_hAlignHorizontal alignment
[in]_vAlignVertical alignment

Implements Text.

Reimplemented in OgreText.

◆ SetTextString()

void SetTextString ( const std::string _text)
overridevirtual

Set the text to display.

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

Implements Text.

Reimplemented in OgreText.

◆ ShowOnTop()

bool ShowOnTop ( ) const
overridevirtual

Get whether the is displayed above other objects.

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

Implements Text.

◆ SpaceWidth()

float SpaceWidth ( ) const
overridevirtual

Get the width of spaces between words.

Returns
Space width
See also
SetSpaceWidth()

Implements Text.

◆ TextString()

std::string TextString ( ) const
overridevirtual

Get the displayed text.

Returns
The displayed text.
See also
SetText()

Implements Text.

◆ VerticalAlignment()

TextVerticalAlign VerticalAlignment ( ) const
overridevirtual

Get the vertical alignment of the text.

Returns
Text verical alignment

Implements Text.

Member Data Documentation

◆ baseline

float baseline = 0
protected

Baseline height in meters.

◆ charHeight

float charHeight = 1.0
protected

Character height in meters.

◆ color

gz::math::Color color = gz::math::Color::White
protected

Text color.

◆ fontName

std::string fontName = "Liberation Sans"
protected

Font name, such as "Liberation Sans".

◆ horizontalAlign

TextHorizontalAlign horizontalAlign
protected
Initial value:

Horizontal alignment.

◆ onTop

bool onTop = false
protected

True for text to be displayed on top of other objects in the scene.

◆ spaceWidth

float spaceWidth = 0
protected

Width of space between letters.

◆ text

std::string text
protected

Text being displayed.

◆ textDirty

bool textDirty = false
protected

Flag to indicate text properties have changed.

◆ verticalAlign

TextVerticalAlign verticalAlign = TextVerticalAlign::BOTTOM
protected

Vertical alignment.


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