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

sglOverrideStateNode Class Reference

#include <sglOverrideStateNode.hpp>

Inheritance diagram for sglOverrideStateNode::

sglGroup sglNode sglObject List of all members.

Public Methods

 sglOverrideStateNode ()
virtual ~sglOverrideStateNode ()
void setStatelets (const vector< sglStatelet *> &statelets)
const vector<sglStatelet*>& getStatelets () 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 (sglOverrideStateNode *dst, unsigned int mode) const

Protected Attributes

vector<sglStatelet*> m_statelets

Detailed Description

An sglOverrideStateNode is a container of sglStatelets that override the state specified in node below it in the scene graph. These statelets take precedence over those in sglOverrideStateNodes lower in the scene graph, but not those higher in the graph. These statelets also have higher priority than those in sglDefaultStateNodes and sglDrawable nodes.

Example:

   vector<sglStatelet*> override_statelets;
   override_statelets.push_back(new sglLighting(false));

   // sets the override lighting mode to OFF for all nodes below this one.
   sglOverrideStateNode *override_node = new sglOverrideStateNode;
   override_node->setStatelets(override_statelets);

   override_node->addChild(...);

Definition at line 55 of file sglOverrideStateNode.hpp.


Constructor & Destructor Documentation

sglOverrideStateNode::sglOverrideStateNode ( )
 

default constructor.

sglOverrideStateNode::~sglOverrideStateNode ( ) [virtual]
 

virtual destructor.


Member Function Documentation

void sglOverrideStateNode::setStatelets ( const vector< sglStatelet *> & statelets )
 

Set the current set of default statelets from the vector provided. The new statelets' reference counts are incremented, while the previous statelets are decremented, and if their reference counts go to zero they are deleted.

Parameters:
statelets   Vector of new statelets (that are dynamically allocated).

const vector< sglStatelet *> & sglOverrideStateNode::getStatelets ( ) const
 

Get a reference to the current set of override statelets.

Returns:
A reference to the internal list of statelets.

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