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

openvrml::vrml97_node::transform_node Class Reference

Transform node instances. More...

Inheritance diagram for openvrml::vrml97_node::transform_node:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

virtual ~transform_node () throw ()
 Destroy.

virtual void render (openvrml::viewer &viewer, rendering_context context)
 Render the node.

virtual const openvrml::bounding_volumebounding_volume () const
 Get the bounding volume.

virtual const mat4ftransform () const throw ()
 Get the transformation associated with the node as a matrix.


Private Member Functions

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

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

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

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

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

void recalc_bsphere ()
 Recalculate the bounding volume.

void update_transform () const throw ()
 Update transform.


Private Attributes

sfvec3f center
 center exposedField.

sfrotation rotation
 rotation exposedField.

sfvec3f scale
 scale exposedField.

sfrotation scaleOrientation
 scaleOrientation exposedField.

sfvec3f translation
 translation exposedField.

mat4f transform_
 Cached copy of this node's transformation.

bool transform_dirty
 Flag to indicate whether transform_ needs to be updated.

viewer::object_t xformObject
 A handle to the renderer's representation of the Transform.


Friends

class transform_class
 Class object for Transform instances.


Detailed Description

Transform node instances.


Constructor & Destructor Documentation

openvrml::vrml97_node::transform_node::transform_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.

Reimplemented from openvrml::transform_node.


Member Function Documentation

const bounding_volume & openvrml::vrml97_node::transform_node::bounding_volume  )  const [virtual]
 

Get the bounding volume.

Returns:
the bounding volume associated with the node.

Reimplemented from openvrml::vrml97_node::group_node.

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

set_center eventIn handler.

Parameters:
value an sfvec3f value.
timestamp the current time.
Exceptions:
std::bad_cast if value is not an sfvec3f.

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

set_rotation eventIn handler.

Parameters:
value an sfrotation value.
timestamp the current time.
Exceptions:
std::bad_cast if value is not an sfrotation.

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

set_scale eventIn handler.

Parameters:
value an sfvec3f value.
timestamp the current time.
Exceptions:
std::bad_cast if value is not an sfvec3f.

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

set_scaleOrientation eventIn handler.

Parameters:
value an sfrotation value.
timestamp the current time.
Exceptions:
std::bad_cast if value is not an sfrotation.

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

set_translation eventIn handler.

Parameters:
value an sfvec3f value.
timestamp the current time.
Exceptions:
std::bad_cast if value is not an sfvec3f.

void openvrml::vrml97_node::transform_node::render openvrml::viewer viewer,
rendering_context  context
[virtual]
 

Render the node.

Parameters:
viewer a Viewer.
context the rendering context.

Reimplemented from openvrml::vrml97_node::group_node.

const mat4f & openvrml::vrml97_node::transform_node::transform  )  const throw () [virtual]
 

Get the transformation associated with the node as a matrix.

Returns:
the transformation associated with the node.

Implements openvrml::transform_node.

void openvrml::vrml97_node::transform_node::update_transform  )  const throw () [private]
 

Update transform.

If transform_dirty is true, resynchronize the cached matrix transform with the node fields; otherwise do nothing.

Note:
P' = T × C × R × SR × S × -SR × -C × P