Inheritance diagram for osg::Drawable:
Public Types | |
typedef std::vector< Node * > | ParentList |
A vector of osg::Node pointers which is used to store the parent(s) of drawable. | |
enum | AttributeType { VERTICES, NORMALS, COLORS, TEXTURE_COORDS, TEXTURE_COORDS_0 = TEXTURE_COORDS, TEXTURE_COORDS_1 = TEXTURE_COORDS_0+1, TEXTURE_COORDS_2 = TEXTURE_COORDS_0+2, TEXTURE_COORDS_3 = TEXTURE_COORDS_0+3, TEXTURE_COORDS_4 = TEXTURE_COORDS_0+4, TEXTURE_COORDS_5 = TEXTURE_COORDS_0+5, TEXTURE_COORDS_6 = TEXTURE_COORDS_0+6, TEXTURE_COORDS_7 = TEXTURE_COORDS_0+7 } |
Public Methods | |
Drawable () | |
Drawable (const Drawable &drawable, const CopyOp ©op=CopyOp::SHALLOW_COPY) | |
Copy constructor using CopyOp to manage deep vs shallow copy. | |
virtual bool | isSameKindAs (const Object *obj) const |
virtual const char * | libraryName () const |
return the name of the object's library. | |
virtual const char * | className () const |
return the name of the object's class type. | |
const ParentList & | getParents () const |
Get the parent list of drawable. | |
ParentList | getParents () |
Get the a copy of parent list of node. | |
Node * | getParent (const unsigned int i) |
Get a single parent of Drawable. | |
const Node * | getParent (const unsigned int i) const |
Get a single const parent of Drawable. | |
const unsigned int | getNumParents () const |
Get the number of parents of node. | |
void | setStateSet (StateSet *state) |
Set the StateSet attached to the Drawable. | |
StateSet * | getStateSet () |
Get the attached StateSet. | |
const StateSet * | getStateSet () const |
Get the attached const StateSet. | |
void | setSupportsDisplayList (const bool flag) |
Set the drawable to it can or cannot be used in conjunction with OpenGL display lists. | |
const bool | getSupportsDisplayList () const |
Get whether display lists are supported for this drawable instance. | |
void | setUseDisplayList (const bool flag) |
When set to true, force the draw method to use OpenGL Display List for rendering. | |
const bool | getUseDisplayList () const |
Return whether OpenGL display lists are being used for rendering. | |
void | dirtyDisplayList () |
Force a recompile on next draw() of any OpenGL display list associated with this geoset. | |
void | dirtyBound () |
Dirty the bounding box, forcing a computeBound() on the next call to getBound(). | |
const BoundingBox & | getBound () const |
get bounding box of geoset. | |
void | draw (State &state) |
draw OpenGL primitives. | |
void | compile (State &state) |
Immediately compile this drawable into an OpenGL Display List. | |
void | setAppCallback (AppCallback *ac) |
Set the AppCallback which allows users to attach customize the undating of an object during the app traversal. | |
AppCallback * | getAppCallback () |
Get the non const AppCallback. | |
const AppCallback * | getAppCallback () const |
Get the const AppCallback. | |
void | setCullCallback (CullCallback *cc) |
Set the CullCallback which allows users to attach customize the culling of Drawable during the cull traversal. | |
CullCallback * | getCullCallback () |
Get the non const CullCallback. | |
const CullCallback * | getCullCallback () const |
Get the const CullCallback. | |
void | setDrawCallback (DrawCallback *dc) |
Set the DrawCallback which allows users to attach customize the drawing of existing Drawable object. | |
DrawCallback * | getDrawCallback () |
Get the non const DrawCallback. | |
const DrawCallback * | getDrawCallback () const |
Get the const DrawCallback. | |
virtual void | drawImmediateMode (State &state)=0 |
draw directly ignoring an OpenGL display list which could be attached. | |
virtual void | accept (AttributeFunctor &) |
accept an AttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has. | |
virtual void | accept (PrimitiveFunctor &) |
accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has. | |
Static Public Methods | |
void | deleteDisplayList (uint contextID, uint globj) |
use deleteDisplayList instead of glDeleteList to allow OpenGL display list to cached until they can be deleted by the OpenGL context in which they were created, specified by contextID. | |
void | flushDeletedDisplayLists (uint contextID) |
flush all the cached display list which need to be deleted in the OpenGL context related to contextID. | |
Protected Types | |
typedef std::vector< uint > | GLObjectList |
typedef std::map< uint, std::set< uint > > | DeletedDisplayListCache |
Protected Methods | |
Drawable & | operator= (const Drawable &) |
virtual | ~Drawable () |
virtual const bool | computeBound () const |
compute the bounding box of the drawable. | |
void | addParent (osg::Node *node) |
void | removeParent (osg::Node *node) |
Protected Attributes | |
ParentList | _parents |
ref_ptr< StateSet > | _dstate |
bool | _supportsDisplayList |
bool | _useDisplayList |
GLObjectList | _globjList |
BoundingBox | _bbox |
bool | _bbox_computed |
ref_ptr< AppCallback > | _appCallback |
ref_ptr< DrawCallback > | _drawCallback |
ref_ptr< CullCallback > | _cullCallback |
Static Protected Attributes | |
DeletedDisplayListCache | s_deletedDisplayListCache |
Friends | |
class | Node |
class | Geode |
Contains no drawing primitives directly, these are provided by subclasses such as osg::Geometry. State attributes for a Drawable are maintained in StateSet which the Drawable maintains a referenced counted pointer to. Both Drawable's and StateSet's can be shared for optimal memory usage and graphics performance.
|
|
|
|
|
A vector of osg::Node pointers which is used to store the parent(s) of drawable.
|
|
|
|
|
|
Copy constructor using CopyOp to manage deep vs shallow copy.
|
|
|
|
accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has.
Reimplemented in osg::Geometry, osg::GeoSet, and osg::ImpostorSprite. |
|
accept an AttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has.
Reimplemented in osg::Geometry, osg::GeoSet, and osg::ImpostorSprite. |
|
|
|
return the name of the object's class type. Must be defined by derived classes. Implements osg::Object. Reimplemented in osg::DrawPixels, osg::Geometry, osg::GeoSet, osg::ImpostorSprite, and osgText::Text. |
|
Immediately compile this drawable into an OpenGL Display List. Note I, operation is ignored if _useDisplayList to false. Note II, compile is not intended to be overridden in subclasses. |
|
compute the bounding box of the drawable. Method must be implemented by subclasses. Reimplemented in osg::DrawPixels, osg::GeoSet, osg::ImpostorSprite, osgParticle::ParticleSystem, and osgText::Text. |
|
use deleteDisplayList instead of glDeleteList to allow OpenGL display list to cached until they can be deleted by the OpenGL context in which they were created, specified by contextID.
|
|
Dirty the bounding box, forcing a computeBound() on the next call to getBound(). Should be called in the internal geometry of the Drawable is modified. |
|
Force a recompile on next draw() of any OpenGL display list associated with this geoset.
|
|
draw OpenGL primitives. If the drawable has _useDisplayList set to true then use an OpenGL display list, automatically compiling one if required. Otherwise call drawImmediateMode(). Note, draw method should *not* be overridden in subclasses as it manages the optional display list. |
|
draw directly ignoring an OpenGL display list which could be attached. This is the internal draw method which does the drawing itself, and is the method to override when deriving from Drawable. Implemented in osg::DrawPixels, osg::Geometry, osg::GeoSet, osg::ImpostorSprite, osgParticle::ParticleSystem, and osgText::Text. |
|
flush all the cached display list which need to be deleted in the OpenGL context related to contextID.
|
|
Get the const AppCallback.
|
|
Get the non const AppCallback.
|
|
get bounding box of geoset. Note, now made virtual to make it possible to implement user-drawn objects albeit so what crudely, to be improved later. |
|
Get the const CullCallback.
|
|
Get the non const CullCallback.
|
|
Get the const DrawCallback.
|
|
Get the non const DrawCallback.
|
|
Get the number of parents of node.
|
|
Get a single const parent of Drawable.
|
|
Get a single parent of Drawable.
|
|
Get the a copy of parent list of node. A copy is returned to prevent modification of the parent list. |
|
Get the parent list of drawable.
|
|
Get the attached const StateSet.
|
|
Get the attached StateSet.
|
|
Get whether display lists are supported for this drawable instance.
|
|
Return whether OpenGL display lists are being used for rendering.
|
|
Reimplemented from osg::Object. Reimplemented in osg::DrawPixels, osg::Geometry, osg::GeoSet, and osg::ImpostorSprite. |
|
return the name of the object's library. Must be defined by derived classes. The OpenSceneGraph convention the is that the namspace of a library is the same as the library name. Implements osg::Object. Reimplemented in osg::DrawPixels, osg::Geometry, osg::GeoSet, osg::ImpostorSprite, and osgText::Text. |
|
|
|
|
|
Set the AppCallback which allows users to attach customize the undating of an object during the app traversal.
|
|
Set the CullCallback which allows users to attach customize the culling of Drawable during the cull traversal.
|
|
Set the DrawCallback which allows users to attach customize the drawing of existing Drawable object.
|
|
Set the StateSet attached to the Drawable. Previously attached StateSet are automatically unreferenced on assignment of a new drawstate. |
|
Set the drawable to it can or cannot be used in conjunction with OpenGL display lists. With set to true, calls to Drawable::setUseDisplayList, whereas when set to false, no display lists can be created and calls to setUseDisplayList are ignored, and a warning is produced. The later is typically used to guard against the switching on of display lists on objects with dynamic internal data such as continuous Level of Detail algorithms. |
|
When set to true, force the draw method to use OpenGL Display List for rendering. If false rendering directly. If the display list has not been already compile the next call to draw will automatically create the display list. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|