Main Page   Namespace List   Class Hierarchy   Compound List   Namespace Members   Compound Members   Related Pages  

Text Class Reference

Text node instances. More...

Inheritance diagram for Text:

AbstractGeometry AbstractBase GeometryNode Node Node List of all members.

Public Methods

 Text (const NodeType &nodeType, const ScopePtr &scope)
 Constructor.

virtual ~Text () throw ()
 Destructor.

virtual bool isModified () const
 Determine whether the node has been modified.

virtual void updateModified (NodePath &path, int flags=0x003)
 Propagate the bvolume dirty flag from children to parents.

virtual Viewer::Object insertGeometry (Viewer &viewer, VrmlRenderContext context)
 Insert this geometry into viewer's display list.


Private Types

typedef std::vector< std::vector<
FcChar32 > > 
Ucs4String
 A vector of FcChar32 vectors.

typedef std::map< FT_UInt,
GlyphGeometry
GlyphGeometryMap
 Maps FT_UInts to GlyphGeometry.


Private Methods

virtual void initializeImpl (double timestamp) throw ()
 Initialize.

void processSet_string (const FieldValue &mfstring, double timestamp) throw (std::bad_cast, std::bad_alloc)
 set_string eventIn handler.

void processSet_fontStyle (const FieldValue &sfnode, double timestamp) throw (std::bad_cast, std::bad_alloc)
 set_fontStyle eventIn handler.

void processSet_length (const FieldValue &mffloat, double timestamp) throw (std::bad_cast, std::bad_alloc)
 set_length eventIn handler.

void processSet_maxExtent (const FieldValue &sffloat, double timestamp) throw (std::bad_cast)
 set_maxExtent eventIn handler.

void updateUcs4 () throw (std::bad_alloc)
 Called when string changes to update the UCS-4 text.

void updateFace () throw (std::bad_alloc)
 Called when fontStyle changes to update the font face.

void updateGeometry () throw (std::bad_alloc)
 Called to update textGeometry.


Private Attributes

MFString string
 string exposedField.

SFNode fontStyle
 fontStyle exposedField.

MFFloat length
 length exposedField.

SFFloat maxExtent
 maxExtent exposedField.

Ucs4String ucs4String
 UCS-4 equivalent of the (UTF-8) data in string.

FT_Face face
 Handle to the font face.

GlyphGeometryMap glyphGeometryMap
 Map of glyph indices to GlyphGeometry.

TextGeometry textGeometry
 The text geometry.


Friends

class TextClass
 Class object for Text instances.


Detailed Description

Text node instances.


Member Typedef Documentation

GlyphGeometryMap [private]
 

Maps FT_UInts to GlyphGeometry.

See also:
http://freetype.org/freetype2/docs/reference/ft2-basic_types.html#FT_UInt

Ucs4String [private]
 

A vector of FcChar32 vectors.


Constructor & Destructor Documentation

Text const NodeType   nodeType,
const ScopePtr   scope
 

Constructor.

Parameters:
nodeType the NodeType associated with the instance.
scope the Scope that the new node will belong to.

~Text   throw () [virtual]
 

Destructor.


Member Function Documentation

void initializeImpl double    timestamp throw () [private, virtual]
 

Initialize.

Parameters:
timestamp the current time.

Reimplemented from Node.

Viewer::Object insertGeometry Viewer   viewer,
VrmlRenderContext    context
[virtual]
 

Insert this geometry into viewer's display list.

Parameters:
viewer a Viewer.
context the rendering context.

Implements GeometryNode.

bool isModified   const [virtual]
 

Determine whether the node has been modified.

Returns:
true if the node or one of its children has been modified, false otherwise.

Reimplemented from Node.

void processSet_fontStyle const FieldValue   sfnode,
double    timestamp
throw (std::bad_cast, std::bad_alloc) [private]
 

set_fontStyle eventIn handler.

Parameters:
sfnode an SFNode value.
timestamp the current time.
Exceptions:
std::bad_cast if sfnode is not an SFNode.
std::bad_alloc if memory allocation fails.

void processSet_length const FieldValue   mffloat,
double    timestamp
throw (std::bad_cast, std::bad_alloc) [private]
 

set_length eventIn handler.

Parameters:
mffloat an MFFloat value.
timestamp the current time.
Exceptions:
std::bad_cast if mffloat is not an MFFloat.
std::bad_alloc if memory allocation fails.

void processSet_maxExtent const FieldValue   sffloat,
double    timestamp
throw (std::bad_cast) [private]
 

set_maxExtent eventIn handler.

Parameters:
sffloat an SFFloat value.
timestamp the current time.
Exceptions:
std::bad_cast if sffloat is not an SFFloat.
std::bad_alloc if memory allocation fails.

void processSet_string const FieldValue   mfstring,
double    timestamp
throw (std::bad_cast, std::bad_alloc) [private]
 

set_string eventIn handler.

Parameters:
mfstring an MFString value.
timestamp the current time.
Exceptions:
std::bad_cast if mfstring is not an MFString.
std::bad_alloc if memory allocation fails.

void updateFace   throw (std::bad_alloc) [private]
 

Called when fontStyle changes to update the font face.

Exceptions:
std::bad_alloc if memory allocation fails.

void updateGeometry   throw (std::bad_alloc) [private]
 

Called to update textGeometry.

Exceptions:
std::bad_alloc if memory allocation fails.

void updateModified NodePath &    path,
int    flags = 0x003
[virtual]
 

Propagate the bvolume dirty flag from children to parents.

Parameters:
path stack of ancestor nodes.
flags 1 indicates normal modified flag, 2 indicates the bvolume dirty flag, 3 indicates both.

Reimplemented from Node.

void updateUcs4   throw (std::bad_alloc) [private]
 

Called when string changes to update the UCS-4 text.

Exceptions:
std::bad_alloc if memory allocation fails.

Friends And Related Function Documentation

TextClass [friend]
 

Class object for Text instances.


Member Data Documentation

FT_Face face [private]
 

Handle to the font face.

See also:
http://freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_Face

SFNode fontStyle [private]
 

fontStyle exposedField.

Text::GlyphGeometryMap glyphGeometryMap [private]
 

Map of glyph indices to GlyphGeometry.

GlyphGeometry instances are created as needed, as new glyphs are encountered. Once they are created, they are cached in the glyphGeometryMap for rapid retrieval the next time the glyph is encountered.

MFFloat length [private]
 

length exposedField.

SFFloat maxExtent [private]
 

maxExtent exposedField.

MFString string [private]
 

string exposedField.

Text::TextGeometry textGeometry [private]
 

The text geometry.

Text::Ucs4String ucs4String [private]
 

UCS-4 equivalent of the (UTF-8) data in string.