Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef opengl_CText3D_H
00030 #define opengl_CText3D_H
00031
00032 #include <mrpt/opengl/CRenderizableDisplayList.h>
00033
00034 namespace mrpt
00035 {
00036 namespace opengl
00037 {
00038 class OPENGL_IMPEXP CText3D;
00039
00040
00041 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CText3D, CRenderizableDisplayList, OPENGL_IMPEXP )
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 class OPENGL_IMPEXP CText3D : public CRenderizableDisplayList
00063 {
00064 DEFINE_SERIALIZABLE( CText3D )
00065 protected:
00066 std::string m_str;
00067 std::string m_fontName;
00068 TOpenGLFontStyle m_text_style;
00069 double m_text_spacing;
00070 double m_text_kerning;
00071
00072 public:
00073
00074 inline void setString( const std::string &s ) {
00075 m_str=s;
00076 CRenderizableDisplayList::notifyChange();
00077 }
00078
00079 inline const std::string &getString() const { return m_str; }
00080
00081
00082 inline void setFont( const std::string &font ) {
00083 m_fontName=font;
00084 CRenderizableDisplayList::notifyChange();
00085 }
00086
00087 inline const std::string &getFont() const { return m_fontName; }
00088
00089
00090 void setTextStyle(const mrpt::opengl::TOpenGLFontStyle text_style) {
00091 m_text_style = text_style;
00092 CRenderizableDisplayList::notifyChange();
00093 }
00094
00095 mrpt::opengl::TOpenGLFontStyle getTextStyle() const { return m_text_style; }
00096
00097 void setTextSpacing(const double text_spacing) {
00098 m_text_spacing = text_spacing;
00099 CRenderizableDisplayList::notifyChange();
00100 }
00101 double setTextSpacing() const { return m_text_spacing; }
00102
00103 void setTextKerning(const double text_kerning) {
00104 m_text_kerning = text_kerning;
00105 CRenderizableDisplayList::notifyChange();
00106 }
00107 double setTextKerning() const { return m_text_kerning; }
00108
00109
00110
00111 void render_dl() const;
00112
00113
00114
00115 static CText3DPtr Create(
00116 const std::string &str,
00117 const std::string &fontName = std::string("sans"),
00118 const double scale = 1.0,
00119 const mrpt::opengl::TOpenGLFontStyle text_style = mrpt::opengl::FILL,
00120 const double text_spacing = 1.5,
00121 const double text_kerning = 0.1 )
00122 {
00123 return CText3DPtr( new CText3D(str,fontName,scale,text_style,text_spacing,text_kerning) );
00124 }
00125
00126 private:
00127
00128 CText3D(
00129 const std::string &str = std::string(""),
00130 const std::string &fontName = std::string("sans"),
00131 const double scale = 1.0,
00132 const mrpt::opengl::TOpenGLFontStyle text_style = mrpt::opengl::FILL,
00133 const double text_spacing = 1.5,
00134 const double text_kerning = 0.1 );
00135
00136
00137 virtual ~CText3D();
00138 };
00139
00140 }
00141
00142 }
00143
00144
00145 #endif