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

sglDefaultStateNode Class Reference

#include <sglDefaultStateNode.hpp>

Inheritance diagram for sglDefaultStateNode::

sglGroup sglNode sglObject List of all members.

Public Methods

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

Protected Attributes

vector<sglStatelet*> m_statelets

Detailed Description

An sglDefaultStateNode is a container of sglStatelets that affect the default state of all geometry below it in the graph. The statelets in this node take precedence over statelets in sglDefaultStateNodes higher in the tree, but not those lower in the tree. They also have a lower priority than statelets in the sglDrawable and sglOverrideStateNode nodes (above or below).

Example:

   sglScene *root = new sglScene;

   sglCullMode *cull_mode = new sglCullMode;
   cull_mode->setCullMode(sglCullMode::OFF);

   vector<sglStatelet*> default_statelets;
   default_statelets.push_back(cull_mode);

   // sets the default cull mode to OFF for all nodes below this one.
   sglDefaultStateNode *default_node = new sglDefaultStateNode;
   default_node->setStatelets(default_statelets);

   root->addChild(def);

Definition at line 62 of file sglDefaultStateNode.hpp.


Constructor & Destructor Documentation

sglDefaultStateNode::sglDefaultStateNode ( )
 

default constructor.

sglDefaultStateNode::~sglDefaultStateNode ( ) [virtual]
 

virtual destructor.


Member Function Documentation

void sglDefaultStateNode::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 *> & sglDefaultStateNode::getStatelets ( ) const [inline]
 

Get a reference to the current set of default statelets.

Returns:
A reference to the internal list of statelets.

Definition at line 82 of file sglDefaultStateNode.hpp.

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