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

openvrml::vrml97_node::text_node Class Reference

Text node instances. More...

Inheritance diagram for openvrml::vrml97_node::text_node:

Inheritance graph
[legend]
Collaboration diagram for openvrml::vrml97_node::text_node:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 text_node (const node_type &type, const scope_ptr &scope)
 Construct.

virtual ~text_node () throw ()
 Destroy.

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

virtual viewer::object_t insert_geometry (openvrml::viewer &viewer, rendering_context context)
 Insert this geometry into viewer's display list.


Private Types

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

typedef std::map< FT_UInt,
glyph_geometry
glyph_geometry_map_t
 Maps FT_UInts to glyph_geometry.


Private Member Functions

virtual void do_initialize (double timestamp) throw (std::bad_alloc)
 Initialize.

virtual void do_shutdown (double timestamp) throw ()
 Shut down.

void process_set_string (const field_value &value, double timestamp) throw (std::bad_cast, std::bad_alloc)
 set_string eventIn handler.

void process_set_fontStyle (const field_value &value, double timestamp) throw (std::bad_cast, std::bad_alloc)
 set_fontStyle eventIn handler.

void process_set_length (const field_value &value, double timestamp) throw (std::bad_cast, std::bad_alloc)
 set_length eventIn handler.

void process_set_maxExtent (const field_value &value, double timestamp) throw (std::bad_cast)
 set_maxExtent eventIn handler.

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

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

void update_geometry () throw (std::bad_alloc)
 Called to update text_geometry.


Private Attributes

mfstring string
 string exposedField.

sfnode fontStyle
 fontStyle exposedField.

mffloat length
 length exposedField.

sffloat maxExtent
 maxExtent exposedField.

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

FT_Face face
 Handle to the font face.

glyph_geometry_map_t glyph_geometry_map
 Map of glyph indices to glyph_geometry.

text_geometry text_geometry_
 The text geometry.


Friends

class text_class
 Class object for Text instances.


Detailed Description

Text node instances.


Member Typedef Documentation

openvrml::vrml97_node::text_node::glyph_geometry_map_t [private]
 

Maps FT_UInts to glyph_geometry.

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

openvrml::vrml97_node::text_node::ucs4_string_t [private]
 

A vector of FcChar32 vectors.


Constructor & Destructor Documentation

openvrml::vrml97_node::text_node::text_node const node_type type,
const scope_ptr scope
 

Construct.

Parameters:
type the node_type associated with the instance.
scope the scope that the new node will belong to.

openvrml::vrml97_node::text_node::~text_node  )  throw () [virtual]
 

Destroy.


Member Function Documentation

void openvrml::vrml97_node::text_node::do_initialize double  timestamp  )  throw (std::bad_alloc) [private, virtual]
 

Initialize.

Parameters:
timestamp the current time.
Exceptions:
std::bad_alloc if memory allocation fails.

Reimplemented from openvrml::node.

void openvrml::vrml97_node::text_node::do_shutdown double  timestamp  )  throw () [private, virtual]
 

Shut down.

Parameters:
timestamp the current time.

Reimplemented from openvrml::node.

viewer::object_t openvrml::vrml97_node::text_node::insert_geometry openvrml::viewer viewer,
rendering_context  context
[virtual]
 

Insert this geometry into viewer's display list.

Parameters:
viewer a Viewer.
context the rendering context.

Implements openvrml::geometry_node.

bool openvrml::vrml97_node::text_node::modified  )  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 openvrml::node.

void openvrml::vrml97_node::text_node::process_set_fontStyle const field_value value,
double  timestamp
throw (std::bad_cast, std::bad_alloc) [private]
 

set_fontStyle eventIn handler.

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

void openvrml::vrml97_node::text_node::process_set_length const field_value value,
double  timestamp
throw (std::bad_cast, std::bad_alloc) [private]
 

set_length eventIn handler.

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

void openvrml::vrml97_node::text_node::process_set_maxExtent const field_value value,
double  timestamp
throw (std::bad_cast) [private]
 

set_maxExtent eventIn handler.

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

void openvrml::vrml97_node::text_node::process_set_string const field_value value,
double  timestamp
throw (std::bad_cast, std::bad_alloc) [private]
 

set_string eventIn handler.

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

void openvrml::vrml97_node::text_node::update_face  )  throw (std::bad_alloc) [private]
 

Called when fontStyle changes to update the font face.

Exceptions:
std::bad_alloc if memory allocation fails.

void openvrml::vrml97_node::text_node::update_geometry  )  throw (std::bad_alloc) [private]
 

Called to update text_geometry.

Exceptions:
std::bad_alloc if memory allocation fails.

void openvrml::vrml97_node::text_node::update_ucs4  )  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

openvrml::vrml97_node::text_node::text_class [friend]
 

Class object for Text instances.


Member Data Documentation

FT_Face openvrml::vrml97_node::text_node::face [private]
 

Handle to the font face.

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

sfnode openvrml::vrml97_node::text_node::fontStyle [private]
 

fontStyle exposedField.

text_node::glyph_geometry_map_t openvrml::vrml97_node::text_node::glyph_geometry_map [private]
 

Map of glyph indices to glyph_geometry.

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

mffloat openvrml::vrml97_node::text_node::length [private]
 

length exposedField.

sffloat openvrml::vrml97_node::text_node::maxExtent [private]
 

maxExtent exposedField.

mfstring openvrml::vrml97_node::text_node::string [private]
 

string exposedField.

text_node::text_geometry openvrml::vrml97_node::text_node::text_geometry_ [private]
 

The text geometry.

text_node::ucs4_string_t openvrml::vrml97_node::text_node::ucs4_string [private]
 

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