00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00027
00029 #ifndef __SCENE_H__
00030 #define __SCENE_H__
00031
00032 #include "X3DChildNode.h"
00033 #include "H3DWindowNode.h"
00034
00035 namespace H3D {
00036
00045 class H3DAPI_API Scene : public Node {
00046 public:
00047
00048 typedef TypedMFNode< H3DWindowNode > MFWindow;
00049 typedef TypedSFNode< X3DChildNode > SFChildNode;
00050
00052 Scene( Inst< SFChildNode > _sceneRoot = 0,
00053 Inst< MFWindow > _window = 0,
00054 Inst< SFFloat > _frameRate = 0 );
00055
00057 ~Scene();
00058
00061 void setActive( bool _active ) {
00062 active = _active;
00063 }
00064
00066 bool isActive() {
00067 return active;
00068 }
00069
00072 virtual void idle();
00073
00077 static void mainLoop();
00078
00082 auto_ptr< SFChildNode > sceneRoot;
00083
00087 auto_ptr< MFWindow > window;
00088
00092 auto_ptr< SFFloat > frameRate;
00093
00097 static SFTime *time;
00098
00100 static set< Scene* > scenes;
00101
00103 static H3DNodeDatabase database;
00104
00105 protected:
00109 class EventSink: public Field {
00110 public:
00112 EventSink() {
00113 setName( "Scene::eventSink" );
00114 }
00115 protected:
00116 virtual void update();
00117 };
00118 public:
00119 static EventSink *eventSink;
00120
00121 private:
00122 bool active;
00123
00124 TimeStamp last_time;
00125 #ifdef USE_HAPTICS
00126
00127 TraverseInfo *last_traverseinfo;
00128 #endif
00129 };
00130 }
00131
00132 #endif