OpenSceneGraph
3.0.1
|
MultiSwitch is a Group node which allows switching between sets of selected children. More...
Public Types | |
typedef std::vector< bool > | ValueList |
typedef std::vector< ValueList > | SwitchSetList |
typedef std::vector< std::string > | SwitchSetNameList |
Public Member Functions | |
MultiSwitch () | |
MultiSwitch (const MultiSwitch &, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
Copy constructor using CopyOp to manage deep vs shallow copy. | |
META_Node (osgSim, MultiSwitch) | |
virtual void | traverse (osg::NodeVisitor &nv) |
Traverse downwards : calls children's accept method with NodeVisitor. | |
void | setNewChildDefaultValue (bool value) |
bool | getNewChildDefaultValue () const |
virtual bool | addChild (osg::Node *child) |
Add Node to Group. | |
virtual bool | insertChild (unsigned int index, osg::Node *child) |
Insert Node to Group at specific location. | |
virtual bool | removeChild (osg::Node *child) |
Remove Node from Group. | |
void | setValue (unsigned int switchSet, unsigned int pos, bool value) |
bool | getValue (unsigned int switchSet, unsigned int pos) const |
void | setChildValue (const osg::Node *child, unsigned int switchSet, bool value) |
bool | getChildValue (const osg::Node *child, unsigned int switchSet) const |
bool | setAllChildrenOff (unsigned int switchSet) |
Set all the children off (false), and set the new default child value to off (false). | |
bool | setAllChildrenOn (unsigned int switchSet) |
Set all the children on (true), and set the new default child value to on (true). | |
bool | setSingleChildOn (unsigned int switchSet, unsigned int pos) |
Set a single child to be on, MultiSwitch off all other children. | |
void | setActiveSwitchSet (unsigned int switchSet) |
Set which of the available switch set lists to use. | |
unsigned int | getActiveSwitchSet () const |
Get which of the available switch set lists to use. | |
void | setSwitchSetList (const SwitchSetList &switchSetList) |
Set the compile set of different values. | |
const SwitchSetList & | getSwitchSetList () const |
Get the compile set of different values. | |
void | setValueList (unsigned int switchSet, const ValueList &values) |
Set the a single set of different values for a particular switch set. | |
const ValueList & | getValueList (unsigned int switchSet) const |
Get the a single set of different values for a particular switch set. | |
void | setValueName (unsigned int switchSet, const std::string &name) |
const std::string & | getValueName (unsigned int switchSet) const |
Protected Member Functions | |
virtual | ~MultiSwitch () |
void | expandToEncompassSwitchSet (unsigned int switchSet) |
Protected Attributes | |
bool | _newChildDefaultValue |
unsigned int | _activeSwitchSet |
SwitchSetList | _values |
SwitchSetNameList | _valueNames |
MultiSwitch is a Group node which allows switching between sets of selected children.
MultiSwtich is based on the OpenFlight switch behaviour.
typedef std::vector<ValueList> osgSim::MultiSwitch::SwitchSetList |
typedef std::vector<std::string> osgSim::MultiSwitch::SwitchSetNameList |
typedef std::vector<bool> osgSim::MultiSwitch::ValueList |
osgSim::MultiSwitch::MultiSwitch | ( | ) |
osgSim::MultiSwitch::MultiSwitch | ( | const MultiSwitch & | , |
const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY |
||
) |
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual osgSim::MultiSwitch::~MultiSwitch | ( | ) | [inline, protected, virtual] |
virtual bool osgSim::MultiSwitch::addChild | ( | osg::Node * | child | ) | [virtual] |
Add Node to Group.
If node is not NULL and is not contained in Group then increment its reference count, add it to the child list and dirty the bounding sphere to force it to recompute on next getBound() and return true for success. Otherwise return false. Scene nodes can't be added as child nodes.
Reimplemented from osg::Group.
void osgSim::MultiSwitch::expandToEncompassSwitchSet | ( | unsigned int | switchSet | ) | [protected] |
unsigned int osgSim::MultiSwitch::getActiveSwitchSet | ( | ) | const [inline] |
Get which of the available switch set lists to use.
bool osgSim::MultiSwitch::getChildValue | ( | const osg::Node * | child, |
unsigned int | switchSet | ||
) | const |
bool osgSim::MultiSwitch::getNewChildDefaultValue | ( | ) | const [inline] |
const SwitchSetList& osgSim::MultiSwitch::getSwitchSetList | ( | ) | const [inline] |
Get the compile set of different values.
bool osgSim::MultiSwitch::getValue | ( | unsigned int | switchSet, |
unsigned int | pos | ||
) | const |
const ValueList& osgSim::MultiSwitch::getValueList | ( | unsigned int | switchSet | ) | const [inline] |
Get the a single set of different values for a particular switch set.
const std::string& osgSim::MultiSwitch::getValueName | ( | unsigned int | switchSet | ) | const [inline] |
virtual bool osgSim::MultiSwitch::insertChild | ( | unsigned int | index, |
osg::Node * | child | ||
) | [virtual] |
Insert Node to Group at specific location.
The new child node is inserted into the child list before the node at the specified index. No nodes are removed from the group with this operation.
Reimplemented from osg::Group.
osgSim::MultiSwitch::META_Node | ( | osgSim | , |
MultiSwitch | |||
) |
virtual bool osgSim::MultiSwitch::removeChild | ( | osg::Node * | child | ) | [virtual] |
Remove Node from Group.
If Node is contained in Group then remove it from the child list, decrement its reference count, and dirty the bounding sphere to force it to recompute on next getBound() and return true for success. If Node is not found then return false and do not change the reference count of the Node. Note, do not override, only override removeChildren(,) is required.
Reimplemented from osg::Group.
void osgSim::MultiSwitch::setActiveSwitchSet | ( | unsigned int | switchSet | ) | [inline] |
Set which of the available switch set lists to use.
bool osgSim::MultiSwitch::setAllChildrenOff | ( | unsigned int | switchSet | ) |
Set all the children off (false), and set the new default child value to off (false).
bool osgSim::MultiSwitch::setAllChildrenOn | ( | unsigned int | switchSet | ) |
Set all the children on (true), and set the new default child value to on (true).
void osgSim::MultiSwitch::setChildValue | ( | const osg::Node * | child, |
unsigned int | switchSet, | ||
bool | value | ||
) |
void osgSim::MultiSwitch::setNewChildDefaultValue | ( | bool | value | ) | [inline] |
bool osgSim::MultiSwitch::setSingleChildOn | ( | unsigned int | switchSet, |
unsigned int | pos | ||
) |
Set a single child to be on, MultiSwitch off all other children.
void osgSim::MultiSwitch::setSwitchSetList | ( | const SwitchSetList & | switchSetList | ) |
Set the compile set of different values.
void osgSim::MultiSwitch::setValue | ( | unsigned int | switchSet, |
unsigned int | pos, | ||
bool | value | ||
) |
void osgSim::MultiSwitch::setValueList | ( | unsigned int | switchSet, |
const ValueList & | values | ||
) |
Set the a single set of different values for a particular switch set.
void osgSim::MultiSwitch::setValueName | ( | unsigned int | switchSet, |
const std::string & | name | ||
) |
virtual void osgSim::MultiSwitch::traverse | ( | osg::NodeVisitor & | ) | [virtual] |
Traverse downwards : calls children's accept method with NodeVisitor.
Reimplemented from osg::Group.
unsigned int osgSim::MultiSwitch::_activeSwitchSet [protected] |
bool osgSim::MultiSwitch::_newChildDefaultValue [protected] |
SwitchSetNameList osgSim::MultiSwitch::_valueNames [protected] |
SwitchSetList osgSim::MultiSwitch::_values [protected] |
![]() | Generated at Mon Oct 3 2011 12:39:49 for the OpenSceneGraph by doxygen 1.7.5. |