Gazebo Rendering

API Reference

6.6.4
gz/rendering/ogre/OgreText.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef GZ_RENDERING_OGRE_OGRETEXT_HH_
19 #define GZ_RENDERING_OGRE_OGRETEXT_HH_
20 
21 #include <memory>
22 #include <string>
23 
24 #include <gz/math/AxisAlignedBox.hh>
25 #include <gz/math/Color.hh>
26 
30 #include "gz/rendering/ogre/Export.hh"
31 
32 namespace ignition
33 {
34  namespace rendering
35  {
36  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
37  //
38  class OgreMovableText;
39  class OgreTextPrivate;
40 
42  class IGNITION_RENDERING_OGRE_VISIBLE OgreText
43  : public BaseText<OgreGeometry>
44  {
46  protected: OgreText();
47 
49  public: virtual ~OgreText();
50 
51  // Documentation inherited
52  public: virtual void Init() override;
53 
54  // Documentation inherited
55  public: virtual void PreRender() override;
56 
57  // Documentation inherited
58  public: virtual Ogre::MovableObject *OgreObject() const override;
59 
60  // Documentation inherited.
61  public: virtual MaterialPtr Material() const override;
62 
63  // Documentation inherited.
64  public: virtual void SetMaterial(MaterialPtr _material, bool _unique)
65  override;
66 
67  // Documentation inherited.
68  public: virtual void SetFontName(const std::string &_font) override;
69 
70  // Documentation inherited.
71  public: virtual void SetTextString(const std::string &_text) override;
72 
73  // Documentation inherited.
74  public: virtual void SetColor(const gz::math::Color &_color)
75  override;
76 
77  // Documentation inherited.
78  public: virtual void SetCharHeight(const float _height) override;
79 
80  // Documentation inherited.
81  public: virtual void SetSpaceWidth(const float _width) override;
82 
83  // Documentation inherited.
84  public: virtual void SetTextAlignment(
85  const TextHorizontalAlign &_horizAlign,
86  const TextVerticalAlign &_vertAlign) override;
87  // Documentation inherited.
88  public: virtual void SetBaseline(const float _baseline) override;
89 
90  // Documentation inherited.
91  public: virtual void SetShowOnTop(const bool _onTop) override;
92 
93  // Documentation inherited.
94  public: virtual gz::math::AxisAlignedBox AABB() const override;
95 
98  protected: virtual void SetMaterialImpl(OgreMaterialPtr _material);
99 
101  private: friend class OgreScene;
102 
105  private: std::unique_ptr<OgreTextPrivate> dataPtr;
106  };
107  }
108  }
109 }
110 #endif
Base implementation of a text geometry.
Definition: gz/rendering/base/BaseText.hh:35
Definition: gz/rendering/ogre/OgreScene.hh:41
Ogre implementation of text geometry.
Definition: gz/rendering/ogre/OgreText.hh:44
virtual Ogre::MovableObject * OgreObject() const override
virtual void SetSpaceWidth(const float _width) override
Set the width of spaces between words.
virtual void SetMaterial(MaterialPtr _material, bool _unique) override
Set the materials of this Geometry.
virtual void SetColor(const gz::math::Color &_color) override
Set the text color.
virtual gz::math::AxisAlignedBox AABB() const override
Get the axis aligned bounding box of the text.
virtual void PreRender() override
Prepare this object and any of its children for rendering. This should be called for each object in a...
virtual ~OgreText()
Destructor.
virtual void SetTextString(const std::string &_text) override
Set the text to display.
virtual void SetBaseline(const float _baseline) override
Set the baseline height of the text.
virtual void SetFontName(const std::string &_font) override
Set the font.
virtual MaterialPtr Material() const override
Get the material of this geometry.
virtual void SetShowOnTop(const bool _onTop) override
True = text always is displayed ontop.
virtual void SetTextAlignment(const TextHorizontalAlign &_horizAlign, const TextVerticalAlign &_vertAlign) override
Set the alignment of the text.
virtual void SetMaterialImpl(OgreMaterialPtr _material)
Set material to text geometry.
virtual void Init() override
virtual void SetCharHeight(const float _height) override
Set the height of the character in meters.
TextVerticalAlign
Text vertical alignment.
Definition: gz/rendering/Text.hh:50
TextHorizontalAlign
Text Horizontal alignment.
Definition: gz/rendering/Text.hh:38