28 const
std::
string& str, const
std::
string& fontName, const
double scale,
30 const
double text_kerning)
33 m_text_style(text_style),
34 m_text_spacing(text_spacing),
35 m_text_kerning(text_kerning)
37 this->setScale(
scale);
49 #if MRPT_HAS_OPENGL_GLUT 50 glColor4ub(m_color.R, m_color.G, m_color.B, m_color.A);
56 m_text_style, m_text_spacing, m_text_kerning);
64 writeToStreamRender(out);
65 out << m_str << m_fontName << (
uint32_t)m_text_style << m_text_spacing
75 readFromStreamRender(
in);
78 in >> m_str >> m_fontName >> i >> m_text_spacing >> m_text_kerning;
96 bb_max.x = m_str.size() * m_scale_x;
void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
GLenum GLenum GLenum GLenum GLenum scale
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
~CText3D() override
Private, virtual destructor: only can be deleted from smart pointers.
mrpt::img::TPixelCoordf glDrawText(const std::string &text, const double textScale, enum TOpenGLFontStyle style=NICE, double spacing=1.5, double kerning=0.1)
renders a string in GL using the current settings.
void glSetFont(const std::string &fontname)
sets the font to use for future font rendering commands.
A renderizable object suitable for rendering with OpenGL's display lists.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
TOpenGLFontStyle
Different style for vectorized font rendering.
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
GLAPI void GLAPIENTRY glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
A 3D text (rendered with OpenGL primitives), with selectable font face and drawing style...
The namespace for 3D scene representation and rendering.
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
void render_dl() const override
Render.
unsigned __int32 uint32_t