#include <OSGTextFaceFactory.h>
Public Member Functions | |
| ~TextFaceFactory () | |
| TextVectorFace * | createVectorFace (const std::string &family, TextFace::Style style=TextFace::STYLE_PLAIN) |
| TextPixmapFace * | createPixmapFace (const std::string &family, TextFace::Style style=TextFace::STYLE_PLAIN, UInt32 size=32) |
| TextTXFFace * | createTXFFace (const std::string &family, TextFace::Style style=TextFace::STYLE_PLAIN, const TextTXFParam ¶m=TextTXFParam()) |
| void | clearCache () |
| void | getFontFamilies (std::vector< std::string > &families) const |
Static Public Member Functions | |
| static bool | isValid (void) |
| static TextFaceFactory & | the () |
Private Types | |
| typedef std::multimap < std::string, TextVectorFace * > | VectorFaceMap |
| typedef std::multimap < std::string, TextPixmapFace * > | PixmapFaceMap |
| typedef std::multimap < std::string, TextTXFFace * > | TXFFaceMap |
Private Member Functions | |
| TextFaceFactory () | |
| TextFaceFactory (const TextFaceFactory &) | |
| const TextFaceFactory & | operator= (const TextFaceFactory &) |
Private Attributes | |
| TextBackend * | _backend |
| VectorFaceMap | _vectorFaceMap |
| PixmapFaceMap | _pixmapFaceMap |
| TXFFaceMap | _txfFaceMap |
Static Private Attributes | |
| static bool | _valid = false |
| static TextFaceFactory | _the |
Definition at line 78 of file OSGTextFaceFactory.h.
typedef std::multimap<std::string, TextVectorFace*> osg::TextFaceFactory::VectorFaceMap [private] |
Defines the map that contains the vector faces
Definition at line 156 of file OSGTextFaceFactory.h.
typedef std::multimap<std::string, TextPixmapFace*> osg::TextFaceFactory::PixmapFaceMap [private] |
Defines the map that contains the pixmap faces
Definition at line 162 of file OSGTextFaceFactory.h.
typedef std::multimap<std::string, TextTXFFace*> osg::TextFaceFactory::TXFFaceMap [private] |
Defines the map that contains the TXF faces
Definition at line 168 of file OSGTextFaceFactory.h.
| osg::TextFaceFactory::~TextFaceFactory | ( | ) |
Destroys the TextFaceFactory object.
Definition at line 118 of file OSGTextFaceFactory.cpp.
References _backend, _valid, and clearCache().
00119 { 00120 _valid = false; 00121 clearCache(); 00122 delete _backend; 00123 }
| osg::TextFaceFactory::TextFaceFactory | ( | ) | [private] |
Default Constructor
Definition at line 95 of file OSGTextFaceFactory.cpp.
References _backend, _valid, osg::addSystemExitFunction(), and osg::terminateFaceFactory().
00096 : _backend(), _vectorFaceMap(), _pixmapFaceMap(), _txfFaceMap() 00097 { 00098 _valid = true; 00099 #if defined(_WIN32) 00100 _backend = new TextWIN32Backend(); 00101 #elif defined(__APPLE__) 00102 _backend = new TextMacBackend(); 00103 //_backend = new TextFT2Backend(); 00104 #elif defined(FT2_LIB) 00105 _backend = new TextFT2Backend(); 00106 #else 00107 _backend = 0; 00108 #endif 00109 00110 addSystemExitFunction(&terminateFaceFactory); 00111 }
| osg::TextFaceFactory::TextFaceFactory | ( | const TextFaceFactory & | ) | [private] |
Copy constructor (not implemented!)
| TextVectorFace* osg::TextFaceFactory::createVectorFace | ( | const std::string & | family, | |
| TextFace::Style | style = TextFace::STYLE_PLAIN | |||
| ) |
Tries to create a vector face.
| family | The font family of the face (Arial, Courier etc.) | |
| style | The style of the face (bold, italic etc.) |
Referenced by osg::TextVectorFace::create().
| TextPixmapFace* osg::TextFaceFactory::createPixmapFace | ( | const std::string & | family, | |
| TextFace::Style | style = TextFace::STYLE_PLAIN, |
|||
| UInt32 | size = 32 | |||
| ) |
Tries to create a pixmap face.
| family | The font family of the face (Arial, Courier etc.) | |
| style | The style of the face (bold, italic etc.) | |
| size | The size of the pixmap font in pixels. |
Referenced by osg::TextPixmapFace::create().
| TextTXFFace* osg::TextFaceFactory::createTXFFace | ( | const std::string & | family, | |
| TextFace::Style | style = TextFace::STYLE_PLAIN, |
|||
| const TextTXFParam & | param = TextTXFParam() | |||
| ) |
Tries to create a TXF face.
| family | The font family of the face (Arial, Courier etc.) | |
| style | The style of the face (bold, italic etc.) | |
| param | Parameters that affect the creation of the TXF face. |
| void osg::TextFaceFactory::clearCache | ( | ) |
Removes all faces from the face cache.
Definition at line 219 of file OSGTextFaceFactory.cpp.
References _pixmapFaceMap, _txfFaceMap, _vectorFaceMap, and osg::subRefP().
Referenced by ~TextFaceFactory().
00220 { 00221 // Vector faces 00222 VectorFaceMap::iterator vIt; 00223 for (vIt = _vectorFaceMap.begin(); vIt != _vectorFaceMap.end(); ++vIt) 00224 { 00225 assert(vIt->second != 0); 00226 subRefP(vIt->second); 00227 } 00228 _vectorFaceMap.clear(); 00229 00230 // Pixmap faces 00231 PixmapFaceMap::iterator pIt; 00232 for (pIt = _pixmapFaceMap.begin(); pIt != _pixmapFaceMap.end(); ++pIt) 00233 { 00234 assert(pIt->second != 0); 00235 subRefP(pIt->second); 00236 } 00237 _pixmapFaceMap.clear(); 00238 00239 // TXF faces 00240 TXFFaceMap::iterator tIt; 00241 for (tIt = _txfFaceMap.begin(); tIt != _txfFaceMap.end(); ++tIt) 00242 { 00243 assert(tIt->second != 0); 00244 subRefP(tIt->second); 00245 } 00246 _txfFaceMap.clear(); 00247 }
| void osg::TextFaceFactory::getFontFamilies | ( | std::vector< std::string > & | families | ) | const |
Returns the names of all font families available.
| families | A vector that gets filled with the names of all font families. |
| bool osg::TextFaceFactory::isValid | ( | void | ) | [static] |
Definition at line 261 of file OSGTextFaceFactory.cpp.
References _valid.
00262 { 00263 return _valid; 00264 }
| TextFaceFactory & osg::TextFaceFactory::the | ( | void | ) | [inline, static] |
Returns the single instance of the FaceFactory singleton.
Definition at line 43 of file OSGTextFaceFactory.inl.
References _the.
Referenced by osg::TextVectorFace::create(), and osg::TextPixmapFace::create().
00043 { return _the; }
| const TextFaceFactory& osg::TextFaceFactory::operator= | ( | const TextFaceFactory & | ) | [private] |
Copy operator (not implemented!)
bool osg::TextFaceFactory::_valid = false [static, private] |
The single instance of the TextFaceFactory singleton
Definition at line 149 of file OSGTextFaceFactory.h.
Referenced by isValid(), TextFaceFactory(), and ~TextFaceFactory().
TextFaceFactory osg::TextFaceFactory::_the [static, private] |
TextBackend* osg::TextFaceFactory::_backend [private] |
The backend that creates all faces
Definition at line 153 of file OSGTextFaceFactory.h.
Referenced by TextFaceFactory(), and ~TextFaceFactory().
The map of vector faces currently instantiated (face cache)
Definition at line 159 of file OSGTextFaceFactory.h.
Referenced by clearCache().
The map of pixmap faces currently instanciated (face cache)
Definition at line 165 of file OSGTextFaceFactory.h.
Referenced by clearCache().
TXFFaceMap osg::TextFaceFactory::_txfFaceMap [private] |
The map of TXF faces currently instantiated (face cache)
Definition at line 171 of file OSGTextFaceFactory.h.
Referenced by clearCache().
1.5.5