#include <sglIndexedBitMaskSwitch.hpp>
Inheritance diagram for sglIndexedBitMaskSwitch::
Public Methods | |
sglIndexedBitMaskSwitch () | |
virtual | ~sglIndexedBitMaskSwitch () |
void | setIndex (unsigned int index) |
unsigned int | getIndex () const |
void | addMask (unsigned int mask) |
virtual sglNode* | clone (unsigned int mode) const |
virtual void | printInfo (ostream &ostrm, const char *indent_string) const |
Protected Methods | |
void | copyTo (sglIndexedBitMaskSwitch *dst, unsigned int mode) const |
Protected Attributes | |
unsigned int | m_switch_index |
vector<unsigned int> | m_index |
As with sglBitMaskSwitch, the order that the children are added to the node is significant. In addition, the order the masks are added is significant, as it implicitly selects the index value for that bitmask.
Initially, the default index value and mask is undefined. At least one mask should be added using addMask(), and setIndex() should be used to set the default index. Otherwise, the default set of children selected will be the same as the default of the sglBitMaskSwitch, which is to select all children.
Special behaviour for intersect and pick traversals
This behaviour is the same as for the sglBitMaskSwitch.
Example:
sglIndexedBitMaskSwitch *switch_node = new sglIndexedBitMaskSwitch; sglGeode *geode0 = new sglGeode; sglGeode *geode1 = new sglGeode; switch_node->addChild(geode0); switch_node->addChild(geode1); switch_node->addMask(0x0); // select neither for index 0 switch_node->addMask(0x2); // select geode1 for index 1 switch_node->addMask(0x1); // select geode0 for index 2 switch_node->addMask(0x3); // select both for index 3 switch_node->addMask(~0x0); // select all children for index 4 switch_node->setIndex(2); // select zeroeth index (geode 0)
Definition at line 81 of file sglIndexedBitMaskSwitch.hpp.
|
default constructor.
|
|
destructor.
|
|
Set the index for selecting children. @index The index into the vector of masks. Definition at line 92 of file sglIndexedBitMaskSwitch.hpp. |
|
Get the current index.
Definition at line 104 of file sglIndexedBitMaskSwitch.hpp. |
|
Add a new mask to the index vector. @mask The index into the vector of masks. Definition at line 109 of file sglIndexedBitMaskSwitch.hpp. |
|
Make a copy of the scenegraph rooted at this node.
Reimplemented from sglBitMaskSwitch. |
|
Output the state of this node to the specified ostream.
Reimplemented from sglBitMaskSwitch. |