Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::Geode Class Reference

Inheritance diagram for osg::Geode:

osg::Node osg::Object osg::Referenced osg::Billboard osgSim::ScalarBar osgSim::SphereSegment List of all members.

Public Types

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

Public Member Functions

 Geode ()
 Geode (const Geode &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 META_Node (osg, Geode)
virtual bool addDrawable (Drawable *drawable)
virtual bool removeDrawable (Drawable *drawable)
virtual bool removeDrawable (unsigned int i, unsigned int numDrawablesToRemove=1)
virtual bool replaceDrawable (Drawable *origDraw, Drawable *newDraw)
virtual bool setDrawable (unsigned int i, Drawable *drawable)
unsigned int getNumDrawables () const
DrawablegetDrawable (unsigned int i)
const DrawablegetDrawable (unsigned int i) const
bool containsDrawable (const Drawable *gset) const
unsigned int getDrawableIndex (const Drawable *node) const
void compileDrawables (State &state)
const BoundingBoxgetBoundingBox () const

Protected Member Functions

virtual ~Geode ()
virtual bool computeBound () const

Protected Attributes

osg::BoundingBox _bbox
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 bool osg::Geode::addDrawable Drawable drawable  )  [virtual]
 

Add Drawable to Geode. If drawable 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 drawable.

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

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

return true if drawable is contained within Geode.

const BoundingBox& osg::Geode::getBoundingBox  )  const [inline]
 

return the Geode's bounding box, which is the union of all the bounding boxes of the geode's drawables.

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

return drawable at position i.

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

return drawable at position i.

unsigned int osg::Geode::getDrawableIndex const Drawable node  )  const [inline]
 

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

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

return the number of drawables.

osg::Geode::META_Node osg  ,
Geode 
 

virtual bool osg::Geode::removeDrawable unsigned int  i,
unsigned int  numDrawablesToRemove = 1
[virtual]
 

Remove drawable(s) from the specified position in Geode's drawable list.

virtual bool osg::Geode::removeDrawable Drawable drawable  )  [virtual]
 

Remove Drawable from Geode. Equivalent to setDrawable(getDrawableIndex(originChild),node), see docs for setNode for further details on implementation.

Reimplemented in osg::Billboard.

virtual bool osg::Geode::replaceDrawable Drawable origDraw,
Drawable newDraw
[virtual]
 

Replace specified Drawable with another Drawable. Equivalent to setDrawable(getDrawableIndex(originChild),node), see docs for setDrawable for further details on implementation.

virtual bool osg::Geode::setDrawable unsigned int  i,
Drawable drawable
[virtual]
 

set drawable at position i. return true if set correctly, false on failure (if node==NULL || i is out of range). 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

osg::BoundingBox osg::Geode::_bbox [mutable, protected]
 

DrawableList osg::Geode::_drawables [protected]
 


The documentation for this class was generated from the following file:
Generated on Wed Sep 7 11:10:02 2005 for openscenegraph by  doxygen 1.4.4