A 3D text (rendered with OpenGL primitives), with selectable font face and drawing style.
Use setString and setFont to change the text displayed by this object (can be multi-lined).
Text is drawn along the (+X,+Y) axes.
Default size of characters is "1.0 units". Change it with the standard method CRenderizable::setScale() as with any other 3D object. The color can be also changed with standard methods in the base class CRenderizable.
#include <mrpt/opengl/CText3D.h>

Public Member Functions | |
| void | setString (const std::string &s) |
| Sets the displayed string. | |
| const std::string & | getString () const |
| Returns the currently text associated to this object. | |
| void | setFont (const std::string &font) |
| Changes the font name, among accepted values: "sans", "mono", "serif". | |
| const std::string & | getFont () const |
| Returns the text font. | |
| void | setTextStyle (const mrpt::opengl::TOpenGLFontStyle text_style) |
| Change drawing style: FILL, OUTLINE, NICE. | |
| mrpt::opengl::TOpenGLFontStyle | getTextStyle () const |
| Gets the current drawing style. | |
| void | setTextSpacing (const double text_spacing) |
| double | setTextSpacing () const |
| void | setTextKerning (const double text_kerning) |
| double | setTextKerning () const |
| void | render_dl () const |
| Render. | |
Static Public Member Functions | |
| static CText3DPtr | Create (const std::string &str, const std::string &fontName=std::string("sans"), const double scale=1.0, const mrpt::opengl::TOpenGLFontStyle text_style=mrpt::opengl::FILL, const double text_spacing=1.5, const double text_kerning=0.1) |
| Class factory. | |
Protected Attributes | |
| std::string | m_str |
| std::string | m_fontName |
| TOpenGLFontStyle | m_text_style |
| double | m_text_spacing |
| double | m_text_kerning |
Private Member Functions | |
| CText3D (const std::string &str=std::string(""), const std::string &fontName=std::string("sans"), const double scale=1.0, const mrpt::opengl::TOpenGLFontStyle text_style=mrpt::opengl::FILL, const double text_spacing=1.5, const double text_kerning=0.1) | |
| Constructor. | |
| virtual | ~CText3D () |
| Private, virtual destructor: only can be deleted from smart pointers. | |
RTTI stuff | |
| typedef CText3DPtr | SmartPtr |
| static mrpt::utils::CLASSINIT | _init_CText3D |
| static mrpt::utils::TRuntimeClassId | classCText3D |
| static const mrpt::utils::TRuntimeClassId * | classinfo |
| static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
| virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
| Returns information about the class of an object in runtime. | |
| virtual mrpt::utils::CObject * | duplicate () const |
| Returns a copy of the object, indepently of its class. | |
| static mrpt::utils::CObject * | CreateObject () |
| static CText3DPtr | Create () |
| mrpt::opengl::CText3D::CText3D | ( | const std::string & | str = std::string(""), |
| const std::string & | fontName = std::string("sans"), |
||
| const double | scale = 1.0, |
||
| const mrpt::opengl::TOpenGLFontStyle | text_style = mrpt::opengl::FILL, |
||
| const double | text_spacing = 1.5, |
||
| const double | text_kerning = 0.1 |
||
| ) | [private] |
Constructor.
| virtual mrpt::opengl::CText3D::~CText3D | ( | ) | [private, virtual] |
Private, virtual destructor: only can be deleted from smart pointers.
| static const mrpt::utils::TRuntimeClassId* mrpt::opengl::CText3D::_GetBaseClass | ( | ) | [static, protected] |
Reimplemented from mrpt::opengl::CRenderizableDisplayList.
| static CText3DPtr mrpt::opengl::CText3D::Create | ( | ) | [static] |
| static CText3DPtr mrpt::opengl::CText3D::Create | ( | const std::string & | str, |
| const std::string & | fontName = std::string("sans"), |
||
| const double | scale = 1.0, |
||
| const mrpt::opengl::TOpenGLFontStyle | text_style = mrpt::opengl::FILL, |
||
| const double | text_spacing = 1.5, |
||
| const double | text_kerning = 0.1 |
||
| ) | [inline, static] |
| static mrpt::utils::CObject* mrpt::opengl::CText3D::CreateObject | ( | ) | [static] |
| virtual mrpt::utils::CObject* mrpt::opengl::CText3D::duplicate | ( | ) | const [virtual] |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
| const std::string& mrpt::opengl::CText3D::getFont | ( | ) | const [inline] |
| virtual const mrpt::utils::TRuntimeClassId* mrpt::opengl::CText3D::GetRuntimeClass | ( | ) | const [virtual] |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::opengl::CRenderizableDisplayList.
| const std::string& mrpt::opengl::CText3D::getString | ( | ) | const [inline] |
| mrpt::opengl::TOpenGLFontStyle mrpt::opengl::CText3D::getTextStyle | ( | ) | const [inline] |
| void mrpt::opengl::CText3D::render_dl | ( | ) | const [virtual] |
Render.
Implements mrpt::opengl::CRenderizableDisplayList.
| void mrpt::opengl::CText3D::setFont | ( | const std::string & | font | ) | [inline] |
Changes the font name, among accepted values: "sans", "mono", "serif".
Definition at line 82 of file CText3D.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
| void mrpt::opengl::CText3D::setString | ( | const std::string & | s | ) | [inline] |
Sets the displayed string.
Definition at line 74 of file CText3D.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
| void mrpt::opengl::CText3D::setTextKerning | ( | const double | text_kerning | ) | [inline] |
Definition at line 103 of file CText3D.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
| double mrpt::opengl::CText3D::setTextKerning | ( | ) | const [inline] |
| void mrpt::opengl::CText3D::setTextSpacing | ( | const double | text_spacing | ) | [inline] |
Definition at line 97 of file CText3D.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
| double mrpt::opengl::CText3D::setTextSpacing | ( | ) | const [inline] |
| void mrpt::opengl::CText3D::setTextStyle | ( | const mrpt::opengl::TOpenGLFontStyle | text_style | ) | [inline] |
Change drawing style: FILL, OUTLINE, NICE.
Definition at line 90 of file CText3D.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
mrpt::utils::CLASSINIT mrpt::opengl::CText3D::_init_CText3D [static, protected] |
const mrpt::utils::TRuntimeClassId* mrpt::opengl::CText3D::classinfo [static] |
std::string mrpt::opengl::CText3D::m_fontName [protected] |
std::string mrpt::opengl::CText3D::m_str [protected] |
double mrpt::opengl::CText3D::m_text_kerning [protected] |
double mrpt::opengl::CText3D::m_text_spacing [protected] |
TOpenGLFontStyle mrpt::opengl::CText3D::m_text_style [protected] |
| Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Sun Oct 16 12:16:33 UTC 2011 |