class SG_EXPORT osg::Drawable

Pure virtual base class for drawable Geomtery.

Inheritance:


Public Methods

[more] Drawable()
[more]virtual bool isSameKindAs(const Object* obj) const
[more]virtual const char* className() const
[more]inline void setStateSet(StateSet* state)
Set the StateSet attached to the Drawable.
[more]inline StateSet* getStateSet()
Get the attached StateSet
[more]inline const StateSet* getStateSet() const
Get the attached const StateSet
[more]void setSupportsDisplayList(const bool flag)
Set the drawable to it can or cannot be used inconjunction with OpenGL display lists.
[more]inline const bool getSupportsDisplayList() const
Get whether display lists are supportd for this drawable instance
[more]void setUseDisplayList(const bool flag)
When set to true, force the draw method to use OpenGL Display List for rendering.
[more]inline const bool getUseDisplayList() const
Return whether OpenGL display lists are being used for rendering
[more]void dirtyDisplayList()
Force a recompile on next draw() of any OpenGL display list associated with this geoset
[more]inline void dirtyBound()
[more]inline const BoundingBox& getBound() const
get bounding box of geoset.
[more]inline void draw(State& state)
draw OpenGL primitives.
[more]void compile(State& state)
Immediately compile this drawable into an OpenGL Display List.
[more]virtual void drawImmediateMode(State& state) = 0
draw directly ignoring an OpenGL display list which could be attached.
[more]static 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
[more]static void flushDeletedDisplayLists(uint contextID)
flush all the cached display list which need to be deleted in the OpenGL context related to contextID

Protected Fields

[more]ref_ptr<StateSet> _dstate
[more]bool _supportsDisplayList
[more]bool _useDisplayList
[more]mutable BoundingBox _bbox
[more]mutable bool _bbox_computed

Protected Methods

[more] Drawable(const Drawable&)
[more]Drawable& operator = (const Drawable&)
[more]virtual ~Drawable()
[more]virtual const bool computeBound() const = 0
compute the bounding box of the drawable.

Protected Members

[more]typedef std::vector<uint> GLObjectList mutable GLObjectList _globjList
[more]typedef std::map<uint,std::set<uint> >static DeletedDisplayListCache DeletedDisplayListCache s_deletedDisplayListCache


Inherited from Object:

Public Methods

ovirtual Object* clone() const


Inherited from Referenced:

Public Methods

oinline void ref() const
oinline void unref() const
oinline const int referenceCount() const

Protected Fields

omutable int _refCount


Documentation

Pure virtual base class for drawable Geomtery. Contains no drawing primitives directly, these are provided by subclasses such as GeoSet. 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.
o Drawable()

ovirtual bool isSameKindAs(const Object* obj) const

ovirtual const char* className() const

oinline void setStateSet(StateSet* state)
Set the StateSet attached to the Drawable. Previously attached StateSet are automatically unreferenced on assignment of a new drawstate.

oinline StateSet* getStateSet()
Get the attached StateSet

oinline const StateSet* getStateSet() const
Get the attached const StateSet

ovoid setSupportsDisplayList(const bool flag)
Set the drawable to it can or cannot be used inconjunction 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.

oinline const bool getSupportsDisplayList() const
Get whether display lists are supportd for this drawable instance

ovoid setUseDisplayList(const bool flag)
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.

oinline const bool getUseDisplayList() const
Return whether OpenGL display lists are being used for rendering

ovoid dirtyDisplayList()
Force a recompile on next draw() of any OpenGL display list associated with this geoset

oinline void dirtyBound()

oinline const BoundingBox& getBound() const
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.

oinline void draw(State& state)
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 overriden in subclasses as it manages the optional display list.

ovoid compile(State& state)
Immediately compile this drawable into an OpenGL Display List. Note, operation is ignored if _useDisplayList to false.

ovirtual void drawImmediateMode(State& state) = 0
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.

ostatic 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

ostatic void flushDeletedDisplayLists(uint contextID)
flush all the cached display list which need to be deleted in the OpenGL context related to contextID

o Drawable(const Drawable&)

oDrawable& operator = (const Drawable&)

ovirtual ~Drawable()

ovirtual const bool computeBound() const = 0
compute the bounding box of the drawable. Method must be implementated by subclasses.

oref_ptr<StateSet> _dstate

obool _supportsDisplayList

obool _useDisplayList

otypedef std::vector<uint> GLObjectList mutable GLObjectList _globjList

omutable BoundingBox _bbox

omutable bool _bbox_computed

otypedef std::map<uint,std::set<uint> >static DeletedDisplayListCache DeletedDisplayListCache s_deletedDisplayListCache


Direct child classes:
ImpostorSprite
GeoSet

Alphabetic index HTML hierarchy of classes or Java



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