osg.Group¶
-
class
osg.Group¶ Represents: c++ class Wraps: osg::Group Bases: osg.NodeGeneral group node which maintains a list of children. Children are reference counted. This allows children to be shared with memory management handled automatically via
osg.Referenced.Constructors:
-
osg.Group()¶
Methods:
-
:
getNumChildren()¶ Return the number of children nodes.
Return type: unsigned
-
:
insertChild(unsigned index, osg.Node child)¶ Insert
osg.Nodetoosg.Groupat 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.Parameters: - index (
unsigned) – - child (
osg.Node) –
Return type: bool- index (
-
:
addChild(osg.Node child)¶ Add
osg.Nodetoosg.Group. If node is notnilthen increment its reference count, add it to the child list and dirty the bounding sphere to force it to recompute on nextosg.Node.getBound()and returntruefor success. Otherwise returnfalse. Scene nodes can’t be added as child nodes.Parameters: child ( osg.Node) –Return type: bool
-
:
removeChild(osg.Node child)¶ Remove
osg.Nodefromosg.Group. Ifosg.Nodeis contained inosg.Groupthen remove it from the child list, decrement its reference count, and dirty the bounding sphere to force it to recompute on nextosg.Node.getBound()and returntruefor success. Ifosg.Nodeis not found then returnfalseand do not change the reference count of theosg.Node. Note (for C++), do not override, only overrideremoveChildren(,)is required.Parameters: child ( osg.Node) –Return type: bool
-
:
removeChild(unsigned pos) -
Parameters: pos ( unsigned) –Return type: bool
-
:
removeChildren(unsigned pos, unsigned numChildrenToRemove)¶ -
Parameters: - pos (
unsigned) – - numChildrenToRemove (
unsigned) –
Return type: bool - pos (
-
:
getChild(unsigned i)¶ Return child node at position i.
Parameters: i ( unsigned) –Return type: osg.Node
-
:
replaceChild(osg.Node orig, osg.Node newChild)¶ Replace specified child
osg.Nodewith anotherosg.Node. Equivalent tosetChild(getChildIndex(orignChild), node). See docs forosg.Group.setChild()for further details on implementation.Parameters: Return type: bool
-
:
getChildIndex(osg.Node child)¶ Get the index number of child, return a value between
0and_children.size() - 1if found, if not found then return_children.size().Parameters: child ( osg.Node) –Return type: unsigned
-
:
traverse_group(osg.NodeVisitor nv)¶ -
Parameters: nv ( osg.NodeVisitor) –
-