#include <OSGTextTXFParam.h>
Public Member Functions | |
| TextTXFParam () | |
| void | setCharacters (const std::string &utf8Characters) |
| void | setCharacters (const std::wstring &characters) |
| const std::wstring & | getCharacters () const |
| bool | operator== (const TextTXFParam &other) const |
Public Attributes | |
| UInt32 | size |
| UInt32 | gap |
| UInt32 | textureWidth |
Private Member Functions | |
| void | normalizeCharacters () |
Private Attributes | |
| std::wstring | _characters |
Static Private Attributes | |
| static std::wstring | _defaultCharacters |
Definition at line 62 of file OSGTextTXFParam.h.
| osg::TextTXFParam::TextTXFParam | ( | ) | [inline] |
Creates a new TextTXFParam object.
Definition at line 46 of file OSGTextTXFParam.inl.
00047 : size(46), gap(1), textureWidth(0), 00048 _characters(_defaultCharacters) 00049 {}
| void osg::TextTXFParam::setCharacters | ( | const std::string & | utf8Characters | ) | [inline] |
Sets the characters contained in the texture.
| The | UTF-8 encoded characters contained in the texture. |
Definition at line 52 of file OSGTextTXFParam.inl.
References _characters, osg::TextFace::convertUTF8ToUnicode(), and normalizeCharacters().
00053 { 00054 TextFace::convertUTF8ToUnicode(utf8Characters, _characters); 00055 normalizeCharacters(); 00056 }
| void osg::TextTXFParam::setCharacters | ( | const std::wstring & | characters | ) | [inline] |
Sets the characters contained in the texture.
| The | unicode characters contained in the texture. |
Definition at line 59 of file OSGTextTXFParam.inl.
References _characters, and normalizeCharacters().
00060 { 00061 _characters = characters; 00062 normalizeCharacters(); 00063 }
| const std::wstring & osg::TextTXFParam::getCharacters | ( | ) | const [inline] |
Returns the characters contained in the texture.
Definition at line 66 of file OSGTextTXFParam.inl.
References _characters.
00066 { return _characters; }
| bool osg::TextTXFParam::operator== | ( | const TextTXFParam & | other | ) | const |
Compares the TextTXFParam object with another TextTXFParam object.
| other | The other TextTXFParam object. |
Definition at line 66 of file OSGTextTXFParam.cpp.
References _characters, gap, size, and textureWidth.
00067 { 00068 return (size == other.size) && (gap == other.gap) && 00069 (textureWidth == other.textureWidth) && (_characters == other._characters); 00070 }
| void osg::TextTXFParam::normalizeCharacters | ( | ) | [private] |
Sorts the characters in the character string and removes duplicates
Definition at line 77 of file OSGTextTXFParam.cpp.
References _characters.
Referenced by setCharacters().
00078 { 00079 sort(_characters.begin(), _characters.end()); 00080 wstring::iterator newEnd = unique(_characters.begin(), _characters.end()); 00081 _characters.erase(newEnd, _characters.end()); 00082 }
The size of the glyphs in pixels
Definition at line 73 of file OSGTextTXFParam.h.
Referenced by osg::SimpleStatisticsForeground::draw(), osg::SimpleStatisticsForeground::initText(), and operator==().
The gap between glyphs in pixels
Definition at line 76 of file OSGTextTXFParam.h.
Referenced by operator==(), and osg::TextTXFFace::prepareTexture().
The width of the texture in pixels
Definition at line 79 of file OSGTextTXFParam.h.
Referenced by operator==(), and osg::TextTXFFace::prepareTexture().
std::wstring osg::TextTXFParam::_characters [private] |
The characters contained in the texture
Definition at line 110 of file OSGTextTXFParam.h.
Referenced by getCharacters(), normalizeCharacters(), operator==(), and setCharacters().
wstring osg::TextTXFParam::_defaultCharacters [static, private] |
Initial value:
L" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
Definition at line 113 of file OSGTextTXFParam.h.
1.5.5