Geode
is a "geometry node", that is, a leaf node on the scene graph that can have "renderable things" attached to it.
More...
Public Types | |
typedef std::vector < ref_ptr< Drawable > > | DrawableList |
Public Member Functions | |
Geode () | |
Geode (const Geode &, const CopyOp ©op=CopyOp::SHALLOW_COPY) | |
Copy constructor using CopyOp to manage deep vs shallow copy. | |
META_Node (osg, Geode) | |
virtual bool | addDrawable (Drawable *drawable) |
Add a Drawable to the Geode . | |
virtual bool | removeDrawable (Drawable *drawable) |
Remove a Drawable from the Geode . | |
virtual bool | removeDrawables (unsigned int i, unsigned int numDrawablesToRemove=1) |
Remove Drawable (s) from the specified position in Geode 's drawable list. | |
virtual bool | replaceDrawable (Drawable *origDraw, Drawable *newDraw) |
Replace specified Drawable with another Drawable. | |
virtual bool | setDrawable (unsigned int i, Drawable *drawable) |
Set Drawable at position i . | |
unsigned int | getNumDrawables () const |
Return the number of Drawable s currently attached to the Geode . | |
Drawable * | getDrawable (unsigned int i) |
Return the Drawable at position i . | |
const Drawable * | getDrawable (unsigned int i) const |
Return the Drawable at position i . | |
bool | containsDrawable (const Drawable *gset) const |
Return true if a given Drawable is contained within Geode . | |
unsigned int | getDrawableIndex (const Drawable *drawable) const |
Get the index number of drawable . | |
const DrawableList & | getDrawableList () const |
Get the list of drawables. | |
void | compileDrawables (RenderInfo &renderInfo) |
Compile OpenGL Display List for each drawable. | |
const BoundingBox & | getBoundingBox () const |
Return the Geode's bounding box, which is the union of all the bounding boxes of the geode's drawables. | |
virtual BoundingSphere | computeBound () const |
Compute the bounding sphere around Node's geometry or children. | |
virtual void | setThreadSafeRefUnref (bool threadSafe) |
Set whether to use a mutex to ensure ref() and unref() are thread safe. | |
virtual void | resizeGLObjectBuffers (unsigned int maxSize) |
Resize any per context GLObject buffers to specified size. | |
virtual void | releaseGLObjects (osg::State *=0) const |
If State is non-zero, this function releases any associated OpenGL objects for the specified graphics context. | |
Protected Member Functions | |
virtual | ~Geode () |
Protected Attributes | |
osg::BoundingBox | _bbox |
DrawableList | _drawables |
Geode
is a "geometry node", that is, a leaf node on the scene graph that can have "renderable things" attached to it.
In OSG, renderable things are represented by objects from the Drawable
class, so a Geode
is a Node
whose purpose is grouping Drawable
s.
typedef std::vector< ref_ptr<Drawable> > osg::Geode::DrawableList |
osg::Geode::Geode | ( | ) |
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual osg::Geode::~Geode | ( | ) | [protected, virtual] |
osg::Geode::META_Node | ( | osg | , | |
Geode | ||||
) |
virtual bool osg::Geode::addDrawable | ( | Drawable * | drawable | ) | [virtual] |
If drawable
is not NULL
and is not contained in the Geode
then increment its reference count, add it to the drawables list and dirty the bounding sphere to force it to be recomputed on the next call to getBound()
.
true
for success; false
otherwise. Reimplemented in osg::Billboard.
virtual bool osg::Geode::removeDrawable | ( | Drawable * | drawable | ) | [virtual] |
Remove a Drawable
from the Geode
.
Equivalent to removeDrawable(getDrawableIndex(drawable)
.
drawable | The drawable to be removed. |
true
if at least one Drawable
was removed. false
otherwise. Reimplemented in osg::Billboard.
virtual bool osg::Geode::removeDrawables | ( | unsigned int | i, | |
unsigned int | numDrawablesToRemove = 1 | |||
) | [virtual] |
Replace specified Drawable with another Drawable.
Equivalent to setDrawable(getDrawableIndex(origDraw),newDraw)
, 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
.
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.
true
if set correctly, false
on failure (if node==NULL || i is out of range). unsigned int osg::Geode::getNumDrawables | ( | ) | const [inline] |
const Drawable* osg::Geode::getDrawable | ( | unsigned int | i | ) | const [inline] |
Return the Drawable
at position i
.
bool osg::Geode::containsDrawable | ( | const Drawable * | gset | ) | const [inline] |
unsigned int osg::Geode::getDrawableIndex | ( | const Drawable * | drawable | ) | const [inline] |
Get the index number of drawable
.
getNumDrawables()-1
if drawable
is found; if not found, then getNumDrawables()
is returned. const DrawableList& osg::Geode::getDrawableList | ( | ) | const [inline] |
Get the list of drawables.
void osg::Geode::compileDrawables | ( | RenderInfo & | renderInfo | ) |
Compile OpenGL Display List for each drawable.
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.
virtual BoundingSphere osg::Geode::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::Billboard.
virtual void osg::Geode::setThreadSafeRefUnref | ( | bool | threadSafe | ) | [virtual] |
virtual void osg::Geode::resizeGLObjectBuffers | ( | unsigned int | maxSize | ) | [virtual] |
virtual void osg::Geode::releaseGLObjects | ( | osg::State * | = 0 |
) | const [virtual] |
osg::BoundingBox osg::Geode::_bbox [mutable, protected] |
DrawableList osg::Geode::_drawables [protected] |