diff --git a/include/osgSim/MultiSwitch b/include/osgSim/MultiSwitch index 506d96026..8516fe3f6 100644 --- a/include/osgSim/MultiSwitch +++ b/include/osgSim/MultiSwitch @@ -72,7 +72,16 @@ class OSGSIM_EXPORT MultiSwitch : public osg::Group typedef std::vector ValueList; typedef std::vector SwitchSetList; + /** Set the compile set of different values.*/ + void setSwitchSetList(const SwitchSetList& switchSetList); + + /** Get the compile set of different values.*/ const SwitchSetList& getSwitchSetList() const { return _values; } + + /** Set the a single set of different values for a particular switch set.*/ + void setValueList(unsigned int switchSet, const ValueList& values); + + /** Get the a single set of different values for a particular switch set.*/ const ValueList& getValueList(unsigned int switchSet) const { return _values[switchSet]; } protected : diff --git a/src/osgSim/MultiSwitch.cpp b/src/osgSim/MultiSwitch.cpp index 3360494f3..92c8ed32e 100644 --- a/src/osgSim/MultiSwitch.cpp +++ b/src/osgSim/MultiSwitch.cpp @@ -217,3 +217,18 @@ bool MultiSwitch::setSingleChildOn(unsigned int switchSet, unsigned int pos) setValue(switchSet, pos,true); return true; } + + +void MultiSwitch::setSwitchSetList(const SwitchSetList& switchSetList) +{ + expandToEncompassSwitchSet(switchSetList.size()); + + _values = switchSetList; +} + +void MultiSwitch::setValueList(unsigned int switchSet, const ValueList& values) +{ + expandToEncompassSwitchSet(switchSet); + + _values[switchSet] = values; +}