SimpleTransformable Class Reference
[Basic]

Simple implementation of Transformable. More...

#include <SimpleTransformable.hpp>

Inheritance diagram for SimpleTransformable:
Node Transformable NodeListener Light SimpleDrawable Fullscreen Shape Cone Disk Hexahedron Line Square Boolean Box Cube BooleanAnd BooleanXor

List of all members.

Public Member Functions

 SimpleTransformable (const Tag &tag)
virtual void associate ()
virtual Extent getExtent ()
virtual Vector getPosition ()
virtual void onNodeEvent (NodeEvent &event)

Protected Member Functions

void updatePositionExtent ()

Private Attributes

bool valid
list< Transformation * > transforms
Extent extent
Vector position

Detailed Description

Simple implementation of Transformable.


Member Function Documentation

Extent getExtent (  )  [virtual]
Returns:
Model-matrix boundaries of the item in the scene.
See also:
getPosition()

Implements Transformable.

Vector getPosition (  )  [virtual]
Returns:
Model-matrix position of the item in the scene.

Lazily calculates the position only when requested and the position is determined to be invalid. Currently this is implemented by adding listeners to all the Transform ancestors of the shape. When one of the transforms is modified a flag is set to invalid. After the position is requested and calculated again the flag is set to valid. This way it can be requested multiple times but only calculated once when it is needed.

Note:
To find the depth of the shape on screen, multiply this value by the current canvas' rotation matrix and take the z component.

Implements Transformable.

void onNodeEvent ( NodeEvent event  )  [inline, virtual]

Invalidates the position when a transform changes.

Implements NodeListener.

Reimplemented in Boolean.

void updatePositionExtent (  )  [protected]

Updates the position and extent, then validates the position.


The documentation for this class was generated from the following files:
Generated on Wed Jun 9 01:36:37 2010 for Gander by  doxygen 1.6.3