17#ifndef GAZEBO_RENDERING_MOVABLETEXT_HH_
18#define GAZEBO_RENDERING_MOVABLETEXT_HH_
23#include <ignition/math/Box.hh>
24#include <ignition/math/Color.hh>
35 class MovableTextPrivate;
43 :
public Ogre::MovableObject,
public Ogre::Renderable
75 public:
void Load(
const std::string &_name,
76 const std::string &_text,
77 const std::string &_fontName =
"Arial",
78 float _charHeight = 1.0,
79 const ignition::math::Color &_color =
80 ignition::math::Color::White);
96 public:
void SetText(
const std::string &_text);
101 public:
const std::string &
Text()
const;
106 public:
void SetColor(
const ignition::math::Color &_color);
111 public:
const ignition::math::Color &
Color()
const;
162 public: ignition::math::Box
AABB();
173 bool _debug =
false)
override;
204 protected:
const Ogre::LightList &
getLights()
const override;
207 private:
const Ogre::AxisAlignedBox &getBoundingBox()
const override;
210 private:
const Ogre::String &getMovableType()
const override;
213 private:
void _notifyCurrentCamera(Ogre::Camera *_cam)
override;
216 private:
void _updateRenderQueue(Ogre::RenderQueue *_queue)
override;
220 private: std::unique_ptr<MovableTextPrivate> dataPtr;
rendering
Definition RenderEngine.hh:31
Movable text.
Definition MovableText.hh:44
void SetupGeometry()
Setup the geometry.
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.
void SetTextAlignment(const HorizAlign &_hAlign, const VertAlign &_vAlign)
Set the alignment of the text.
const std::string & FontName() const
Get the font name.
void SetCharHeight(const float _height)
Set the height of the character in meters.
void UpdateColors()
Update colors.
float CharHeight() const
Get the height of the characters in meters return Height of the characters.
void SetBaseline(const float _height)
Set the baseline height of the text.
MovableText()
Constructor.
float getSquaredViewDepth(const Ogre::Camera *_cam) const override
const ignition::math::Color & Color() const
Get the text color.
void getRenderOperation(Ogre::RenderOperation &_op) override
const std::string & Text() const
Get the displayed text.
const Ogre::MaterialPtr & getMaterial() const override
float SpaceWidth() const
Get the width of spaces between words.
void getWorldTransforms(Ogre::Matrix4 *_xform) const override
void SetText(const std::string &_text)
Set the text to display.
void SetColor(const ignition::math::Color &_color)
Set the text color.
virtual ~MovableText()
Destructor.
HorizAlign
Horizontal alignment.
Definition MovableText.hh:47
@ H_CENTER
Center alignment.
Definition MovableText.hh:51
@ H_LEFT
Left alignment.
Definition MovableText.hh:49
ignition::math::Box AABB()
Get the axis aligned bounding box of the text.
void SetShowOnTop(const bool _show)
True = text always is displayed ontop.
void SetFontName(const std::string &_font)
Set the font.
bool ShowOnTop() const
Get whether the is displayed above other objects.
VertAlign
vertical alignment
Definition MovableText.hh:56
@ V_BELOW
Align below.
Definition MovableText.hh:58
@ V_ABOVE
Align above.
Definition MovableText.hh:60
float getBoundingRadius() const override
float Baseline() const
Get the baseline height in meters.
const Ogre::LightList & getLights() const override
virtual void visitRenderables(Ogre::Renderable::Visitor *_visitor, bool _debug=false) override
void SetSpaceWidth(const float _width)
Set the width of spaces between words.
void Update()
Update the text.
Forward declarations for the common classes.
Definition Animation.hh:27