#include <OSGTextTXFGlyph.h>

Definition at line 61 of file OSGTextTXFGlyph.h.
typedef Int32 osg::TextGlyph::Index [inherited] |
Defines the glyph index
Definition at line 65 of file OSGTextGlyph.h.
Defines the coordinate indices
Definition at line 180 of file OSGTextTXFGlyph.h.
00180 { COORD_LEFT = 0, COORD_TOP = 1, COORD_RIGHT = 2, COORD_BOTTOM = 3 };
anonymous enum [inherited] |
Defines the invalid glyph index
Definition at line 68 of file OSGTextGlyph.h.
00068 { INVALID_INDEX = -1 };
| osg::TextTXFGlyph::~TextTXFGlyph | ( | ) | [virtual] |
| osg::TextTXFGlyph::TextTXFGlyph | ( | ) | [protected] |
Creates a new TextTXFGlyph object.
Definition at line 49 of file OSGTextTXFGlyph.cpp.
References _texCoord, COORD_BOTTOM, COORD_LEFT, COORD_RIGHT, and COORD_TOP.
00050 : TextGlyph(), _width(0), _height(0), _horiBearingX(0), _horiBearingY(0), 00051 _vertBearingX(0), _vertBearingY(0), _x(0), _y(0), _scale(1.f), _texCoord() 00052 { 00053 _texCoord[COORD_LEFT] = _texCoord[COORD_BOTTOM] = 00054 _texCoord[COORD_RIGHT] = _texCoord[COORD_TOP] = 0.f; 00055 }
| osg::TextTXFGlyph::TextTXFGlyph | ( | const TextTXFGlyph & | ) | [private] |
Copy constructor (not implemented!)
| Real32 osg::TextTXFGlyph::getWidth | ( | void | ) | const [virtual] |
Returns the width of the glyph.
Implements osg::TextGlyph.
Definition at line 69 of file OSGTextTXFGlyph.cpp.
References _scale, and _width.
Referenced by osg::TextTXFFace::addToGeom(), osg::SimpleStatisticsForeground::drawCharacters(), and osg::GraphicStatisticsForeground::drawString().
| Real32 osg::TextTXFGlyph::getHeight | ( | void | ) | const [virtual] |
Returns the height of the glyph.
Implements osg::TextGlyph.
Definition at line 77 of file OSGTextTXFGlyph.cpp.
References _height, and _scale.
Referenced by osg::TextTXFFace::addToGeom(), osg::SimpleStatisticsForeground::drawCharacters(), and osg::GraphicStatisticsForeground::drawString().
| Real32 osg::TextTXFGlyph::getHoriBearingX | ( | ) | const [virtual] |
Returns the x bearing of the glyph for horizontal layout. The x bearing is the distance from the origin to the left border of the glyph.
Implements osg::TextGlyph.
Definition at line 85 of file OSGTextTXFGlyph.cpp.
References _horiBearingX, and _scale.
00086 { return static_cast<Real32>(_horiBearingX) * _scale; }
| Real32 osg::TextTXFGlyph::getHoriBearingY | ( | ) | const [virtual] |
Returns the y bearing of the glyph for horizontal layout. The y bearing is the distance from the origin to the top border of the glyph.
Implements osg::TextGlyph.
Definition at line 93 of file OSGTextTXFGlyph.cpp.
References _horiBearingY, and _scale.
00094 { return static_cast<Real32>(_horiBearingY) * _scale; }
| Real32 osg::TextTXFGlyph::getVertBearingX | ( | ) | const [virtual] |
Returns the x bearing of the glyph for vertical layout. The x bearing is the distance from the origin to the left border of the glyph.
Implements osg::TextGlyph.
Definition at line 101 of file OSGTextTXFGlyph.cpp.
References _scale, and _vertBearingX.
00102 { return static_cast<Real32>(_vertBearingX) * _scale; }
| Real32 osg::TextTXFGlyph::getVertBearingY | ( | ) | const [virtual] |
Returns the y bearing of the glyph for vertical layout. The y bearing is the distance from the origin to the top border of the glyph.
Implements osg::TextGlyph.
Definition at line 109 of file OSGTextTXFGlyph.cpp.
References _scale, and _vertBearingY.
00110 { return static_cast<Real32>(_vertBearingY) * _scale; }
| UInt32 osg::TextTXFGlyph::getX | ( | ) | const [inline] |
Returns the x position of the glyph in the texture.
Definition at line 50 of file OSGTextTXFGlyph.inl.
References _x.
00050 { return _x; }
| UInt32 osg::TextTXFGlyph::getY | ( | ) | const [inline] |
Returns the y position of the glyph in the texture.
Definition at line 53 of file OSGTextTXFGlyph.inl.
References _y.
00053 { return _y; }
| UInt32 osg::TextTXFGlyph::getPixmapWidth | ( | ) | const [inline] |
Returns the width of the glyph in pixels.
Definition at line 56 of file OSGTextTXFGlyph.inl.
References _width.
Referenced by osg::TextTXFFace::prepareTexture().
00056 { return _width; }
| UInt32 osg::TextTXFGlyph::getPixmapHeight | ( | ) | const [inline] |
Returns the height of the glyph in pixels.
Definition at line 59 of file OSGTextTXFGlyph.inl.
References _height.
Referenced by osg::TextTXFFace::prepareTexture().
00059 { return _height; }
| Int32 osg::TextTXFGlyph::getPixmapHoriBearingX | ( | ) | const [inline] |
Returns the x bearing of the glyph in pixels for horizontal layout. The x bearing is the distance from the origin to the left border of the glyph.
Definition at line 62 of file OSGTextTXFGlyph.inl.
References _horiBearingX.
00062 { return _horiBearingX; }
| Int32 osg::TextTXFGlyph::getPixmapHoriBearingY | ( | ) | const [inline] |
Returns the y bearing of the glyph in pixels for horizontal layout. The y bearing is the distance from the origin to the top border of the glyph.
Definition at line 65 of file OSGTextTXFGlyph.inl.
References _horiBearingY.
00065 { return _horiBearingY; }
| Int32 osg::TextTXFGlyph::getPixmapVertBearingX | ( | ) | const [inline] |
Returns the x bearing of the glyph in pixels for vertical layout. The x bearing is the distance from the origin to the left border of the glyph.
Definition at line 68 of file OSGTextTXFGlyph.inl.
References _vertBearingX.
00068 { return _vertBearingX; }
| Int32 osg::TextTXFGlyph::getPixmapVertBearingY | ( | ) | const [inline] |
Returns the y bearing of the glyph in pixels for vertical layout. The y bearing is the distance from the origin to the top border of the glyph.
Definition at line 71 of file OSGTextTXFGlyph.inl.
References _vertBearingY.
00071 { return _vertBearingY; }
| Real32 osg::TextTXFGlyph::getScale | ( | void | ) | const [inline] |
Returns the scale factor.
Definition at line 74 of file OSGTextTXFGlyph.inl.
References _scale.
00074 { return _scale; }
Returns a texture coordinate.
| index | The index of the texture coordinate (must be between 0 and 3, inclusively) |
Definition at line 77 of file OSGTextTXFGlyph.inl.
References _texCoord.
Referenced by osg::TextTXFFace::addToGeom(), osg::SimpleStatisticsForeground::drawCharacters(), and osg::GraphicStatisticsForeground::drawString().
00078 { 00079 assert(index < 4); 00080 return _texCoord[index]; 00081 }
Returns a coordinate.
| index | The index of the coordinate (must be between 0 and 3, inclusively) |
| void osg::TextTXFGlyph::calculateCoordinates | ( | UInt32 | textureWidth, | |
| UInt32 | textureHeight | |||
| ) | [protected] |
Calculates coordinates
Definition at line 117 of file OSGTextTXFGlyph.cpp.
References _height, _texCoord, _width, _x, _y, COORD_BOTTOM, COORD_LEFT, COORD_RIGHT, and COORD_TOP.
00119 { 00120 Real32 w = static_cast<Real32>(textureWidth); 00121 Real32 h = static_cast<Real32>(textureHeight); 00122 _texCoord[TextTXFGlyph::COORD_LEFT] = _x / w; 00123 _texCoord[TextTXFGlyph::COORD_BOTTOM] = _y / h; 00124 _texCoord[TextTXFGlyph::COORD_RIGHT] = (_x + _width) / w; 00125 _texCoord[TextTXFGlyph::COORD_TOP] = (_y + _height) / h; 00126 }
| const TextTXFGlyph& osg::TextTXFGlyph::operator= | ( | const TextTXFGlyph & | ) | [private] |
Copy operator (not implemented!)
| TextGlyph::Index osg::TextGlyph::getGlyphIndex | ( | ) | const [inline, inherited] |
Returns the index of the glyph.
Definition at line 43 of file OSGTextGlyph.inl.
References osg::TextGlyph::_glyphIndex.
00043 { return _glyphIndex; }
| Real32 osg::TextGlyph::getHoriAdvance | ( | ) | const [inline, inherited] |
Returns the advance of the glyph for horizontal layout. The advance is the distance to the next character on the base line.
Definition at line 46 of file OSGTextGlyph.inl.
References osg::TextGlyph::_horiAdvance.
00046 { return _horiAdvance; }
| Real32 osg::TextGlyph::getVertAdvance | ( | ) | const [inline, inherited] |
Returns the advance of the glyph for vertical layout. The advance is the distance to the next character on the base line. This value is usually negative!
Definition at line 49 of file OSGTextGlyph.inl.
References osg::TextGlyph::_vertAdvance.
00049 { return _vertAdvance; }
friend class TextTXFFace [friend] |
Needs access to constructor
Definition at line 65 of file OSGTextTXFGlyph.h.
UInt32 osg::TextTXFGlyph::_width [protected] |
The width of the glyph in pixels
Definition at line 205 of file OSGTextTXFGlyph.h.
Referenced by calculateCoordinates(), getPixmapWidth(), and getWidth().
UInt32 osg::TextTXFGlyph::_height [protected] |
The height of the glyph in pixels
Definition at line 208 of file OSGTextTXFGlyph.h.
Referenced by calculateCoordinates(), getHeight(), and getPixmapHeight().
Int32 osg::TextTXFGlyph::_horiBearingX [protected] |
The x bearing of the glyph in pixels for horizontal layout
Definition at line 211 of file OSGTextTXFGlyph.h.
Referenced by getHoriBearingX(), and getPixmapHoriBearingX().
Int32 osg::TextTXFGlyph::_horiBearingY [protected] |
The y bearing of the glyph in pixels for horizontal layout
Definition at line 214 of file OSGTextTXFGlyph.h.
Referenced by getHoriBearingY(), and getPixmapHoriBearingY().
Int32 osg::TextTXFGlyph::_vertBearingX [protected] |
The x bearing of the glyph in pixels for vertical layout
Definition at line 217 of file OSGTextTXFGlyph.h.
Referenced by getPixmapVertBearingX(), and getVertBearingX().
Int32 osg::TextTXFGlyph::_vertBearingY [protected] |
The y bearing of the glyph in pixels for vertical layout
Definition at line 220 of file OSGTextTXFGlyph.h.
Referenced by getPixmapVertBearingY(), and getVertBearingY().
UInt32 osg::TextTXFGlyph::_x [protected] |
The x position of the glyph in the texture in pixels
Definition at line 223 of file OSGTextTXFGlyph.h.
Referenced by calculateCoordinates(), and getX().
UInt32 osg::TextTXFGlyph::_y [protected] |
The y position of the glyph in the texture in pixels
Definition at line 226 of file OSGTextTXFGlyph.h.
Referenced by calculateCoordinates(), and getY().
Real32 osg::TextTXFGlyph::_scale [protected] |
The scaling factor
Definition at line 229 of file OSGTextTXFGlyph.h.
Referenced by getHeight(), getHoriBearingX(), getHoriBearingY(), getScale(), getVertBearingX(), getVertBearingY(), and getWidth().
Real32 osg::TextTXFGlyph::_texCoord[4] [protected] |
The texture coordinates
Definition at line 232 of file OSGTextTXFGlyph.h.
Referenced by calculateCoordinates(), getTexCoord(), and TextTXFGlyph().
Index osg::TextGlyph::_glyphIndex [protected, inherited] |
The index of the glyph
Definition at line 145 of file OSGTextGlyph.h.
Referenced by osg::TextGlyph::getGlyphIndex().
Real32 osg::TextGlyph::_horiAdvance [protected, inherited] |
The advance of the glyph for horizontal layout
Definition at line 148 of file OSGTextGlyph.h.
Referenced by osg::TextGlyph::getHoriAdvance().
Real32 osg::TextGlyph::_vertAdvance [protected, inherited] |
The advance of the glyph for vertical layout
Definition at line 151 of file OSGTextGlyph.h.
Referenced by osg::TextGlyph::getVertAdvance().
1.5.5