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

sglLODStateNode Class Reference

#include <sglLODStateNode.hpp>

Inheritance diagram for sglLODStateNode::

sglGroup sglNode sglObject List of all members.

Public Methods

 sglLODStateNode ()
virtual ~sglLODStateNode ()
void setRangeScale (float val)
float getRangeScale () const
void setRangeOffset (float val)
float getRangeOffset () 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 sglNodeclone (unsigned int mode) const
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Protected Methods

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 (sglLODStateNode *dst, unsigned int mode) const

Protected Attributes

sglLODState m_lod_state

Detailed Description

The sglTraverser class (base class for cull, pick and intersect traversers) contain LOD scale and offset (bias) quantities that will affect the child selection computation of the sglLOD node. This node affects those values when the traverser encounters it. The net effect is to scale and bias the range calculations for any sglLOD nodes in the entire subtree below it. The scale and offset values stored in this node affect the traversals' scale and offset values as follows:

   new_traversal_scale = old_traversal_scale*lod_state_node_scale

   new_traversal_offset= old_traversal_offset*lod_state_node_scale + lod_state_node_offset

Note: the affect of nested sglLODStateNodes is cummulative.

After computation of the new scale and offset, traversal then proceeds as if this were an sglGroup node.

Example:

   sglLODStateNode *lod_state_node = new sglLODStateNode;
   sglLOD *lod_node = new sglLOD;

   lod_state_node->addChild(lod_node);

   // scales and offsets the range calculations for all sglLOD nodes that
   // appear below (as descendants of) it in the scene graph
   lod_state_node->setRangeScale(2.0f);
   lod_state_node->setRangeOffset(-20.0f);

Definition at line 71 of file sglLODStateNode.hpp.


Constructor & Destructor Documentation

sglLODStateNode::sglLODStateNode ( )
 

default constructor.

sglLODStateNode::~sglLODStateNode ( ) [virtual]
 

virtual destructor.


Member Function Documentation

void sglLODStateNode::setRangeScale ( float val ) [inline]
 

Set the scale factor for subsequent LOD range calculations.

Parameters:
val   The scale value (any value is valid).

Definition at line 82 of file sglLODStateNode.hpp.

float sglLODStateNode::getRangeScale ( ) const [inline]
 

Get the current scale factor.

Returns:
scale value.

Definition at line 87 of file sglLODStateNode.hpp.

void sglLODStateNode::setRangeOffset ( float val ) [inline]
 

Set the offset (bias) factor for subsequent LOD range calculations.

Parameters:
val   The bias value (any value is valid).

Definition at line 92 of file sglLODStateNode.hpp.

float sglLODStateNode::getRangeOffset ( ) const [inline]
 

Get the currect bias value.

Returns:
bias value.

Definition at line 97 of file sglLODStateNode.hpp.

virtual sglBound::IntersectResultEnum sglLODStateNode::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.

virtual sglBound::IntersectResultEnum sglLODStateNode::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.

virtual void sglLODStateNode::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.

virtual void sglLODStateNode::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.

virtual sglNode* sglLODStateNode::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.

virtual void sglLODStateNode::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.

virtual void sglLODStateNode::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.

virtual void sglLODStateNode::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:08 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001