Go to the documentation of this file.
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);
86 public:
void SetFontName(
const std::string &_font);
91 public:
const std::string &FontName()
const;
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;
116 public:
void SetCharHeight(
const float _height);
121 public:
float CharHeight()
const;
126 public:
void SetSpaceWidth(
const float _width);
131 public:
float SpaceWidth()
const;
136 public:
void SetTextAlignment(
const HorizAlign &_hAlign,
137 const VertAlign &_vAlign);
142 public:
void SetBaseline(
const float _height);
147 public:
float Baseline()
const;
153 public:
void SetShowOnTop(
const bool _show);
158 public:
bool ShowOnTop()
const;
162 public: ignition::math::Box AABB();
165 public:
void Update();
172 public:
virtual void visitRenderables(Ogre::Renderable::Visitor *_visitor,
173 bool _debug =
false)
override;
176 protected:
void SetupGeometry();
179 protected:
void UpdateColors();
183 protected:
void getWorldTransforms(Ogre::Matrix4 *_xform)
const override;
187 protected:
float getBoundingRadius()
const override;
191 protected:
float getSquaredViewDepth(
const Ogre::Camera *_cam)
const
196 protected:
void getRenderOperation(Ogre::RenderOperation &_op)
override;
200 protected:
const Ogre::MaterialPtr &getMaterial()
const 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;
virtual void visitRenderables(Ogre::Renderable::Visitor *_visitor, bool _debug=false) override
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.
Forward declarations for the common classes.
Definition: Animation.hh:26
const ignition::math::Color & Color() const
Get the text color.
void SetCharHeight(const float _height)
Set the height of the character in meters.
void SetShowOnTop(const bool _show)
True = text always is displayed ontop.
float getBoundingRadius() const override
MovableText()
Constructor.
@ V_ABOVE
Align above.
Definition: MovableText.hh:60
virtual ~MovableText()
Destructor.
void Update()
Update the text.
float CharHeight() const
Get the height of the characters in meters return Height of the characters.
float getSquaredViewDepth(const Ogre::Camera *_cam) const override
VertAlign
vertical alignment
Definition: MovableText.hh:56
void getRenderOperation(Ogre::RenderOperation &_op) override
void SetText(const std::string &_text)
Set the text to display.
HorizAlign
Horizontal alignment.
Definition: MovableText.hh:47
void SetupGeometry()
Setup the geometry.
const Ogre::MaterialPtr & getMaterial() const override
rendering
Definition: RenderEngine.hh:31
bool ShowOnTop() const
Get whether the is displayed above other objects.
const std::string & Text() const
Get the displayed text.
void getWorldTransforms(Ogre::Matrix4 *_xform) const override
void SetFontName(const std::string &_font)
Set the font.
@ H_LEFT
Left alignment.
Definition: MovableText.hh:49
void SetColor(const ignition::math::Color &_color)
Set the text color.
const Ogre::LightList & getLights() const override
void SetTextAlignment(const HorizAlign &_hAlign, const VertAlign &_vAlign)
Set the alignment of the text.
void SetBaseline(const float _height)
Set the baseline height of the text.
float SpaceWidth() const
Get the width of spaces between words.
void UpdateColors()
Update colors.
Movable text.
Definition: MovableText.hh:42
const std::string & FontName() const
Get the font name.
@ H_CENTER
Center alignment.
Definition: MovableText.hh:51
@ V_BELOW
Align below.
Definition: MovableText.hh:58
ignition::math::Box AABB()
Get the axis aligned bounding box of the text.
void SetSpaceWidth(const float _width)
Set the width of spaces between words.
float Baseline() const
Get the baseline height in meters.