Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::TextTXFParam Class Reference

#include <OSGTextTXFParam.h>

List of all members.

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


Detailed Description

Defines a set of parameters used when creating new TXF faces.
Author:
Patrick Dähne

Definition at line 62 of file OSGTextTXFParam.h.


Constructor & Destructor Documentation

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 {}


Member Function Documentation

void osg::TextTXFParam::setCharacters const std::string &  utf8Characters  )  [inline]
 

Sets the characters contained in the texture.

Parameters:
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.

Parameters:
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.

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.

Parameters:
other The other TextTXFParam object.
Returns:
true when both TextTXFParam objects are the same.

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 }


Member Data Documentation

UInt32 osg::TextTXFParam::size
 

The size of the glyphs in pixels

Definition at line 73 of file OSGTextTXFParam.h.

Referenced by operator==().

UInt32 osg::TextTXFParam::gap
 

The gap between glyphs in pixels

Definition at line 76 of file OSGTextTXFParam.h.

Referenced by operator==(), and osg::TextTXFFace::prepareTexture().

UInt32 osg::TextTXFParam::textureWidth
 

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{|}~"
The default character set

Definition at line 58 of file OSGTextTXFParam.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 04:23:09 2005 for OpenSG by  doxygen 1.4.3