#include <OIVAppShell.h>
Inheritance diagram for OIVAppShell:
Public Member Functions | |
OIVAppShell (int, char **) | |
Constructor will perform initializations of Inventor and time. | |
virtual | ~OIVAppShell () |
Virtual destructor. | |
virtual void | buildScene () |
Build the scene graph. Must be explicitly called. | |
virtual void | displayInit () |
Initialize the display or thread. | |
virtual void | frameDraw () |
Draw the current frame. | |
virtual void | frameUpdate () |
Update the engine and time values. | |
virtual void | handleEvents () |
Once-per-frame event handling such as wands and buttons are here. | |
void | setBackgroundColor (const SbColor &) |
Set the background color. | |
Static Public Member Functions | |
CAVELib callback functions | |
static void | DisplayInitCB (OIVAppShell *) |
Display initialization callback. Also used to initialize threads. | |
static void | FrameDrawCB (OIVAppShell *) |
Frame draw callback called for each draw update. | |
static void | FrameUpdateCB (OIVAppShell *) |
Frame update callback called once per frame cycle. | |
Protected Member Functions | |
void | drawInventorScene (SoGLRenderAction *, SoSeparator *) |
Renders the Inventor scene graph. | |
Protected Attributes | |
SbColor | m_bgColor |
Background color for the environment. | |
SoSeparator * | m_sceneRoot |
Root scene graph node. |
Static callback functions for assignment to the CAVELib callbacks are in place, and a reference to the application instance should be passed as user data. This will allow subclasses to correctly use inheritance in calling bound functions. Below is a sample implementation:
app = new VirtoccApp(argc, argv); CAVEInitApplication((CAVECALLBACK) OIVAppShell::DisplayInitCB, 1, app); app->buildScene(); CAVEFrameFunction((CAVECALLBACK) OIVAppShell::FrameUpdateCB, 1, app); CAVEDisplay((CAVECALLBACK) OIVAppShell::FrameDrawCB, 1, app);
|
Constructor will perform initializations of Inventor and time. The constructor handlines initialization of Inventor classes and creates the single root Separator. This constructor should be called by any subclasses. Custom Inventor classes may safely call their initClass() functions in subclass constructors. Command line arguments can be parsed from the main application.
|
|
Virtual destructor.
|
|
Build the scene graph. Must be explicitly called.
Reimplemented in SculptDemoApp. |
|
Initialize the display or thread.
|
|
Display initialization callback. Also used to initialize threads.
|
|
Renders the Inventor scene graph. A GLRenderAction is passed to this function along with a scene graph to render. Matrix and projection calls are handled within this function to properly handle display with the CAVELib. The structure of this code was copied from documentation provided by TGS for handling Inventor and the CAVELib. This method is called after OIVAppShell::frameDraw() has updated the viewport information.
|
|
Draw the current frame.
|
|
Frame draw callback called for each draw update.
|
|
Update the engine and time values.
Reimplemented in SculptDemoApp. |
|
Frame update callback called once per frame cycle.
|
|
Once-per-frame event handling such as wands and buttons are here.
Reimplemented in SculptDemoApp. |
|
Set the background color.
|
|
Background color for the environment.
|
|
Root scene graph node.
|