Go to the documentation of this file.
24 const std::
string& str, const std::
string& fontName, const
float scale,
26 const
double text_kerning)
29 m_text_style(text_style),
30 m_text_spacing(text_spacing),
31 m_text_kerning(text_kerning)
33 this->setScale(scale);
49 m_str, tris, vbd, m_text_style, m_text_spacing, m_text_kerning);
52 cbd.assign(vbd.size(), m_color);
53 for (
auto& tri : m_triangles) tri.setColor(m_color);
59 writeToStreamRender(
out);
60 out << m_str << m_fontName << (uint32_t)m_text_style << m_text_spacing
70 readFromStreamRender(in);
73 in >> m_str >> m_fontName >> i >> m_text_spacing >> m_text_kerning;
91 bb_max.x = m_str.size() * m_scale_x;
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
TOpenGLFontStyle
Different style for vectorized font rendering.
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
The base class of 3D objects that can be directly rendered through OpenGL.
mrpt::vision::TStereoCalibResults out
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
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...
Virtual base class for "archives": classes abstracting I/O streams.
std::vector< mrpt::math::TPoint3Df > m_vertex_buffer_data
List of lines.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
void glSetFont(const std::string &fontname)
sets the font to use for future font rendering commands.
std::vector< mrpt::img::TColor > m_color_buffer_data
A 3D text (rendered with OpenGL primitives), with selectable font face and drawing style.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
void onUpdateBuffers_Text() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
The namespace for 3D scene representation and rendering.
std::pair< double, double > glDrawText(const std::string &text, std::vector< mrpt::opengl::TTriangle > &tris, std::vector< mrpt::math::TPoint3Df > &render_lines, TEXT_STYLE style, double spacing, double kerning)
renders a string in GL using the current settings.
std::vector< mrpt::opengl::TTriangle > m_triangles
List of triangles.
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sat Jun 27 14:00:59 UTC 2020 | |