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

Transform Class Reference

Transform node instances. More...

Inheritance diagram for Transform:

Group AbstractChild AbstractBase ChildNode Node Node List of all members.

Public Methods

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

virtual ~Transform () throw ()
 Destructor.

virtual void render (Viewer &viewer, VrmlRenderContext context)
 Render the node.

virtual void accumulateTransform (Node *)
virtual void inverseTransform (VrmlMatrix &)
 Get the inverse of the transformation applied by the Transform node as a matrix.

virtual const BVolumegetBVolume () const
 Get the bounding volume.

void getMatrix (VrmlMatrix &M) const

Private Methods

void processSet_center (const FieldValue &sfvec3f, double timestamp) throw (std::bad_cast)
 set_center eventIn handler.

void processSet_rotation (const FieldValue &sfrotation, double timestamp) throw (std::bad_cast)
 set_rotation eventIn handler.

void processSet_scale (const FieldValue &sfvec3f, double timestamp) throw (std::bad_cast)
 set_scale eventIn handler.

void processSet_scaleOrientation (const FieldValue &sfrotation, double timestamp) throw (std::bad_cast)
 set_scaleOrientation eventIn handler.

void processSet_translation (const FieldValue &sfvec3f, double timestamp) throw (std::bad_cast)
 set_translation eventIn handler.

void recalcBSphere ()
 Recalculate the bounding volume.

void synch_cached_matrix ()

Private Attributes

SFVec3f center
 center exposedField.

SFRotation rotation
 rotation exposedField.

SFVec3f scale
 scale exposedField.

SFRotation scaleOrientation
 scaleOrientation exposedField.

SFVec3f translation
 translation exposedField.

Viewer::Object xformObject
 A handle to the renderer's representation of the Transform.

VrmlMatrix M
 Cached copy of this node's transformation.

bool M_dirty
 If true, we need to recalculate M.


Friends

class TransformClass
 Class object for Transform instances.


Detailed Description

Transform node instances.


Constructor & Destructor Documentation

Transform 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.

~Transform   throw () [virtual]
 

Destructor.


Member Function Documentation

void accumulateTransform Node   parent [virtual]
 

Cache a pointer to (one of the) parent transforms for proper rendering of bindables.

Reimplemented from Group.

const BVolume * getBVolume   const [virtual]
 

Get the bounding volume.

Returns:
the bounding volume associated with the node.

Reimplemented from Group.

void getMatrix VrmlMatrix   M_out const
 

Get a matrix representation (in VrmlMatrix format, same as OGL) of the transformation stored in the node fields.

Returns:
a copy of the cached transformation matrix

void inverseTransform VrmlMatrix   m [virtual]
 

Get the inverse of the transformation applied by the Transform node as a matrix.

Return values:
m the inverse transform as a matrix.
Precondition:
m is a unit matrix.

Reimplemented from Node.

void processSet_center const FieldValue   sfvec3f,
double    timestamp
throw (std::bad_cast) [private]
 

set_center eventIn handler.

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

void processSet_rotation const FieldValue   sfrotation,
double    timestamp
throw (std::bad_cast) [private]
 

set_rotation eventIn handler.

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

void processSet_scale const FieldValue   sfvec3f,
double    timestamp
throw (std::bad_cast) [private]
 

set_scale eventIn handler.

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

void processSet_scaleOrientation const FieldValue   sfrotation,
double    timestamp
throw (std::bad_cast) [private]
 

set_scaleOrientation eventIn handler.

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

void processSet_translation const FieldValue   sfvec3f,
double    timestamp
throw (std::bad_cast) [private]
 

set_translation eventIn handler.

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

void recalcBSphere   [private, virtual]
 

Recalculate the bounding volume.

Reimplemented from Group.

void render Viewer   viewer,
VrmlRenderContext    context
[virtual]
 

Render the node.

Parameters:
viewer a Viewer.
context the rendering context.

Reimplemented from Group.

void synch_cached_matrix   [private]
 

Resynchronize the cached matrix M with the node fields, but only if M_dirty is true. Think logical const.


Friends And Related Function Documentation

TransformClass [friend]
 

Class object for Transform instances.


Member Data Documentation

SFVec3f center [private]
 

center exposedField.

VrmlMatrix M [private]
 

Cached copy of this node's transformation.

Currently this is used only by the culling code, but eventually all the matrix manipulation needs to be moved from the Viewer side over into core.

M_dirty [private]
 

If true, we need to recalculate M.

Is this the same as Node::d_modified? No, since it's entirely a core-side issue, and has nothing to do with the viewer being out of date wrt the core scene graph.

SFRotation rotation [private]
 

rotation exposedField.

SFVec3f scale [private]
 

scale exposedField.

SFRotation scaleOrientation [private]
 

scaleOrientation exposedField.

SFVec3f translation [private]
 

translation exposedField.

Viewer::Object xformObject [private]
 

A handle to the renderer's representation of the Transform.