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

sglDiscriminator Class Reference

#include <sglDiscriminator.hpp>

Inheritance diagram for sglDiscriminator::

sglGroup sglNode sglObject List of all members.

Public Methods

 sglDiscriminator ()
virtual ~sglDiscriminator ()
void setMask (unsigned int mask)
unsigned int getMask () 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 (sglDiscriminator *dst, unsigned int mode) const

Protected Attributes

unsigned int m_mask

Detailed Description

This is a subclass of sglGroup contains a discriminator bit mask. If the discriminator mask ANDed with the mask passed in with any of the traversals returns a true (non-zero) value, then the children are traversed. If this test returns false (zero), the traversal down this branch of the scene graph is halted at this point.

The discriminator mask is currently implemented as an unsigned int. On most systems this corresponds to a 32-bit quantity which allows for up to 32 unique masks.

Example:

   sglGeode *geode = new sglGeode;
   sglDiscriminator *disc_node = new sglDiscriminator;
   disc_node->setMask(0x01);
   disc_node->addChild(geode);

Definition at line 56 of file sglDiscriminator.hpp.


Constructor & Destructor Documentation

sglDiscriminator::sglDiscriminator ( )
 

default constructor.

sglDiscriminator::~sglDiscriminator ( ) [virtual]
 

virtual destructor.


Member Function Documentation

void sglDiscriminator::setMask ( unsigned int mask ) [inline]
 

Set the discriminator mask for this node.

Parameters:
mask   The discriminator mask.

Definition at line 67 of file sglDiscriminator.hpp.

unsigned int sglDiscriminator::getMask ( ) const [inline]
 

Get the current discriminator mask.

Returns:
the current discriminator mask.

Definition at line 72 of file sglDiscriminator.hpp.

virtual sglBound::IntersectResultEnum sglDiscriminator::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 sglDiscriminator::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 sglDiscriminator::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 sglDiscriminator::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* sglDiscriminator::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 sglDiscriminator::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 sglDiscriminator::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 sglDiscriminator::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:07 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001