##

MovableText.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_RENDERING_MOVABLETEXT_HH_
#define GAZEBO_RENDERING_MOVABLETEXT_HH_
#include <memory>
#include <string>
#include <ignition/math/Box.hh>
#include <ignition/math/Color.hh>
// TODO: remove this line
#include "gazebo/rendering/ogre_gazebo.h"
#include "gazebo/common/Color.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace rendering
{
class MovableTextPrivate;
class GZ_RENDERING_VISIBLE MovableText
: public Ogre::MovableObject, public Ogre::Renderable
{
public: enum HorizAlign {
H_LEFT,
H_CENTER
};
public: enum VertAlign {
V_BELOW,
V_ABOVE
};
public: MovableText();
public: virtual ~MovableText();
public: void Load(const std::string &_name,
const std::string &_text,
const std::string &_fontName,
float _charHeight,
const common::Color &_color)
GAZEBO_DEPRECATED(9.0);
public: 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);
public: void SetFontName(const std::string &_font);
public: const std::string &GetFont() const GAZEBO_DEPRECATED(9.0);
public: const std::string &FontName() const;
public: void SetText(const std::string &_text);
public: const std::string &GetText() const GAZEBO_DEPRECATED(9.0);
public: const std::string &Text() const;
public: void SetColor(const common::Color &_color) GAZEBO_DEPRECATED(9.0);
public: void SetColor(const ignition::math::Color &_color);
public: const common::Color GetColor() const GAZEBO_DEPRECATED(9.0);
public: const ignition::math::Color &Color() const;
public: void SetCharHeight(const float _height);
public: float GetCharHeight() const GAZEBO_DEPRECATED(9.0);
public: float CharHeight() const;
public: void SetSpaceWidth(const float _width);
public: float GetSpaceWidth() const GAZEBO_DEPRECATED(9.0);
public: float SpaceWidth() const;
public: void SetTextAlignment(const HorizAlign &_hAlign,
const VertAlign &_vAlign);
public: void SetBaseline(const float _height);
public: float GetBaseline() const GAZEBO_DEPRECATED(9.0);
public: float Baseline() const;
public: void SetShowOnTop(const bool _show);
public: bool GetShowOnTop() const GAZEBO_DEPRECATED(9.0);
public: bool ShowOnTop() const;
public: ignition::math::Box AABB();
public: void Update();
public: virtual void visitRenderables(Ogre::Renderable::Visitor *_visitor,
bool _debug = false) override;
protected: void _setupGeometry() GAZEBO_DEPRECATED(9.0);
protected: void SetupGeometry();
protected: void _updateColors() GAZEBO_DEPRECATED(9.0);
protected: void UpdateColors();
protected: void getWorldTransforms(Ogre::Matrix4 *_xform) const override;
protected: float getBoundingRadius() const override;
protected: float getSquaredViewDepth(const Ogre::Camera *_cam) const
override;
protected: void getRenderOperation(Ogre::RenderOperation &_op) override;
protected: const Ogre::MaterialPtr &getMaterial() const override;
protected: const Ogre::LightList &getLights() const override;
private: const Ogre::AxisAlignedBox &getBoundingBox() const override;
private: const Ogre::String &getMovableType() const override;
private: void _notifyCurrentCamera(Ogre::Camera *_cam) override;
private: void _updateRenderQueue(Ogre::RenderQueue *_queue) override;
private: std::unique_ptr<MovableTextPrivate> dataPtr;
};
}
}
#endif
gazebo::rendering::MovableText::GetSpaceWidth
float GetSpaceWidth() const GAZEBO_DEPRECATED(9.0)
Get the width of spaces between words.
gazebo::rendering::MovableText::visitRenderables
virtual void visitRenderables(Ogre::Renderable::Visitor *_visitor, bool _debug=false) override
gazebo::rendering::MovableText::_setupGeometry
void _setupGeometry() GAZEBO_DEPRECATED(9.0)
Setup the geometry.
Ogre
Definition: JointMaker.hh:39
ignition
Definition: Model.hh:40
gazebo::rendering::MovableText::GetText
const std::string & GetText() const GAZEBO_DEPRECATED(9.0)
Get the displayed text.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::rendering::MovableText::Color
const ignition::math::Color & Color() const
Get the text color.
gazebo::rendering::MovableText::SetCharHeight
void SetCharHeight(const float _height)
Set the height of the character in meters.
gazebo::rendering::MovableText::GetCharHeight
float GetCharHeight() const GAZEBO_DEPRECATED(9.0)
Get the height of the characters in meters return Height of the characters.
gazebo::rendering::MovableText::GetShowOnTop
bool GetShowOnTop() const GAZEBO_DEPRECATED(9.0)
True = text is displayed on top.
gazebo::rendering::MovableText::SetShowOnTop
void SetShowOnTop(const bool _show)
True = text always is displayed ontop.
gazebo::rendering::MovableText::getBoundingRadius
float getBoundingRadius() const override
common
common
Definition: FuelModelDatabase.hh:37
gazebo::rendering::MovableText::MovableText
MovableText()
Constructor.
system.hh
gazebo::rendering::MovableText::V_ABOVE
Align above.
Definition: MovableText.hh:61
gazebo::rendering::MovableText::~MovableText
virtual ~MovableText()
Destructor.
gazebo::rendering::MovableText::Update
void Update()
Update the text.
gazebo::rendering::MovableText::CharHeight
float CharHeight() const
Get the height of the characters in meters return Height of the characters.
gazebo::rendering::MovableText::getSquaredViewDepth
float getSquaredViewDepth(const Ogre::Camera *_cam) const override
gazebo::rendering::MovableText::VertAlign
VertAlign
vertical alignment
Definition: MovableText.hh:57
gazebo::rendering::MovableText::getRenderOperation
void getRenderOperation(Ogre::RenderOperation &_op) override
gazebo::rendering::MovableText::_updateColors
void _updateColors() GAZEBO_DEPRECATED(9.0)
Update colors.
gazebo::rendering::MovableText::SetText
void SetText(const std::string &_text)
Set the text to display.
gazebo::rendering::MovableText::HorizAlign
HorizAlign
Horizontal alignment.
Definition: MovableText.hh:48
gazebo::rendering::MovableText::SetupGeometry
void SetupGeometry()
Setup the geometry.
Color.hh
gazebo::rendering::MovableText::getMaterial
const Ogre::MaterialPtr & getMaterial() const override
rendering
rendering
Definition: RenderEngine.hh:31
gazebo::rendering::MovableText::ShowOnTop
bool ShowOnTop() const
Get whether the is displayed above other objects.
gazebo::rendering::MovableText::Text
const std::string & Text() const
Get the displayed text.
gazebo::rendering::MovableText::getWorldTransforms
void getWorldTransforms(Ogre::Matrix4 *_xform) const override
gazebo::rendering::MovableText::SetFontName
void SetFontName(const std::string &_font)
Set the font.
gazebo::rendering::MovableText::GetColor
const common::Color GetColor() const GAZEBO_DEPRECATED(9.0)
Get the text color.
gazebo::rendering::MovableText::H_LEFT
Left alignment.
Definition: MovableText.hh:50
ogre_gazebo.h
gazebo::rendering::MovableText::getLights
const Ogre::LightList & getLights() const override
gazebo::rendering::MovableText::GetBaseline
float GetBaseline() const GAZEBO_DEPRECATED(9.0)
Get the baseline height in meters.
gazebo::rendering::MovableText::GetFont
const std::string & GetFont() const GAZEBO_DEPRECATED(9.0)
Get the font name.
gazebo::common::Color
Defines a color.
Definition: Color.hh:36
gazebo::rendering::MovableText::SetTextAlignment
void SetTextAlignment(const HorizAlign &_hAlign, const VertAlign &_vAlign)
Set the alignment of the text.
gazebo::rendering::MovableText::SetBaseline
void SetBaseline(const float _height)
Set the baseline height of the text.
gazebo::rendering::MovableText::SetColor
void SetColor(const common::Color &_color) GAZEBO_DEPRECATED(9.0)
Set the text color.
gazebo::rendering::MovableText::SpaceWidth
float SpaceWidth() const
Get the width of spaces between words.
gazebo::rendering::MovableText::UpdateColors
void UpdateColors()
Update colors.
GAZEBO_DEPRECATED
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:328
gazebo::rendering::MovableText
Movable text.
Definition: MovableText.hh:43
gazebo::rendering::MovableText::FontName
const std::string & FontName() const
Get the font name.
gazebo::rendering::MovableText::H_CENTER
Center alignment.
Definition: MovableText.hh:52
gazebo::rendering::MovableText::V_BELOW
Align below.
Definition: MovableText.hh:59
gazebo::rendering::MovableText::AABB
ignition::math::Box AABB()
Get the axis aligned bounding box of the text.
gazebo::rendering::Camera
Basic camera sensor.
Definition: Camera.hh:84
gazebo::rendering::MovableText::SetSpaceWidth
void SetSpaceWidth(const float _width)
Set the width of spaces between words.
gazebo::rendering::MovableText::Baseline
float Baseline() const
Get the baseline height in meters.
gazebo::rendering::MovableText::Load
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.