Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglScale Class Template Reference

#include <sglScale.hpp>

Inheritance diagram for sglScale::

sglGroup sglNode sglObject List of all members.

Public Methods

 sglScale ()
virtual ~sglScale ()
void setScale (T scale)
getScale () const
virtual sglBound::IntersectResultEnum intersect (sglIntersectf &isector) const
virtual sglBound::IntersectResultEnum intersect (sglIntersectd &isector) const
virtual void pick (sglPickf &pick_state, unsigned int cull_flags) const
virtual void pick (sglPickd &pick_state, unsigned int cull_flags) const
virtual void computeTxToParent (sglMat4f &curr_mat) const
virtual void computeTxToParent (sglMat4d &curr_mat) const
virtual sglNodeclone (unsigned int mode) const
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Protected Methods

virtual void computeBound ()
virtual void cull (sglCull< float > &trav_state, unsigned int cull_flags) const
virtual void cull (sglCull< double > &trav_state, unsigned int cull_flags) const
void copyTo (sglScale *dst, unsigned int mode) const

Protected Attributes

m_scale
m_inv_scale

Detailed Description

template<class T> class sglScale

The sglScale node scales the traversal's model view matrix effectively changing the size of the translations and geometry in the subtree below this one. This node specifies a uniform scale (the same in all dimensions) and is more efficient to use that a general sglTransform matrix. sglScalef and sglScaled are typedefs for single and double precision (templated) versions.

Example:

   sglScaled *dp_scale_node = new sglScaled;
   dp_translate_node->setScale(25.0000001);

Definition at line 52 of file sglScale.hpp.


Constructor & Destructor Documentation

template<class T>
sglScale<T>::sglScale<T> ( ) [inline]
 

default constructor intializes to unit scale.

Definition at line 56 of file sglScale.hpp.

template<class T>
sglScale<T>::~sglScale<T> ( ) [inline, virtual]
 

virtual destructor.

Definition at line 58 of file sglScale.hpp.


Member Function Documentation

template<class T>
void sglScale<T>::setScale ( T scale )
 

Set the scale factor.

Parameters:
scale   The scale factor. A zero scale will not be accepted.

template<class T>
T sglScale<T>::getScale ( ) const [inline]
 

Get the current scale factor.

Returns:
The current scale.

Definition at line 68 of file sglScale.hpp.

template<class T>
virtual sglBound::IntersectResultEnum sglScale<T>::intersect ( sglIntersectf & isector ) const [virtual]
 

The single precision intersection traversal function which returns the closest object (bounding volume and/or triangle) that intersects with the given intersect segment.

Parameters:
isector   A reference to a single precision intersection state

Reimplemented from sglGroup.

template<class T>
virtual sglBound::IntersectResultEnum sglScale<T>::intersect ( sglIntersectd & isector ) const [virtual]
 

The double precision intersection traversal function which returns the closest object (bounding volume and/or triangle) that intersects with the given intersect segment.

Parameters:
isector   A reference to a double precision intersection state

Reimplemented from sglGroup.

template<class T>
virtual void sglScale<T>::pick ( sglPickf & pick_state,
unsigned int cull_flags ) const [virtual]
 

The single precision pick traversal function which returns all objects that fall within the pick frustum.

Parameters:
pick_state   A reference to a single precision pick state.
cull_flags   Bit flags that indicate which planes of the pick frustum (polytope) still need to be tested to determine if bounding spheres and boxes lie within the frustum. Cull-free picking can be accomplished by setting this to 0.

Reimplemented from sglGroup.

template<class T>
virtual void sglScale<T>::pick ( sglPickd & pick_state,
unsigned int cull_flags ) const [virtual]
 

The double precision pick traversal function which returns all objects that fall within the pick frustum.

Parameters:
pick_state   A reference to a double precision pick state.
cull_flags   Bit flags that indicate which planes of the pick frustum (polytope) still need to be tested to determine if bounding spheres and boxes lie within the frustum. Cull-free picking can be accomplished by setting this to 0.

Reimplemented from sglGroup.

template<class T>
virtual void sglScale<T>::computeTxToParent ( sglMat4f & curr_mat ) const [virtual]
 

Compute a single precision transform to parent and append (via multiplication) the matrix passed in. This is part of an upward traversal, which most commonly begins with an sglViewPlatform and used for computing the position and orientation of said platform. This is the default implementation for all nodes that do not affect this matrix and therefore this function does nothing.

Parameters:
curr_mat   The current view matrix for nodes below this one.

Reimplemented from sglNode.

template<class T>
virtual void sglScale<T>::computeTxToParent ( sglMat4d & curr_mat ) const [virtual]
 

Compute a double precision transform to parent and append (via multiplication) the matrix passed in. This is part of an upward traversal, which most commonly begins with an sglViewPlatform and used for computing the position and orientation of said platform. This is the default implementation for all nodes that do not affect this matrix and therefore this function does nothing.

Parameters:
curr_mat   The current view matrix for nodes below this one.

Reimplemented from sglNode.

template<class T>
virtual sglNode* sglScale<T>::clone ( unsigned int mode ) const [virtual]
 

Make a copy of the scenegraph rooted at this node.

Parameters:
mode   Bit masks to control the behaviour of the clone. These are OR-ed together from the mode values in sglObject::CloneModeEnum.
Returns:
Pointer to root of cloned scene graph.

Reimplemented from sglGroup.

template<class T>
virtual void sglScale<T>::printInfo ( ostream & ostrm,
const char * indent_string ) const [virtual]
 

Output the state of this node to the specified ostream.

Parameters:
ostrm   the ostream to which the output is sent
indent_string   the string (usually spaces) that is output at the beginning of every line of output

Reimplemented from sglGroup.

template<class T>
virtual void sglScale<T>::cull ( sglCull< float > & trav_state,
unsigned int cull_flags ) const [protected, virtual]
 

The single precision cull traversal function that culls out subgraphs that do not lie in the view frustum (stored in the sglCull parameter). Subclasses must implement this function. The entry point for user-friendly culling is in the sglScene class.

Parameters:
trav_state   The single precision traversal state that collects all the state and geometry information that passes the cull.
cull_flags   Bit flags that indicate which planes of the view frustum (polytope) still need to be tested to determine if bounding spheres and boxes lie within the frustum. Cull-free drawing can be accomplished with cull_flags = 0.

Reimplemented from sglGroup.

template<class T>
virtual void sglScale<T>::cull ( sglCull< double > & trav_state,
unsigned int cull_flags ) const [protected, virtual]
 

The double precision cull traversal function that culls out subgraphs that do not lie in the view frustum (stored in the sglCull parameter). Subclasses must implement this function. The entry point for user-friendly culling is in the sglScene class.

Parameters:
trav_state   The single precision traversal state that collects all the state and geometry information that passes the cull.
cull_flags   Bit flags that indicate which planes of the view frustum (polytope) still need to be tested to determine if bounding spheres and boxes lie within the frustum. Cull-free drawing can be accomplished with cull_flags = 0.

Reimplemented from sglGroup.


The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:09 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001