Class CText3D
Defined in File CText3D.h
Inheritance Relationships
Base Type
public mrpt::viz::CVisualObject(Class CVisualObject)
Class Documentation
-
class CText3D : public mrpt::viz::CVisualObject
A 3D text (rendered with OpenGL primitives), with selectable font face and drawing style. Use setString and setFont to change the text displayed by this object (can be multi-lined).
Text is drawn along the (+X,+Y) axes.
Default size of characters is “1.0 units”. Change it with the standard method CVisualObject::setScale() as with any other 3D object. The color can be also changed with standard methods in the base class CRenderizable.

See also
opengl::Scene, CText
Note
This class is based on code from libcvd (BSD, http://www.edwardrosten.com/cvd/ )
Public Functions
-
CText3D(const std::string &str = std::string(""), const std::string &fontName = std::string("sans"), const float scale = 1.0, const mrpt::viz::TOpenGLFontStyle text_style = mrpt::viz::NICE, const double text_spacing = 1.5, const double text_kerning = 0.1)
-
~CText3D() override
-
inline void setString(const std::string &s)
Sets the displayed string
-
inline const std::string &getString() const
Returns the currently text associated to this object
-
inline void setFont(const std::string &font)
Changes the font name, among accepted values: “sans”, “mono”, “serif”
-
inline const std::string &getFont() const
Returns the text font
-
inline void setTextStyle(const mrpt::viz::TOpenGLFontStyle text_style)
Change drawing style: FILL, OUTLINE, NICE
-
inline mrpt::viz::TOpenGLFontStyle getTextStyle() const
Gets the current drawing style
-
inline void setTextSpacing(const double text_spacing)
-
inline double setTextSpacing() const
-
inline void setTextKerning(const double text_kerning)
-
inline double setTextKerning() const
-
virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() const override
Must be implemented by derived classes to provide the updated bounding box in the object local frame of coordinates. This will be called only once after each time the derived class reports to notifyChange() that the object geometry changed.
See also
getBoundingBox(), getBoundingBoxLocal(), getBoundingBoxLocalf()
-
virtual void toYAMLMap(mrpt::containers::yaml &propertiesMap) const override
Used from Scene::asYAML().
Note
(New in MRPT 2.4.2)
-
CText3D(const std::string &str = std::string(""), const std::string &fontName = std::string("sans"), const float scale = 1.0, const mrpt::viz::TOpenGLFontStyle text_style = mrpt::viz::NICE, const double text_spacing = 1.5, const double text_kerning = 0.1)