00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __SCENEMODULE_H__
00012 #define __SCENEMODULE_H__
00013
00014 #include "module.h"
00015 #include "scenemanager.h"
00016
00017
00018 namespace VRUT
00019 {
00021 class SceneModule : public Module
00022 {
00023 protected:
00025 SceneManager * sceneMgr;
00027 SCENE_ID sceneID;
00029 Parameter::ParameterIdentificator sceneIDParamID;
00030
00031 virtual void processEvent(wxCommandEvent & evt)
00032 {
00033 Module::processEvent(evt);
00034 switch (evt.GetEventType())
00035 {
00036 case Event::EVT_PARAM_SET:
00037 UPDATE_PARAM_FROM_EVENT_ID(sceneIDParamID, sceneID, evt);
00038 break;
00039 default:
00040 break;
00041 }
00042 }
00043
00044 public:
00046 SceneModule(const MODULE_ID & _id, const wxString & _name, unsigned _type, EventHandler * msgSink)
00047 : Module(_id, _name, (_type | MODULE_TYPE_SCENE), msgSink),
00048 sceneMgr((SceneManager *)NULL), sceneID(SCENE_ID_NONE)
00049 {
00050 REGISTER_PARAM_GUI_TEXTCONTROL(sceneIDParamID, wxT("sceneID"), wxString::Format(wxT("%i"), SCENE_ID_NONE), wxT("ID of scene to handle."));
00051 }
00052
00054 virtual ~SceneModule() {}
00055
00057 void SetSceneMgr(SceneManager * _sceneMgr)
00058 {
00059 sceneMgr = _sceneMgr;
00060 }
00062 SceneManager * GetSceneMgr() const
00063 {
00064 wxASSERT_MSG(sceneMgr, wxT("<SceneModule>Scene manager not defined, module was not initialized properly"));
00065 return sceneMgr;
00066 }
00067 };
00068 };
00069
00070
00071 #endif // __SCENEMODULE_H__