Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions
mrpt::opengl::CText3D Class Reference

Detailed Description

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.

See also:
opengl::COpenGLScene, CText
mrpt::opengl::CText3D
preview_CText3D.png
Note:
This class is based on code from libcvd (LGPL, http://www.edwardrosten.com/cvd/ )

#include <mrpt/opengl/CText3D.h>

Inheritance diagram for mrpt::opengl::CText3D:
Inheritance graph
[legend]

List of all members.

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 ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 64 of file CText3D.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::opengl::CText3D::_GetBaseClass ( ) [static, protected]
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]

Class factory.

Definition at line 115 of file CText3D.h.

References mrpt::opengl::CText3D.

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]

Returns the text font.

Definition at line 87 of file CText3D.h.

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]

Returns the currently text associated to this object.

Definition at line 79 of file CText3D.h.

mrpt::opengl::TOpenGLFontStyle mrpt::opengl::CText3D::getTextStyle ( ) const [inline]

Gets the current drawing style.

Definition at line 95 of file CText3D.h.

void mrpt::opengl::CText3D::render_dl ( ) const [virtual]
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]

Definition at line 107 of file CText3D.h.

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]

Definition at line 101 of file CText3D.h.

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().


Member Data Documentation

Definition at line 64 of file CText3D.h.

Definition at line 64 of file CText3D.h.

Definition at line 64 of file CText3D.h.

Definition at line 67 of file CText3D.h.

Definition at line 66 of file CText3D.h.

Definition at line 70 of file CText3D.h.

Definition at line 69 of file CText3D.h.

Definition at line 68 of file CText3D.h.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Sun Oct 16 12:16:33 UTC 2011