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

Classes

struct  Font
 
struct  FontData
 
struct  Point
 

Variables

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

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

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

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

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< double >::CVectorDynamic(), mrpt::gui::CWindowDialogPlots::CWindowDialogPlots(), mrpt::hwdrivers::CIMUIntersense::doProcess(), mrpt::math::RANSAC_Template< NUMTYPE, DATASET, MODEL >::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().




Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sun Jul 19 15:15:43 UTC 2020