class SG_EXPORT osg::Group: public Node

General group node which maintains a list of children.

Inheritance:


Public Methods

[more] Group()
[more]virtual Object* clone() const
[more]virtual bool isSameKindAs(Object* obj)
[more]virtual const char* className() const
[more]virtual void accept(NodeVisitor& nv)
[more]virtual void traverse(NodeVisitor& nv)
[more]virtual bool addChild( Node *child )
Add Node to Group.
[more]virtual bool removeChild( Node *child )
Remove Node from Group.
[more]virtual bool replaceChild( Node *origChild, Node* newChild )
Replace specified Node with another Node.
[more]int getNumChildren( void )
return the number of chilren nodes
[more]Node* getChild( int i )
return child node at position i
[more]bool containsNode( Node* node )
return true is node is contained within Group
[more]ChildList::iterator findNode( Node* node )
return the iterator postion for specified Node.

Public

[more]typedef std::vector<ref_ptr<Node> > ChildList

Protected Fields

[more]ChildList _children

Protected Methods

[more]virtual ~Group()
[more]virtual bool readLocalData(Input& fr)
[more]virtual bool writeLocalData(Output& fw)
[more]bool computeBound( void )


Inherited from Node:

Public Methods

oNode* cloneNode() const
ovirtual void ascend(NodeVisitor& nv)
ovoid setName( const std::string& name )
ovoid setName( const char* name )
oconst std::string& getName( void )
oconst ParentList& getParents() const
oGroup* getParent(int i) const
oint getNumParents() const
ovoid setUserData(void* data, MemoryAdapter* ma=0L)
ovoid* getUserData() const
oMemoryAdapter* getMemoryAdapter() const
ovoid setNodeMask(NodeMask nm)
oNodeMask getNodeMask()
oconst DescriptionList& getDescriptions() const
oDescriptionList& getDescriptions()
oconst std::string& getDescription(int i) const
ostd::string& getDescription(int i)
oint getNumDescriptions() const
ovoid addDescription(const std::string& desc)
oconst BoundingSphere& getBound()
ovoid dirtyBound()

Public

otypedef std::vector<Group*> ParentList
otypedef unsigned int NodeMask
otypedef std::vector<std::string> DescriptionList

Protected Fields

oBoundingSphere _bsphere
obool _bsphere_computed
ostd::string _name
oParentList _parents
ovoid* _userData
oref_ptr<MemoryAdapter> _memoryAdapter
oNodeMask _nodeMask
oDescriptionList _descriptions


Inherited from Object:

Public Methods

ovirtual Object* readClone(Input& fr)
ovirtual bool write(Output& fw)


Inherited from Referenced:

Public Methods

oReferenced& operator = (Referenced&)
ovoid ref()
ovoid unref()
oint referenceCount()

Protected Fields

oint _refCount


Documentation

General group node which maintains a list of children. Children are reference counted to allow children to be shared with memory management handled automatically via osg::Referenced.
otypedef std::vector<ref_ptr<Node> > ChildList

o Group()

ovirtual Object* clone() const

ovirtual bool isSameKindAs(Object* obj)

ovirtual const char* className() const

ovirtual void accept(NodeVisitor& nv)

ovirtual void traverse(NodeVisitor& nv)

ovirtual bool addChild( Node *child )
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.

ovirtual bool removeChild( Node *child )
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.

ovirtual bool replaceChild( Node *origChild, Node* newChild )
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.

oint getNumChildren( void )
return the number of chilren nodes

oNode* getChild( int i )
return child node at position i

obool containsNode( Node* node )
return true is node is contained within Group

oChildList::iterator findNode( Node* node )
return the iterator postion for specified Node. return _chilren.end() if node is not contained in Group.

ovirtual ~Group()

ovirtual bool readLocalData(Input& fr)

ovirtual bool writeLocalData(Output& fw)

oChildList _children

obool computeBound( void )


Direct child classes:
Switch
Sequence
Scene
LOD
DCS

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.