Tweaked MultiSwitch IO
This commit is contained in:
@@ -66,7 +66,7 @@ class SG_EXPORT MultiSwitch : public osg::Group
|
||||
void setActiveSwitchSet(unsigned int switchSet) { _activeSwitchSet = switchSet; }
|
||||
|
||||
/** Get which of the available switch set lists to use.*/
|
||||
unsigned int getActiveSwitchSet(unsigned int switchSet) { return _activeSwitchSet; }
|
||||
unsigned int getActiveSwitchSet() const { return _activeSwitchSet; }
|
||||
|
||||
typedef std::vector<bool> ValueList;
|
||||
typedef std::vector<ValueList> SwitchSetList;
|
||||
|
||||
@@ -52,6 +52,16 @@ bool MultiSwitch_readLocalData(Object& obj, Input& fr)
|
||||
}
|
||||
}
|
||||
|
||||
if (fr.matchSequence("ActiveSwitchSet %i"))
|
||||
{
|
||||
unsigned int switchSet;
|
||||
fr[1].getUInt(switchSet);
|
||||
fr+=2;
|
||||
|
||||
sw.setActiveSwitchSet(switchSet);
|
||||
}
|
||||
|
||||
|
||||
if (fr.matchSequence("ValueList %i {"))
|
||||
{
|
||||
int entry = fr[0].getNoNestedBrackets();
|
||||
@@ -91,6 +101,8 @@ bool MultiSwitch_writeLocalData(const Object& obj, Output& fw)
|
||||
|
||||
fw.indent()<<"NewChildDefaultValue "<<sw.getNewChildDefaultValue()<<std::endl;
|
||||
|
||||
fw.indent()<<"ActiveSwitchSet "<<sw.getActiveSwitchSet()<<std::endl;
|
||||
|
||||
unsigned int pos = 0;
|
||||
const osgSim::MultiSwitch::SwitchSetList& switchset = sw.getSwitchSetList();
|
||||
for(osgSim::MultiSwitch::SwitchSetList::const_iterator sitr=switchset.begin();
|
||||
|
||||
Reference in New Issue
Block a user