Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

osg::Group Class Reference

General group node which maintains a list of children. More...

Inheritance diagram for osg::Group:

Inheritance graph
[legend]
List of all members.

Public Types

typedef std::vector< ref_ptr<
Node > > 
ChildList

Public Methods

 Group ()
 Group (const Group &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 Copy constructor using CopyOp to manage deep vs shallow copy.

 META_Node (osg, Group)
virtual void traverse (NodeVisitor &nv)
 Traverse downwards : calls children's accept method with NodeVisitor.

virtual bool addChild (Node *child)
 Add Node to Group.

virtual bool removeChild (Node *child)
 Remove Node from Group.

virtual bool replaceChild (Node *origChild, Node *newChild)
 Replace specified Node with another Node.

const unsigned int getNumChildren () const
 return the number of chilren nodes.

Node * getChild (const unsigned int i)
 return child node at position i.

const Node * getChild (const unsigned int i) const
 return child node at position i.

bool containsNode (const Node *node) const
 return true if node is contained within Group.

ChildList::iterator findNode (const Node *node)
 return the iterator position for specified Node.

ChildList::const_iterator findNode (const Node *node) const
 return the const_iterator position for specified Node.


Protected Methods

virtual ~Group ()
virtual const bool computeBound () const
 Compute the bounding sphere around Node's geometry or children.


Protected Attributes

ChildList _children

Detailed Description

General 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.


Member Typedef Documentation

typedef std::vector<ref_ptr<Node> > osg::Group::ChildList
 


Constructor & Destructor Documentation

osg::Group::Group (    ) 
 

osg::Group::Group (  const Group &   ,
const CopyOp &    copyop = CopyOp::SHALLOW_COPY
) 
 

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osg::Group::~Group (    )  [protected, virtual]
 


Member Function Documentation

virtual bool osg::Group::addChild (  Node *    child )  [virtual]
 

Add Node to Group.

If node is not NULL and is not contained in Group then increment its reference count, add it to the child list and dirty the bounding sphere to force it to recompute on next getBound() and return true for success. Otherwise return false. Scene nodes can't be added as child nodes.

virtual const bool osg::Group::computeBound (    )  const [protected, virtual]
 

Compute the bounding sphere around Node's geometry or children.

This method is automatically called by getBound() when the bounding sphere has been marked dirty via dirtyBound().

Reimplemented from osg::Node.

Reimplemented in osg::ClipNode, osg::Impostor, osg::LightSource, osg::OccluderNode, and osg::Transform.

bool osg::Group::containsNode (  const Node *    node )  const [inline]
 

return true if node is contained within Group.

ChildList::const_iterator osg::Group::findNode (  const Node *    node )  const [inline]
 

return the const_iterator position for specified Node.

return _children.end() if node is not contained in Group.

ChildList::iterator osg::Group::findNode (  const Node *    node )  [inline]
 

return the iterator position for specified Node.

return _children.end() if node is not contained in Group.

const Node* osg::Group::getChild (  const unsigned int    i )  const [inline]
 

return child node at position i.

Node* osg::Group::getChild (  const unsigned int    i )  [inline]
 

return child node at position i.

const unsigned int osg::Group::getNumChildren (    )  const [inline]
 

return the number of chilren nodes.

osg::Group::META_Node (  osg   ,
Group   
) 
 

virtual bool osg::Group::removeChild (  Node *    child )  [virtual]
 

Remove Node from Group.

If Node is contained in Group then remove it from the child list, decrement its reference count, and dirty the bounding sphere to force it to recompute on next getBound() and return true for success. If Node is not found then return false and do not change the reference count of the Node.

virtual bool osg::Group::replaceChild (  Node *    origChild,
Node *    newChild
)  [virtual]
 

Replace specified Node with another Node.

Decrement the reference count origNode and increments the reference count of newNode, and dirty the bounding sphere to force it to recompute on next getBound() and returns true. If origNode is not found then return false and do not add newNode. If newNode is NULL then return false and do not remove origNode. Also returns false if newChild is a Scene node.

virtual void osg::Group::traverse (  NodeVisitor &    nv )  [virtual]
 

Traverse downwards : calls children's accept method with NodeVisitor.

Reimplemented from osg::Node.

Reimplemented in osg::DOFTransform, osg::LOD, osg::Sequence, and osg::Switch.


Member Data Documentation

ChildList osg::Group::_children [protected]
 


The documentation for this class was generated from the following file:
Generated at Wed Sep 18 13:55:31 2002 for the Open Scene Graph by doxygen 1.2.16.