MRPT  1.9.9
Classes | Variables
mrpt::opengl::internal Namespace Reference

Classes

struct  Font
 
struct  FontData
 
struct  Point
 

Variables

Point mono_vertices []
 
Font::Index mono_triangles []
 
Font::Index mono_lines []
 
Font::Char mono_chars []
 
Font mono_font
 
Point sans_vertices []
 
Font::Index sans_triangles []
 
Font::Index sans_lines []
 
Font::Char sans_chars []
 
Font sans_font
 
Point serif_vertices []
 
Font::Index serif_triangles []
 
Font::Index serif_lines []
 
Font::Char serif_chars []
 
Font serif_font
 
static struct FontData data
 

OpenGL vector 3D fonts

using TEXT_STYLE = TOpenGLFontStyle
 different style for font rendering More...
 
void glSetFont (const std::string &fontname)
 sets the font to use for future font rendering commands. More...
 
const std::string & glGetFont ()
 returns the name of the currently active font More...
 
std::pair< double, double > glDrawText (const std::string &text, std::vector< mrpt::opengl::TTriangle > &tris, std::vector< mrpt::math::TPoint3Df > &lines, TEXT_STYLE style=NICE, double spacing=1.5, double kerning=0.1)
 renders a string in GL using the current settings. More...
 
std::pair< double, double > glGetExtends (const std::string &text, double spacing=1.5, double kerning=0.1)
 returns the size of the bounding box of a text to be rendered, similar to glDrawText but without any visual output More...
 
void glDrawTextTransformed (const std::string &text, std::vector< mrpt::opengl::TTriangle > &tris, std::vector< mrpt::math::TPoint3Df > &lines, std::vector< mrpt::img::TColor > &line_colors, const mrpt::poses::CPose3D &text_pose, float text_scale, const mrpt::img::TColor &text_color, TEXT_STYLE style=NICE, double spacing=1.5, double kerning=0.1)
 Appends to {tris,lines} the entities representing a given text including a pose and scale transformation. More...
 

Typedef Documentation

◆ TEXT_STYLE

different style for font rendering

Definition at line 39 of file gltext.h.

Function Documentation

◆ glDrawText()

std::pair< double, double > mrpt::opengl::internal::glDrawText ( const std::string &  text,
std::vector< mrpt::opengl::TTriangle > &  tris,
std::vector< mrpt::math::TPoint3Df > &  lines,
TEXT_STYLE  style = NICE,
double  spacing = 1.5,
double  kerning = 0.1 
)

renders a string in GL using the current settings.

Font coordinates are +X along the line and +Y along the up direction of glyphs. The origin is at the top baseline at the left of the first character. Characters have a maximum size of 1. linefeed is interpreted as a new line and the start is offset in -Y direction by spacing . Individual characters are separated by kerning + plus their individual with.

Parameters
textstring to be rendered, unknown characters are replaced with '?'
stylerendering style
spacingdistance between individual text lines
kerningdistance between characters

Definition at line 153 of file gltext.cpp.

References mrpt::opengl::internal::Font::Char::advance, mrpt::opengl::internal::FontData::currentFont(), data, mrpt::opengl::FILL, mrpt::opengl::internal::Font::findChar(), mrpt::opengl::NICE, mrpt::opengl::OUTLINE, THROW_EXCEPTION, mrpt::math::TPoint2D_data< T >::x, and mrpt::math::TPoint2D_data< T >::y.

Referenced by glDrawTextTransformed(), mrpt::opengl::CText::onUpdateBuffers_Text(), and mrpt::opengl::CText3D::onUpdateBuffers_Text().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glDrawTextTransformed()

void mrpt::opengl::internal::glDrawTextTransformed ( const std::string &  text,
std::vector< mrpt::opengl::TTriangle > &  tris,
std::vector< mrpt::math::TPoint3Df > &  lines,
std::vector< mrpt::img::TColor > &  line_colors,
const mrpt::poses::CPose3D text_pose,
float  text_scale,
const mrpt::img::TColor text_color,
TEXT_STYLE  style = NICE,
double  spacing = 1.5,
double  kerning = 0.1 
)

Appends to {tris,lines} the entities representing a given text including a pose and scale transformation.

It calls glDrawText() and appends its results to the provided buffers.

Definition at line 268 of file gltext.cpp.

References mrpt::poses::CPose3D::composePoint(), glDrawText(), and mrpt::poses::CPose3D::rotateVector().

Referenced by mrpt::opengl::CColorBar::onUpdateBuffers_all().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glGetExtends()

std::pair< double, double > mrpt::opengl::internal::glGetExtends ( const std::string &  text,
double  spacing,
double  kerning 
)

returns the size of the bounding box of a text to be rendered, similar to glDrawText but without any visual output

Definition at line 233 of file gltext.cpp.

References mrpt::opengl::internal::Font::Char::advance, mrpt::opengl::internal::FontData::currentFont(), data, and mrpt::opengl::internal::Font::findChar().

Here is the call graph for this function:

◆ glGetFont()

const std::string & mrpt::opengl::internal::glGetFont ( )

returns the name of the currently active font

Definition at line 151 of file gltext.cpp.

References mrpt::opengl::internal::FontData::currentFontName, and data.

◆ glSetFont()

void mrpt::opengl::internal::glSetFont ( const std::string &  fontname)

sets the font to use for future font rendering commands.

Options are: "sans", "serif", "mono".

Parameters
fontnamestring containing font name

Definition at line 146 of file gltext.cpp.

References mrpt::opengl::internal::FontData::currentFontName, data, and mrpt::opengl::internal::FontData::fonts.

Referenced by mrpt::opengl::internal::FontData::FontData(), mrpt::opengl::CColorBar::onUpdateBuffers_all(), mrpt::opengl::CText::onUpdateBuffers_Text(), mrpt::opengl::CText3D::onUpdateBuffers_Text(), and mrpt::opengl::CAxis::onUpdateBuffers_Wireframe().

Here is the caller graph for this function:

Variable Documentation

◆ data

struct FontData mrpt::opengl::internal::data
static

Definition at line 144 of file gltext.cpp.

Referenced by mrpt::opengl::COpenGLBuffer::allocate(), mrpt::opengl::COpenGLBuffer::RAII_Impl::allocate(), mrpt::io::CMemoryStream::CMemoryStream(), mrpt::system::compute_CRC16(), mrpt::system::compute_CRC32(), mrpt::math::confidenceIntervals(), mrpt::math::CSparseMatrix::CSparseMatrix(), mrpt::math::CVectorDynamic< KFTYPE >::CVectorDynamic(), mrpt::gui::CWindowDialogPlots::CWindowDialogPlots(), mrpt::hwdrivers::CIMUXSens_MT4::doProcess(), mrpt::hwdrivers::CIMUIntersense::doProcess(), mrpt::math::RANSAC_Template< NUMTYPE >::execute(), mrpt::math::extractColumnFromVectorOfVectors(), mrpt::math::four1(), mrpt::ros1bridge::get_float_from_field(), mrpt::ros1bridge::get_uint16_from_field(), mrpt::typemeta::TEnumType< ENUMTYPE >::getBimap(), mrpt::serialization::CMessage::getContentAsStruct(), mrpt::hwdrivers::CBoardSonars::getObservation(), glDrawText(), glGetExtends(), glGetFont(), glSetFont(), mrpt::comms::net::http_get(), mrpt::opengl::CRenderizableShaderTexturedTriangles::initializeTextures(), mrpt::obs::CObservationPointCloud::load(), mrpt::img::CImage::loadFromXPM(), mrpt::img::CImage::loadTGA(), mrpt::system::md5(), mrpt::gui::MRPTImage2wxImage(), mrpt::hwdrivers::CGPSInterface::parse_NMEA(), ParseColor(), mrpt::gui::WxSubsystem::pushPendingWxRequest(), mrpt::math::realft(), reserveDataBuffer(), mrpt::hwdrivers::CNTRIPClient::sendBackToServer(), mrpt::hwdrivers::CGPSInterface::sendCustomCommand(), mrpt::serialization::CMessage::serializeObject(), mrpt::serialization::CMessage::setContentFromStruct(), mrpt::hmtslam::CMHPropertiesValuesList::setElemental(), and mrpt::slam::CRejectionSamplingRangeOnlyLocalization::setParams().

◆ mono_chars

Font::Char mrpt::opengl::internal::mono_chars[]

Definition at line 2550 of file gltext.cpp.

◆ mono_font

Font mrpt::opengl::internal::mono_font
Initial value:
" $(,048<@DHLPTX\\`dhlptx|#'+/"
"37;?CGKOSW[_cgkosw{\"&*.26:>BFJNRVZ^bfjnrvz~\t!%)-159="
"AEIMQUY]aeimquy}"}
Font::Index mono_triangles[]
Definition: glfont_mono.h:1293
Font::Index mono_lines[]
Definition: glfont_mono.h:2033
Font::Char mono_chars[]
Definition: glfont_mono.h:2549
Point mono_vertices[]
Definition: glfont_mono.h:13

Definition at line 2649 of file gltext.cpp.

◆ mono_lines

Font::Index mrpt::opengl::internal::mono_lines[]

Definition at line 2034 of file gltext.cpp.

◆ mono_triangles

Font::Index mrpt::opengl::internal::mono_triangles[]

Definition at line 1294 of file gltext.cpp.

◆ mono_vertices

Point mrpt::opengl::internal::mono_vertices[]

Definition at line 14 of file gltext.cpp.

◆ sans_chars

Font::Char mrpt::opengl::internal::sans_chars[]

Definition at line 2488 of file gltext.cpp.

◆ sans_font

Font mrpt::opengl::internal::sans_font
Initial value:
" $(,048<@DHLPTX\\`dhlptx|#'+/"
"37;?CGKOSW[_cgkosw{\"&*.26:>BFJNRVZ^bfjnrvz~\t!%)-159="
"AEIMQUY]aeimquy}"}
Font::Index sans_triangles[]
Definition: glfont_sans.h:1262
Point sans_vertices[]
Definition: glfont_sans.h:13
Font::Char sans_chars[]
Definition: glfont_sans.h:2487
Font::Index sans_lines[]
Definition: glfont_sans.h:1984

Definition at line 2587 of file gltext.cpp.

◆ sans_lines

Font::Index mrpt::opengl::internal::sans_lines[]

Definition at line 1985 of file gltext.cpp.

◆ sans_triangles

Font::Index mrpt::opengl::internal::sans_triangles[]

Definition at line 1263 of file gltext.cpp.

◆ sans_vertices

Point mrpt::opengl::internal::sans_vertices[]

Definition at line 14 of file gltext.cpp.

◆ serif_chars

Font::Char mrpt::opengl::internal::serif_chars[]

Definition at line 2958 of file gltext.cpp.

◆ serif_font

Font mrpt::opengl::internal::serif_font
Initial value:
" $(,048<@DHLPTX\\`dhlptx|#'+/"
"37;?CGKOSW[_cgkosw{\"&*.26:>BFJNRVZ^bfjnrvz~\t!%)-159="
"AEIMQUY]aeimquy}"}
Font::Char serif_chars[]
Point serif_vertices[]
Definition: glfont_serif.h:13
Font::Index serif_triangles[]
Font::Index serif_lines[]

Definition at line 3057 of file gltext.cpp.

◆ serif_lines

Font::Index mrpt::opengl::internal::serif_lines[]

Definition at line 2361 of file gltext.cpp.

◆ serif_triangles

Font::Index mrpt::opengl::internal::serif_triangles[]

Definition at line 1498 of file gltext.cpp.

◆ serif_vertices

Point mrpt::opengl::internal::serif_vertices[]

Definition at line 14 of file gltext.cpp.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020