#include <App.h>
Inheritance diagram for vrj::App:


Public Methods | |
| App (Kernel *kern) | |
| Constructor. More... | |
| App () | |
| Just call App(vrj::Kernel::instance()). More... | |
| virtual | ~App () |
| virtual void | init () |
| Application initialization function. More... | |
| virtual void | apiInit () |
| Application API initialization function. More... | |
| virtual void | exit () |
| Executes any final cleanup needed for the application. More... | |
| virtual void | preFrame () |
| Function called before the Juggler frame starts. More... | |
| virtual void | latePreFrame () |
| Function called after preFrame() and ApplicationData syncronization, but before draw() function. More... | |
| virtual void | intraFrame () |
| Function called during the application's drawing time. More... | |
| virtual void | postFrame () |
| Function called before updating trackers but after the frame is complete. More... | |
| virtual void | reset () |
| Resets the application. More... | |
| bool | haveFocus () |
| Does the application currently have focus? If an application has focus, the user may be attempting to interact with it, so the app should process input. More... | |
| virtual void | focusChanged () |
| Called when the focus state changes. More... | |
| void | setFocus (bool newState) |
| Sets the focus state. More... | |
| virtual float | getDrawScaleFactor () |
| Returns scale scale factor to get from Juggler units (meters) to application units. More... | |
| virtual bool | configCanHandle (jccl::ConfigElementPtr element) |
| Default to handling nothing. More... | |
| virtual bool | depSatisfied () |
| Are any application dependencies satisfied? If the application requires anything special of the system for successful initialization, check it here. More... | |
| virtual DrawManager * | getDrawManager ()=0 |
| Gets the Draw Manager to use. More... | |
| virtual SoundManager * | getSoundManager () |
| Get the SoundManager to use. More... | |
Public Attributes | |
| Kernel * | mKernel |
| bool | mHaveFocus |
Protected Methods | |
| virtual bool | configAdd (jccl::ConfigElementPtr element) |
| virtual bool | configRemove (jccl::ConfigElementPtr element) |
This class defines the class that all API specific application classes should be derived from. The interface given is the interface that the Kernel expects in order to interface with the application. Most of the application's interface will be defined in the derived API specific classes.
Users should sub-class the API specific classes to create user-defined applications. A user application is required to provide function definitions for any of the virual functions that the application needs to use. This is the method that the application programmer uses to interface with VR Juggler.
The control loop will look similar to this:
Definition at line 82 of file App.h.
|
|
Constructor.
Definition at line 40 of file App.cpp. References mHaveFocus, and mKernel. Referenced by vrj::PfApp::PfApp.
00041 {
00042 vprASSERT(kern != NULL); // We don't want a NULL Kernel
00043 mKernel = kern;
00044 mHaveFocus = true;
00045 }
|
|
|
Just call App(vrj::Kernel::instance()).
Definition at line 47 of file App.cpp. References mHaveFocus, and mKernel.
00048 {
00049 mKernel = Kernel::instance();
00050 mHaveFocus = true;
00051 }
|
|
|
Definition at line 95 of file App.h.
00096 {
00097 /* Do nothing. */ ;
00098 }
|
|
|
Application initialization function. Execute any initialization needed before the API is started.
Reimplemented in vrj::OpenSGApp. Definition at line 107 of file App.h. Referenced by vrj::Kernel::startDrawManager.
00108 {;}
|
|
|
Application API initialization function. Execute any initialization needed after API is started but before the drawManager starts the drawing loops. Reimplemented in vrj::OpenSGApp. Definition at line 115 of file App.h. Referenced by vrj::Kernel::startDrawManager.
00116 {;}
|
|
|
Executes any final cleanup needed for the application.
Reimplemented in vrj::OpenSGApp. Definition at line 119 of file App.h. Referenced by vrj::Kernel::changeApplication.
00120 {;}
|
|
|
Function called before the Juggler frame starts. Called after tracker update but before start of a new frame. Reimplemented in vrj::GlProcAppWrapper. Definition at line 126 of file App.h. Referenced by vrj::Kernel::controlLoop.
00127 {;}
|
|
|
Function called after preFrame() and ApplicationData syncronization, but before draw() function.
Definition at line 136 of file App.h. Referenced by vrj::Kernel::controlLoop.
00137 {;}
|
|
|
Function called during the application's drawing time.
Reimplemented in vrj::GlProcAppWrapper. Definition at line 140 of file App.h. Referenced by vrj::Kernel::controlLoop.
00141 {;}
|
|
|
Function called before updating trackers but after the frame is complete.
Reimplemented in vrj::GlProcAppWrapper. Definition at line 146 of file App.h. Referenced by vrj::Kernel::controlLoop.
00147 {;}
|
|
|
Resets the application. This is used when the system (or applications) would like the application to reset to the initial state that it started in. Definition at line 154 of file App.h.
00155 {;}
|
|
|
Does the application currently have focus? If an application has focus, the user may be attempting to interact with it, so the app should process input. If not, the user is not interating with it, so ignore all input, but the user may still be viewing it, so render and update any animations, etc. This is akin to the way a user can only interact with a GUI window that has focus (i.e., the mouse is over the window). Definition at line 167 of file App.h.
00168 {
00169 return mHaveFocus;
00170 }
|
|
|
Called when the focus state changes.
Definition at line 173 of file App.h.
00174 {;}
|
|
|
Sets the focus state.
Definition at line 182 of file App.h.
00183 {
00184 if(newState != mHaveFocus)
00185 {
00186 mHaveFocus = newState;
00187 this->focusChanged();
00188 }
00189 }
|
|
|
Returns scale scale factor to get from Juggler units (meters) to application units. Internally VR Juggler stores and processes all position values in meters. The scale factor returned by this method is used by VR Juggler to scale the OpenGL drawing state from meters to whatever local units the application wants to use. Example: to use feet as local app unit, return 3.28; Definition at line 200 of file App.h.
00201 {
00202 return gadget::PositionUnitConversion::ConvertToFeet;
00203 }
|
|
|
Default to handling nothing.
Definition at line 208 of file App.h.
00209 {
00210 boost::ignore_unused_variable_warning(element);
00211 return false;
00212 }
|
|
|
Are any application dependencies satisfied? If the application requires anything special of the system for successful initialization, check it here. If the return value is false, then the application will not be started yet. If the return value is true, application will be allowed to enter the system. Definition at line 221 of file App.h. Referenced by vrj::Kernel::checkForReconfig.
00222 {
00223 return true;
00224 }
|
|
|
Definition at line 228 of file App.h.
00229 {
00230 boost::ignore_unused_variable_warning(element);
00231 vprASSERT(false);
00232 return false;
00233 }
|
|
|
Definition at line 236 of file App.h.
00237 {
00238 boost::ignore_unused_variable_warning(element);
00239 vprASSERT(false);
00240 return false;
00241 }
|
|
|
Gets the Draw Manager to use.
Implemented in vrj::GlApp. Referenced by vrj::Kernel::changeApplication. |
|
|
Get the SoundManager to use.
Definition at line 258 of file App.h. Referenced by vrj::Kernel::changeApplication.
00259 {
00260 return &SoundManagerFactory::get();
00261 }
|
|
|
Definition at line 244 of file App.h. Referenced by App. |
|
|
Definition at line 245 of file App.h. Referenced by App. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002