Added the missing insertChild(index,child) and insertChild(index,child,value) into
osg::Switch.
This commit is contained in:
parent
7136a00b9a
commit
62c955fa19
@ -45,6 +45,10 @@ class SG_EXPORT Switch : public Group
|
||||
|
||||
virtual bool addChild( Node *child, bool value );
|
||||
|
||||
virtual bool insertChild( unsigned int index, Node *child );
|
||||
|
||||
virtual bool insertChild( unsigned int index, Node *child, bool value );
|
||||
|
||||
virtual bool removeChild( Node *child );
|
||||
|
||||
void setValue(unsigned int pos,bool value);
|
||||
|
@ -63,6 +63,29 @@ bool Switch::addChild( Node *child, bool value )
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Switch::insertChild( unsigned int index, Node *child )
|
||||
{
|
||||
return insertChild(index,child,_newChildDefaultValue);
|
||||
}
|
||||
|
||||
bool Switch::insertChild( unsigned int index, Node *child, bool value )
|
||||
{
|
||||
if (Group::insertChild(index,child))
|
||||
{
|
||||
if (index>=_values.size())
|
||||
{
|
||||
_values.push_back(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
_values.insert(_values.begin()+index, value);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Switch::removeChild( Node *child )
|
||||
{
|
||||
// find the child's position.
|
||||
|
Loading…
Reference in New Issue
Block a user