36 virtual const char*
className()
const {
return "Text"; }
251 return &itGlyphQuad->second;
309 float bilinearInterpolate(
float x1,
float x2,
float y1,
float y2,
float x,
float y,
float q11,
float q12,
float q21,
float q22)
const;
Vec2f Vec2
Definition Vec2:21
Vec3f Vec3
Definition Vec3:21
Vec4f Vec4
Definition Vec4:21
The osgText library is a NodeKit that extends the core scene graph to support high quality text.
ShaderTechnique
Definition Glyph:42
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
A PrimitiveFunctor is used (in conjunction with osg::Drawable::accept (PrimitiveFunctor&)) to get acc...
Definition PrimitiveSet:54
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Stores a set of modes and attributes which represent a set of OpenGL state.
Definition StateSet:46
Pure virtual base class for fonts.
Definition Font:68
ColorGradientMode getColorGradientMode() const
Definition Text:150
void setBackdropImplementation(BackdropImplementation)
deprecated, value ignored.
Definition Text:210
ColorGradientMode
Definition Text:125
@ SOLID
Definition Text:126
@ PER_CHARACTER
Definition Text:127
@ OVERALL
Definition Text:128
void computeGlyphRepresentation()
bool computeAverageGlyphWidthAndHeight(float &avg_width, float &avg_height) const
BackdropType
Definition Text:57
@ DROP_SHADOW_BOTTOM_CENTER
Definition Text:61
@ DROP_SHADOW_TOP_LEFT
Definition Text:65
@ DROP_SHADOW_CENTER_LEFT
Definition Text:64
@ DROP_SHADOW_BOTTOM_RIGHT
Definition Text:58
@ DROP_SHADOW_CENTER_RIGHT
Definition Text:59
@ DROP_SHADOW_BOTTOM_LEFT
Definition Text:63
@ OUTLINE
Definition Text:66
@ DROP_SHADOW_TOP_CENTER
Definition Text:62
@ DROP_SHADOW_TOP_RIGHT
Definition Text:60
void setBackdropType(BackdropType type)
BackdropType gives you a background shadow text behind your regular text.
ColorGradientMode _colorGradientMode
Definition Text:301
virtual const char * className() const
return the name of the node's class type.
Definition Text:36
const osg::Vec4 & getColorGradientBottomLeft() const
Definition Text:160
const osg::Vec4 & getColorGradientBottomRight() const
Definition Text:161
void setEnableDepthWrites(bool enable)
Turns off writing to the depth buffer when rendering text.
Definition Text:52
BackdropImplementation getBackdropImplementation() const
deprecated, value should be ignored.
Definition Text:212
void setBackdropColor(const osg::Vec4 &color)
This specifies the color of the backdrop text.
const osg::Vec4 & getColorGradientTopRight() const
Definition Text:162
virtual bool supports(const osg::PrimitiveFunctor &) const
return true, osgText::Text does support accept(PrimitiveFunctor&) .
Definition Text:179
void computeColorGradients()
virtual void accept(osg::PrimitiveFunctor &pf) const
accept a PrimtiveFunctor and call its methods to tell it about the internal primitives that this Draw...
BackdropType _backdropType
Definition Text:295
void drawImplementation(osg::State &state, const osg::Vec4 &colorMultiplier) const
void computeColorGradientsOverall()
virtual osg::Object * cloneType() const
clone an object of the same type as the node.
Definition Text:33
String::iterator computeLastCharacterOnLine(osg::Vec2 &cursor, String::iterator first, String::iterator last)
void setColorGradientCorners(const osg::Vec4 &topLeft, const osg::Vec4 &bottomLeft, const osg::Vec4 &bottomRight, const osg::Vec4 &topRight)
Used only for gradient mode, let's you specify the colors of the 4 corners.
float bilinearInterpolate(float x1, float x2, float y1, float y2, float x, float y, float q11, float q12, float q21, float q22) const
Text(const Text &text, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
virtual bool supports(const osg::Drawable::ConstAttributeFunctor &) const
return true, osgText::Text does support accept(ConstAttributeFunctor&).
Definition Text:173
float getBackdropVerticalOffset() const
Definition Text:114
void computeColorGradientsPerCharacter()
void setBackdropOffset(float horizontal, float vertical)
This overloaded version lets you specify the offset for the horizontal and vertical components separa...
float _backdropHorizontalOffset
Definition Text:297
const GlyphQuads * getGlyphQuads(GlyphTexture *texture) const
Direct Access to GlyphQuads.
Definition Text:246
virtual void computePositionsImplementation()
float _backdropVerticalOffset
Definition Text:298
ShaderTechnique getShaderTechnique()
Get the ShaderTechnique hint.
Definition Text:43
BackdropImplementation
deprecated, value ignored.
Definition Text:201
@ DELAYED_DEPTH_WRITES
Definition Text:206
@ STENCIL_BUFFER
Definition Text:205
@ POLYGON_OFFSET
Definition Text:202
@ NO_DEPTH_BUFFER
Definition Text:203
@ DEPTH_RANGE
Definition Text:204
virtual void releaseGLObjects(osg::State *state=0) const
If State is non-zero, this function releases OpenGL objects for the specified graphics context.
virtual bool supports(const osg::Drawable::AttributeFunctor &) const
return false, osgText::Text does not support accept(AttributeFunctor&).
Definition Text:170
osg::Vec4 _colorGradientTopRight
Definition Text:305
ShaderTechnique _shaderTechnique
Definition Text:292
bool _enableDepthWrites
Definition Text:293
TextureGlyphQuadMap _textureGlyphQuadMap
Definition Text:274
virtual void accept(osg::Drawable::ConstAttributeFunctor &af) const
accept an ConstAttributeFunctor and call its methods to tell it about the internal attributes that th...
virtual void resizeGLObjectBuffers(unsigned int maxSize)
Resize any per context GLObject buffers to specified size.
float getBackdropHorizontalOffset() const
Definition Text:112
virtual bool isSameKindAs(const osg::Object *obj) const
return true if this and obj are of the same kind of object.
Definition Text:35
std::map< osg::ref_ptr< GlyphTexture >, GlyphQuads > TextureGlyphQuadMap
Definition Text:243
const TextureGlyphQuadMap & getTextureGlyphQuadMap() const
Definition Text:254
virtual osg::StateSet * createStateSet()
void setColorGradientMode(ColorGradientMode mode)
This sets different types of text coloring modes.
virtual void drawImplementation(osg::RenderInfo &renderInfo) const
Draw the text.
osg::Vec4 _colorGradientTopLeft
Definition Text:302
const osg::Vec4 & getBackdropColor() const
Definition Text:122
virtual osg::Object * clone(const osg::CopyOp ©op) const
return a clone of a node, with Object* return type.
Definition Text:34
virtual const char * libraryName() const
return the name of the node's library.
Definition Text:37
void drawImplementationSinglePass(osg::State &state, const osg::Vec4 &colorMultiplier) const
osg::Vec4 _backdropColor
Definition Text:299
osg::Vec4 _colorGradientBottomRight
Definition Text:304
const osg::Vec4 & getColorGradientTopLeft() const
Definition Text:159
bool getEnableDepthWrites() const
Definition Text:53
void addGlyphQuad(Glyph *glyph, const osg::Vec2 &minc, const osg::Vec2 &maxc, const osg::Vec2 &mintc, const osg::Vec2 &maxtc)
bool getCharacterCorners(unsigned int index, osg::Vec3 &bottomLeft, osg::Vec3 &bottomRight, osg::Vec3 &topLeft, osg::Vec3 &topRight) const
Get the coordinates of the character corners in local coordinates.
void setBackdropOffset(float offset=0.07f)
Sets the amount text is offset to create the backdrop/shadow effect.
void setShaderTechnique(ShaderTechnique technique)
Set the ShaderTechnique hint to specify what fatures in the text shaders to enable.
BackdropType getBackdropType() const
Definition Text:87
osg::Vec4 _colorGradientBottomLeft
Definition Text:303
void releaseGLObjects(osg::State *state=0) const
If State is non-zero, this function releases OpenGL objects for the specified graphics context.
Glyphs & getGlyphs()
Definition Text:227
const Glyphs & getGlyphs() const
Definition Text:228
void setupPrimitives(Text::BackdropType backdropType)
void resizeGLObjectBuffers(unsigned int maxSize)
Resize any per context GLObject buffers to specified size.
std::vector< Glyph * > Glyphs
Definition Text:217
GlyphQuads(const GlyphQuads &gq)
Glyphs _glyphs
Definition Text:219
osg::ref_ptr< osg::DrawElements > _primitives
Definition Text:220
#define NULL
Definition Export:55
#define OSGTEXT_EXPORT
Definition Export:39