#include <Drawable.hpp>
Inheritance diagram for vrvis::Drawable:
Public Member Functions | |
Destructor | |
virtual | ~Drawable (void) |
Virtual destructor. | |
Forwarded VR Juggler Callbacks | |
virtual void | init (void) |
Initialize data. | |
virtual void | contextInit (void) |
Initialize context data. | |
virtual void | contextUpdate (void) |
Update context data. | |
virtual void | draw (void)=0 |
Draw this Drawable. | |
Status flags | |
virtual void | show (void) |
Make this Drawable visible. | |
virtual void | hide (void) |
Hide this Drawable. | |
bool | isHidden (void) const |
Check the visibility status of this Drawable. | |
void | setContextUpdateFlag (void) |
Set the "ContextUpdate" flag of this Drawable. | |
Static Public Member Functions | |
Forwarded VR Juggler Callbacks | |
void | initAll (void) |
Call init() for all Drawables. | |
void | contextInitAll (void) |
Call contextInit() for all Drawables. | |
void | contextUpdateAll (void) |
Call contextUpdate() for all Drawables. | |
void | drawAll (void) |
Call draw() for all Drawables that are not hidden. | |
Protected Member Functions | |
Constructor | |
Drawable (void) | |
Constructor. | |
Display List Management | |
int | createListID (const std::string &crName) |
Create a new GL display list ID with a certain name. | |
int | getListID (const std::string &crName) |
Access a GL display list ID through its name. | |
void | drawAllLists (void) |
Call all GL display lists owned by this Drawable. |
|
Destructor. Frees all owned display lists. |
|
Default constructor. |
|
Initializes OpenGL context data (display lists, textures, ...). Is called once for each GL context before entering the drawing loop. Does nothing by default, should be implemented by child classes if desired.
Reimplemented in vrvis::Layer, and vrvis::LayerComponent.
|
|
Calls the contextInit() method for each existing Drawable.
|
|
Updates GL context data. Is called once for each context for one VR Juggler frame if the "Context Update" flag is currently set. Does nothing in the default implementation, so you should override this in child classes and set the flag whenever needed.
Reimplemented in vrvis::LayerComponent.
|
|
Calls the contextUpdate() method for each existing Drawable which has its "Context Update" flag set.
|
|
Creates a new context-sensitive display list ID for a given name. If a list with this name already exists, it is overwritten.
|
|
This must be implemented by child classes. In here, all the drawing of the scene should be done, if possible by using call lists filled in contextInit(). As you can't predict how often this method is called by VR Juggler, no calculations or changing of classes' internal state should be done in here.
Implemented in vrvis::Layer, vrvis::LayerComponent, and vrvis::Vis.
|
|
Applies the transformations of the draw matrices and draws all visible Drawables by calling draw().
|
|
Calls the GL display list for each display list ID that this Drawable has created. |
|
Accesses a formerly created display list ID.
|
|
Unsets this Drawable's visibility flag, the Drawable is skipped when redrawing the scene. |
|
Initialization of data members that are not bound to a GL context (read in files, calculate, ...). Method is called exactly once before preparing the context and drawing. Default implementation does nothing, should be overridden by child classes if needed.
Reimplemented in vrvis::LayerComponent.
|
|
Calls the init() method for each existing Drawable.
|
|
Accesses this Drawable's visibility status.
|
|
Sets this Drawable's "Context Update" flag, its contextUpdate() method is called once the next frame. The flag is unset after this one call! |
|
Sets this Drawable's visibility flag, resulting in the Drawable's drawing. |