Added setValue and setSwitchSet methods

This commit is contained in:
Robert Osfield 2005-04-15 20:05:30 +00:00
parent e67ed01612
commit 066c829768
2 changed files with 24 additions and 0 deletions

View File

@ -72,7 +72,16 @@ class OSGSIM_EXPORT MultiSwitch : public osg::Group
typedef std::vector<bool> ValueList;
typedef std::vector<ValueList> 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 :

View File

@ -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;
}