Public Types | |
enum | RenderMode { PER_FACE, PER_GLYPH } |
Public Member Functions | |
Text3D () | |
Text3D (const Text3D &text, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
META_Object (osgText, Text3D) float getCharacterDepth() const | |
void | setCharacterDepth (float characterDepth) |
RenderMode | getRenderMode () const |
void | setRenderMode (RenderMode renderMode) |
void | setFont (Font3D *font=0) |
void | setFont (osg::ref_ptr< Font3D > font) |
void | setFont (const std::string &fontfile) |
const Font3D * | getFont () const |
virtual void | drawImplementation (osg::RenderInfo &renderInfo) const |
virtual bool | supports (const osg::Drawable::AttributeFunctor &) const |
virtual bool | supports (const osg::Drawable::ConstAttributeFunctor &) const |
virtual bool | supports (const osg::PrimitiveFunctor &) const |
virtual void | setThreadSafeRefUnref (bool threadSafe) |
virtual void | resizeGLObjectBuffers (unsigned int maxSize) |
virtual void | releaseGLObjects (osg::State *state=0) const |
Protected Types | |
typedef std::vector < GlyphRenderInfo > | LineRenderInfo |
typedef std::vector < LineRenderInfo > | TextRenderInfo |
Protected Member Functions | |
virtual | ~Text3D () |
void | renderPerGlyph (osg::State &state) const |
void | renderPerFace (osg::State &state) const |
String::iterator | computeLastCharacterOnLine (osg::Vec2 &cursor, String::iterator first, String::iterator last) |
void | computeGlyphRepresentation () |
void | computePositions (unsigned int contextID) const |
Protected Attributes | |
TextRenderInfo | _textRenderInfo |
osg::ref_ptr< Font3D > | _font |
float | _characterDepth |
RenderMode | _renderMode |
osg::ref_ptr< osg::StateSet > | _wallStateSet |
osg::ref_ptr< osg::StateSet > | _backStateSet |
Friends | |
class | Font3D |
Classes | |
struct | GlyphRenderInfo |
typedef std::vector<GlyphRenderInfo> osgText::Text3D::LineRenderInfo [protected] |
typedef std::vector<LineRenderInfo> osgText::Text3D::TextRenderInfo [protected] |
Reder mode used to render the Text. PER_FACE : render all front face with the default StateSet all wall face with the wall StateSet all back face with the back StateSet (back face of the character, no the OpenGL back face)
PER_GLYPH : render all Charactere with the default StateSet
osgText::Text3D::Text3D | ( | ) |
osgText::Text3D::Text3D | ( | const Text3D & | text, | |
const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY | |||
) |
virtual osgText::Text3D::~Text3D | ( | ) | [inline, protected, virtual] |
osgText::Text3D::META_Object | ( | osgText | , | |
Text3D | ||||
) | const [inline] |
Get the Charactere Depth of text.
void osgText::Text3D::setCharacterDepth | ( | float | characterDepth | ) | [inline] |
Set the Charactere Depth of text.
RenderMode osgText::Text3D::getRenderMode | ( | ) | const [inline] |
Get the render mode used to render the text.
void osgText::Text3D::setRenderMode | ( | RenderMode | renderMode | ) | [inline] |
Set the render mode used to render the text.
void osgText::Text3D::setFont | ( | Font3D * | font = 0 |
) | [inline] |
Get the wall StateSet Get or create the wall StateSet Set the wall StateSet Get the back StateSet Get or create the back StateSet Set the back StateSet Set the Font to use to render the text. setFont(0) sets the use of the default font.
void osgText::Text3D::setFont | ( | osg::ref_ptr< Font3D > | font | ) |
Set the Font to use to render the text.
void osgText::Text3D::setFont | ( | const std::string & | fontfile | ) |
Set the font, loaded from the specified front file, to use to render the text, setFont("") sets the use of the default font. See the osgText::readFontFile function for how the font file will be located.
const Font3D* osgText::Text3D::getFont | ( | ) | const [inline] |
Get the font. Return 0 if default is being used.
virtual void osgText::Text3D::drawImplementation | ( | osg::RenderInfo & | renderInfo | ) | const [virtual] |
Draw the text.
Implements osg::Drawable.
virtual bool osgText::Text3D::supports | ( | const osg::Drawable::AttributeFunctor & | ) | const [inline, virtual] |
return false, osgText::Text does not support accept(AttributeFunctor&).
Reimplemented from osg::Drawable.
virtual bool osgText::Text3D::supports | ( | const osg::Drawable::ConstAttributeFunctor & | ) | const [inline, virtual] |
return true, osgText::Text does support accept(ConstAttributeFunctor&).
Reimplemented from osg::Drawable.
virtual bool osgText::Text3D::supports | ( | const osg::PrimitiveFunctor & | ) | const [inline, virtual] |
accept an ConstAttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has. return true, osgText::Text does support accept(PrimitiveFunctor&) .
Reimplemented from osg::Drawable.
virtual void osgText::Text3D::setThreadSafeRefUnref | ( | bool | threadSafe | ) | [virtual] |
accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has. Set whether to use a mutex to ensure ref() and unref() are thread safe.
Reimplemented from osgText::TextBase.
virtual void osgText::Text3D::resizeGLObjectBuffers | ( | unsigned int | maxSize | ) | [virtual] |
Resize any per context GLObject buffers to specified size.
Reimplemented from osgText::TextBase.
virtual void osgText::Text3D::releaseGLObjects | ( | osg::State * | state = 0 |
) | const [virtual] |
If State is non-zero, this function releases OpenGL objects for the specified graphics context. Otherwise, releases OpenGL objexts for all graphics contexts.
Reimplemented from osgText::TextBase.
void osgText::Text3D::renderPerGlyph | ( | osg::State & | state | ) | const [protected] |
void osgText::Text3D::renderPerFace | ( | osg::State & | state | ) | const [protected] |
String::iterator osgText::Text3D::computeLastCharacterOnLine | ( | osg::Vec2 & | cursor, | |
String::iterator | first, | |||
String::iterator | last | |||
) | [protected] |
Reimplemented from osgText::TextBase.
void osgText::Text3D::computeGlyphRepresentation | ( | ) | [protected, virtual] |
Implements osgText::TextBase.
void osgText::Text3D::computePositions | ( | unsigned int | contextID | ) | const [protected, virtual] |
Implements osgText::TextBase.
friend class Font3D [friend] |
TextRenderInfo osgText::Text3D::_textRenderInfo [protected] |
osg::ref_ptr<Font3D> osgText::Text3D::_font [protected] |
float osgText::Text3D::_characterDepth [protected] |
RenderMode osgText::Text3D::_renderMode [protected] |
osg::ref_ptr<osg::StateSet> osgText::Text3D::_wallStateSet [protected] |
osg::ref_ptr<osg::StateSet> osgText::Text3D::_backStateSet [protected] |