/*
 * $Id: _scene.h 319 2008-09-24 11:17:38Z kybav1 $
 *
 * Description  : Template for general purpose module.
 * Author       : Vaclav Kyba <mail/Jabber: vaseo1@gmail.com>  <ICQ: 98576293>
 *
 * Purpose      :
 *     Long description of what the file is for.
 */


///
/// Replace all instances of '_scene' with your new project name
///

#ifndef __SCENE_H__
#define __SCENE_H__

#include "scenemodule.h"


namespace VRUT
{
	///Add comment here for your module class
	class _scene: public SceneModule
	{
	protected:
		///Add any variables
		int var;
		///Add \c var param identificator to register this as parameter
		Parameter::ParameterIdentificator varParamID;

		///Overload this to process events you need
		virtual void processEvent(wxCommandEvent & evt)
		{
			///Always call base method
			SceneModule::processEvent(evt);

			switch (evt.GetEventType())
			{
			///Remember to process registered param update events
			case Event::EVT_PARAM_SET:
				UPDATE_PARAM_FROM_EVENT_INT(varParamID, var, evt);
				break;
			}
		}
		///Overload only if you need to do some action every iteration of module's loop
		virtual void run()
		{
			///These actions below usually take place as reaction to events and not in \c run() method
			///Use <className> in all your log messages
			///Scene modules have its scene ID assigned
			LOG(wxString::Format(wxT("<_scene>I am ready to play with scene ID %i"), sceneID));
			///and access to scene manager
			if (!GetSceneMgr()->GetScene(sceneID))
				LOG(wxT("<_scene>but it is not a valid scene :("));
			else
				LOG(wxT("<_scene>and it is a valid scene :)"));
			///If using long time operations be sure to check for exit during them
			if (TestExit())
				///If we are to exit return to main loop as soon as possible
				return;
		}

	public:
		///Class constructor - do not alter
		_scene(const MODULE_ID & _id, const wxString & _name, EventHandler * msgSink) : SceneModule(_id, _name, 0, msgSink)
		{
			var=0;
			///Register your params - choose GUI type or just register w/o GUI
			REGISTER_PARAM_GUI_SLIDER(varParamID, wxT("100"), 0, 200);
		}
		///Class destructor - deinitialize your data
		virtual ~_scene()
		{
		}

		///Always overload method giving description for your module
		virtual wxString GetDesc() const
		{
			return wxT("This is my module");
		}
	};
};

#endif
