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

osg::Geode Class Reference

Leaf Node for grouping Drawables. More...

Inheritance diagram for osg::Geode:

Inheritance graph
[legend]
List of all members.

Public Types

typedef std::vector< ref_ptr<
Drawable > > 
DrawableList

Public Methods

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

 META_Node (osg, Geode)
virtual const bool addDrawable (Drawable *drawable)
 Add Drawable to Geode.

virtual const bool removeDrawable (Drawable *drawable)
 Remove Drawable from Geode.

virtual const bool replaceDrawable (Drawable *origDraw, Drawable *newDraw)
 Replace specified Drawable with another Drawable.

const unsigned int getNumDrawables () const
 return the number of geoset's.

Drawable * getDrawable (const unsigned int i)
 return geoset at position i.

const Drawable * getDrawable (const unsigned int i) const
 return geoset at position i.

const bool containsDrawable (const Drawable *gset) const
 return true if geoset is contained within Geode.

DrawableList::iterator findDrawable (const Drawable *gset)
 return the iterator position for specified Drawable.

DrawableList::const_iterator findDrawable (const Drawable *gset) const
 return the const_iterator position for specified Drawable.

void compileDrawables (State &state)
 compile OpenGL Display List for each geoset.


Protected Methods

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


Protected Attributes

DrawableList _drawables

Detailed Description

Leaf Node for grouping Drawables.


Member Typedef Documentation

typedef std::vector< ref_ptr<Drawable> > osg::Geode::DrawableList
 


Constructor & Destructor Documentation

osg::Geode::Geode (    ) 
 

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

Copy constructor using CopyOp to manage deep vs shallow copy.

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


Member Function Documentation

virtual const bool osg::Geode::addDrawable (  Drawable *    drawable )  [virtual]
 

Add Drawable to Geode.

If gset is not NULL and is not contained in Geode then increment its reference count, add it to the drawables list and dirty the bounding sphere to force it to recompute on next getBound() and return true for success. Otherwise return false.

Reimplemented in osg::Billboard.

void osg::Geode::compileDrawables (  State &    state ) 
 

compile OpenGL Display List for each geoset.

virtual const bool osg::Geode::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::Billboard.

const bool osg::Geode::containsDrawable (  const Drawable *    gset )  const [inline]
 

return true if geoset is contained within Geode.

DrawableList::const_iterator osg::Geode::findDrawable (  const Drawable *    gset )  const [inline]
 

return the const_iterator position for specified Drawable.

return _geoset.end() if gset not is contained in Geode.

DrawableList::iterator osg::Geode::findDrawable (  const Drawable *    gset )  [inline]
 

return the iterator position for specified Drawable.

return _geoset.end() if gset not is contained in Geode.

const Drawable* osg::Geode::getDrawable (  const unsigned int    i )  const [inline]
 

return geoset at position i.

Drawable* osg::Geode::getDrawable (  const unsigned int    i )  [inline]
 

return geoset at position i.

const unsigned int osg::Geode::getNumDrawables (    )  const [inline]
 

return the number of geoset's.

osg::Geode::META_Node (  osg   ,
Geode   
) 
 

virtual const bool osg::Geode::removeDrawable (  Drawable *    drawable )  [virtual]
 

Remove Drawable from Geode.

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

Reimplemented in osg::Billboard.

virtual const bool osg::Geode::replaceDrawable (  Drawable *    origDraw,
Drawable *    newDraw
)  [virtual]
 

Replace specified Drawable with another Drawable.

Decrement the reference count origGSet and increments the reference count of newGset, and dirty the bounding sphere to force it to recompute on next getBound() and returns true. If origDrawable is not found then return false and do not add newGset. If newGset is NULL then return false and do not remove origGset.


Member Data Documentation

DrawableList osg::Geode::_drawables [protected]
 


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