Public Member Functions | Protected Member Functions | Protected Attributes

osg::Group Class Reference

Inheritance diagram for osg::Group:
osg::Node osg::Object osg::Referenced osg::ClearNode osg::ClipNode osg::CoordinateSystemNode osg::LightSource osg::LOD osg::OccluderNode osg::OcclusionQueryNode osg::Projection osg::ProxyNode osg::Sequence osg::Switch osg::TexGenNode osg::Transform osgFX::Effect osgFX::MultiTextureControl osgParticle::ParticleEffect osgShadow::ShadowedScene osgSim::MultiSwitch osgSim::OverlayNode osgSim::VisibilityGroup osgTerrain::Terrain osgTerrain::TerrainTile osgVolume::Volume osgVolume::VolumeTile

List of all members.

Public Member Functions

 Group ()
 Group (const Group &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 META_Node (osg, Group)
virtual GroupasGroup ()
virtual const GroupasGroup () const
virtual void traverse (NodeVisitor &nv)
virtual bool addChild (Node *child)
virtual bool insertChild (unsigned int index, Node *child)
bool removeChild (Node *child)
bool removeChild (unsigned int pos, unsigned int numChildrenToRemove=1)
virtual bool removeChildren (unsigned int pos, unsigned int numChildrenToRemove)
virtual bool replaceChild (Node *origChild, Node *newChild)
unsigned int getNumChildren () const
virtual bool setChild (unsigned int i, Node *node)
NodegetChild (unsigned int i)
const NodegetChild (unsigned int i) const
bool containsNode (const Node *node) const
unsigned int getChildIndex (const Node *node) const
virtual void setThreadSafeRefUnref (bool threadSafe)
virtual void resizeGLObjectBuffers (unsigned int maxSize)
virtual void releaseGLObjects (osg::State *=0) const
virtual BoundingSphere computeBound () const

Protected Member Functions

virtual ~Group ()
virtual void childRemoved (unsigned int, unsigned int)
virtual void childInserted (unsigned int)

Protected Attributes

NodeList _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.


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.

Reimplemented in osg::LOD, osg::PagedLOD, osg::ProxyNode, osg::Sequence, osg::Switch, and osgSim::MultiSwitch.

virtual Group* osg::Group::asGroup (  )  [inline, virtual]

convert 'this' into a Group pointer if Node is a Group, otherwise return 0. Equivalent to dynamic_cast<Group*>(this).

Reimplemented from osg::Node.

virtual const Group* osg::Group::asGroup (  )  const [inline, virtual]

convert 'const this' into a const Group pointer if Node is a Group, otherwise return 0. Equivalent to dynamic_cast<const Group*>(this).

Reimplemented from osg::Node.

virtual void osg::Group::childInserted ( unsigned  int  )  [inline, protected, virtual]
virtual void osg::Group::childRemoved ( unsigned  int,
unsigned  int 
) [inline, protected, virtual]
virtual BoundingSphere osg::Group::computeBound (  )  const [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::AutoTransform, osg::ClipNode, osg::LightSource, osg::LOD, osg::OccluderNode, osg::OcclusionQueryNode, osg::ProxyNode, osg::Switch, osg::Transform, osgSim::Impostor, osgTerrain::TerrainTile, and osgVolume::VolumeTile.

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

Return true if node is contained within Group.

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

Return child node at position i.

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

Return child node at position i.

unsigned int osg::Group::getChildIndex ( const Node node  )  const [inline]

Get the index number of child, return a value between 0 and _children.size()-1 if found, if not found then return _children.size().

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

Return the number of children nodes.

virtual bool osg::Group::insertChild ( unsigned int  index,
Node child 
) [virtual]

Insert Node to Group at 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.

Reimplemented in osg::Sequence, osg::Switch, and osgSim::MultiSwitch.

osg::Group::META_Node ( osg  ,
Group   
)
virtual void osg::Group::releaseGLObjects ( osg::State = 0  )  const [virtual]

If State is non-zero, this function releases any associated OpenGL objects for the specified graphics context. Otherwise, releases OpenGL objects for all graphics contexts.

Reimplemented from osg::Node.

Reimplemented in osg::OcclusionQueryNode, and osgSim::OverlayNode.

bool osg::Group::removeChild ( unsigned int  pos,
unsigned int  numChildrenToRemove = 1 
) [inline]

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. Note, do not override, only override removeChildren(,) is required.

bool osg::Group::removeChild ( Node child  )  [inline]

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. Note, do not override, only override removeChildren(,) is required.

Reimplemented in osg::Sequence, and osgSim::MultiSwitch.

virtual bool osg::Group::removeChildren ( unsigned int  pos,
unsigned int  numChildrenToRemove 
) [virtual]

Remove children from Group. Note, must be override by subclasses of Group which add per child attributes.

Reimplemented in osg::LOD, osg::PagedLOD, osg::ProxyNode, osg::Sequence, and osg::Switch.

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

Replace specified Node with another Node. Equivalent to setChild(getChildIndex(orignChild),node) See docs for setChild for further details on implementation.

virtual void osg::Group::resizeGLObjectBuffers ( unsigned int  maxSize  )  [virtual]

Resize any per context GLObject buffers to specified size.

Reimplemented from osg::Node.

Reimplemented in osgSim::OverlayNode.

virtual bool osg::Group::setChild ( unsigned int  i,
Node node 
) [virtual]

Set child node at position i. Return true if set correctly, false on failure (if node==NULL || i is out of range). When Set can be successful applied, the algorithm is : decrement the reference count origNode and increment the reference count of newNode, and dirty the bounding sphere to force it to recompute on next getBound() and return 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::setThreadSafeRefUnref ( bool  threadSafe  )  [virtual]

Set whether to use a mutex to ensure ref() and unref() are thread safe.

Reimplemented from osg::Node.

Reimplemented in osg::LightSource, osg::TexGenNode, and osgSim::OverlayNode.


Member Data Documentation


The documentation for this class was generated from the following file: