Pure virtual base class for drawable Geomtery.
Inheritance:
Public Methods
-
Drawable()
-
virtual bool isSameKindAs(const Object* obj) const
-
virtual const char* className() const
-
inline void setStateSet(StateSet* state)
- Set the StateSet attached to the Drawable.
-
inline StateSet* getStateSet()
- Get the attached StateSet
-
inline const StateSet* getStateSet() const
- Get the attached const StateSet
-
void setSupportsDisplayList(const bool flag)
- Set the drawable to it can or cannot be used inconjunction with OpenGL display lists.
-
inline const bool getSupportsDisplayList() const
- Get whether display lists are supportd for this drawable instance
-
void setUseDisplayList(const bool flag)
- When set to true, force the draw method to use OpenGL Display List for rendering.
-
inline 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
-
inline void dirtyBound()
-
inline const BoundingBox& getBound() const
- get bounding box of geoset.
-
inline void draw(State& state)
- draw OpenGL primitives.
-
void compile(State& state)
- Immediately compile this drawable into an OpenGL Display List.
-
virtual void drawImmediateMode(State& state) = 0
- draw directly ignoring an OpenGL display list which could be attached.
-
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
-
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
-
ref_ptr<StateSet> _dstate
-
bool _supportsDisplayList
-
bool _useDisplayList
-
mutable BoundingBox _bbox
-
mutable bool _bbox_computed
Protected Methods
-
Drawable(const Drawable&)
-
Drawable& operator = (const Drawable&)
-
virtual ~Drawable()
-
virtual const bool computeBound() const = 0
- compute the bounding box of the drawable.
Protected Members
-
typedef std::vector<uint> GLObjectList mutable GLObjectList _globjList
-
typedef std::map<uint,std::set<uint> >static DeletedDisplayListCache DeletedDisplayListCache s_deletedDisplayListCache
Inherited from Object:
Public Methods
-
virtual Object* clone() const
Public Methods
-
inline void ref() const
-
inline void unref() const
-
inline const int referenceCount() const
Protected Fields
-
mutable 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.
- Drawable()
- virtual bool isSameKindAs(const Object* obj) const
- virtual const char* className() const
- inline void setStateSet(StateSet* state)
- Set the StateSet attached to the Drawable.
Previously attached StateSet are automatically unreferenced on
assignment of a new drawstate.
- inline StateSet* getStateSet()
- Get the attached StateSet
- inline const StateSet* getStateSet() const
- Get the attached const StateSet
- void 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.
- inline const bool getSupportsDisplayList() const
- Get whether display lists are supportd for this drawable instance
- void 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.
- inline 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
- inline void dirtyBound()
- inline 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.
- inline 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.
- void compile(State& state)
- Immediately compile this drawable into an OpenGL Display List.
Note, operation is ignored if _useDisplayList to false.
- virtual 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.
- 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
- static void flushDeletedDisplayLists(uint contextID)
- flush all the cached display list which need to be deleted
in the OpenGL context related to contextID
- Drawable(const Drawable&)
- Drawable& operator = (const Drawable&)
- virtual ~Drawable()
- virtual const bool computeBound() const = 0
- compute the bounding box of the drawable. Method must be
implementated by subclasses.
- ref_ptr<StateSet> _dstate
- bool _supportsDisplayList
- bool _useDisplayList
- typedef std::vector<uint> GLObjectList mutable GLObjectList _globjList
- mutable BoundingBox _bbox
- mutable bool _bbox_computed
- typedef 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++.