14 #ifndef OSGTEXT_TEXTBASE
15 #define OSGTEXT_TEXTBASE 1
17 #include <osg/Drawable>
19 #include <osgText/String>
20 #include <osgText/KerningType>
21 #include <osgText/Font>
36 virtual const char*
className()
const {
return "TextBase"; }
52 virtual void setFont(
const std::string& fontfile);
71 void setFontResolution(
unsigned int width,
unsigned int height);
78 void setText(
const String& text);
82 void setText(
const std::string& text);
90 void setText(
const wchar_t* text);
102 void update() { computeGlyphRepresentation(); }
106 void setCharacterSize(
float height);
109 void setCharacterSize(
float height,
float aspectRatio);
118 OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT
132 void setMaximumWidth(
float maximumWidth);
141 void setMaximumHeight(
float maximumHeight);
150 void setLineSpacing(
float lineSpacing);
186 BASE_LINE = LEFT_BASE_LINE
190 void setAlignment(AlignmentType alignment);
203 USER_DEFINED_ROTATION
206 void setAxisAlignment(AxisAlignment axis);
212 void setAutoRotateToScreen(
bool autoRotateToScreen);
222 void setLayout(Layout layout);
231 FILLEDBOUNDINGBOX = 4,
235 void setDrawMode(
unsigned int mode);
239 void setBoundingBoxMargin(
float margin);
256 virtual void setThreadSafeRefUnref(
bool threadSafe);
259 virtual void resizeGLObjectBuffers(
unsigned int maxSize);
264 virtual void releaseGLObjects(
osg::State* state=0)
const;
273 void positionCursor(
const osg::Vec2 & endOfLine_coords,
osg::Vec2 & cursor,
unsigned int linelength);
274 void computePositions();
275 String::iterator computeLastCharacterOnLine(
osg::Vec2& cursor, String::iterator first,String::iterator last);
278 virtual void computePositions(
unsigned int contextID)
const = 0;
279 virtual void computeGlyphRepresentation() = 0;
313 _traversalNumber(-1),
void setStyle(Style *style)
std::pair< unsigned int, unsigned int > FontResolution
Style * getOrCreateStyle()
virtual void setFont(Font *font=0)
bool getAutoRotateToScreen() const
unsigned int getFontHeight() const
const Font * getFont() const
void setCharacterSizeMode(CharacterSizeMode mode)
virtual bool isSameKindAs(const osg::Object *obj) const
float getCharacterHeight() const
const osg::Vec4 & getBoundingBoxColor() const
unsigned int getFontWidth() const
float getCharacterAspectRatio() const
virtual const char * className() const
AxisAlignment _axisAlignment
osg::Vec3 _transformedPosition
void setKerningType(KerningType kerningType)
virtual const char * libraryName() const
GLint GLenum GLsizei width
const String & getText() const
float getLineSpacing() const
float getBoundingBoxMargin() const
osg::buffered_object< AutoTransformCache > _autoTransformCache
AxisAlignment getAxisAlignment() const
float getMaximumWidth() const
unsigned int getLineCount() const
const Style * getStyle() const
GLint GLenum GLsizei GLsizei height
osg::ref_ptr< Font > _font
unsigned int getDrawMode() const
CharacterSizeMode _characterSizeMode
AlignmentType getAlignment() const
CharacterSizeMode getCharacterSizeMode() const
const osg::Vec4 & getColor() const
osg::ref_ptr< Style > _style
const osg::Quat & getRotation() const
void setBoundingBoxColor(const osg::Vec4 &color)
float getMaximumHeight() const
const osg::Vec3 & getPosition() const
KerningType getKerningType() const