Go to the documentation of this file.
29 const double text_spacing = 1.5;
30 const double text_kerning = 0.1;
44 cbd.assign(vbd.size(), m_color);
45 for (
auto& tri : m_triangles) tri.setColor(m_color);
50 #if MRPT_HAS_OPENGL_GLUT
57 if (std::abs(pmv(3, 3)) < 1e-10)
return;
68 glUniformMatrix4fv(u_pmat, 1,
true, eye4.data());
74 mv(2, 3) = pmv(2, 3) / pmv(3, 3);
78 std::cerr <<
"[CText] Warning: invalid viewport size!\n";
88 mv(0, 0) *= scale / aspect;
91 glUniformMatrix4fv(u_mvmat, 1,
true, mv.data());
101 writeToStreamRender(
out);
104 out << (uint32_t)m_fontHeight << (uint32_t)m_fontWidth;
115 readFromStreamRender(in);
const mrpt::opengl::Program * shader
The base class of 3D objects that can be directly rendered through OpenGL.
size_t viewport_width
In pixels.
mrpt::vision::TStereoCalibResults out
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
std::vector< mrpt::math::TPoint3Df > m_vertex_buffer_data
List of lines.
virtual ~CText() override
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
TPoint2D_< float > TPoint2Df
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
static CMatrixFixed< float, ROWS, COLS > Identity()
int uniformId(const char *name) const
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
void onUpdateBuffers_Text() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
Context for calls to render()
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
@ FILL
renders glyphs as filled polygons
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
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
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
This base provides a set of functions for maths stuff.
const mrpt::opengl::TRenderMatrices * state
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...
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
mrpt::math::CMatrixFloat44 pmv_matrix
Result of p_matrix * mv_matrix.
The namespace for 3D scene representation and rendering.
A 2D text (bitmap rendering): it always "faces the observer" despite it's at some 3D location.
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 | |