00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00031
00032 #ifndef OIVAPPSHELL_H
00033 #define OIVAPPSHELL_H
00034
00035 #include <cave_ogl.h>
00036 #include <Inventor/SbColor.h>
00037 #include <Inventor/SoDB.h>
00038 #include <Inventor/actions/SoGLRenderAction.h>
00039 #include <Inventor/actions/SoHandleEventAction.h>
00040 #if (SO_VERSION >= 3)
00041 #include <Inventor/events/SoTrackerEvent.h>
00042 #include <Inventor/events/SoControllerButtonEvent.h>
00043 #endif
00044 #include <Inventor/nodes/SoTransform.h>
00045
00046 class OIVAppShell;
00047
00072 class OIVAppShell
00073 {
00074 public:
00075
00076 #ifdef CAVE_THREAD
00077
00078 typedef struct {
00079 SoGLRenderAction* renderAction;
00080 } oivPipeInfo_t;
00081 #endif
00082
00084
00085
00087 static void DisplayInitCB(OIVAppShell*);
00088
00090 static void FrameDrawCB(OIVAppShell*);
00091
00093 static void FrameUpdateCB(OIVAppShell*);
00094
00096
00097 public:
00098
00100 OIVAppShell(int, char**);
00101
00103 virtual ~OIVAppShell();
00104
00106 virtual void buildScene();
00107
00109 virtual void displayInit();
00110
00112 virtual void frameDraw();
00113
00115 virtual void frameUpdate();
00116
00118 virtual void handleEvents() {}
00119
00121 void setBackgroundColor(const SbColor&);
00122
00123 protected:
00124
00126 void drawInventorScene(SoGLRenderAction*, SoSeparator*);
00127
00128 protected:
00129
00130 #ifdef CAVE_THREAD
00131 oivPipeInfo_t* m_oivPipeInfo;
00132 #endif
00133
00135 SbColor m_bgColor;
00136
00138 SoSeparator* m_sceneRoot;
00139
00140 };
00141
00142 #endif