VRUT::ManipulatorModule Class Reference

Module processing mouse and key input and manipulating object - abstract. More...

#include <manipmodule.h>

Inheritance diagram for VRUT::ManipulatorModule:

VRUT::SceneModule VRUT::Module VRUT::_manip VRUT::CameraModule VRUT::CameraManipulator VRUT::Navigation

List of all members.

Public Member Functions

 ManipulatorModule (const MODULE_ID &_id, const wxString &_name, unsigned _type, EventHandler *msgSink)
 Class constructor.
virtual ~ManipulatorModule ()
 Class destructor.
void PostKeyEvent (wxKeyEvent &evt)
 Post key event.
void PostMouseEvent (wxMouseEvent &evt)
 Post mouse event.

Protected Member Functions

virtual void processEvent (wxCommandEvent &evt)
 Process event - Module overload.
virtual void processKeyEvent (wxKeyEvent &evt)=0
 Process key event.
virtual void processMouseEvent (wxMouseEvent &evt)=0
 Process mouse event.
virtual void processNextEvent ()

Protected Attributes

MessageQueue< wxKeyEvent > keyEvtQueue
 Message queue for key events posted to module.
MessageQueue< wxMouseEvent > msEvtQueue
 Message queue for mouse events posted to module.
long keyEventTimeout
 Amount of time in milliseconds to wait for incoming key event every loop.
Parameter::ParameterIdentificator keyEventTimeoutParamID
 keyEventTimeout parameter identificator
long msEventTimeout
 Amount of time in milliseconds to wait for incoming mouse event every loop.
Parameter::ParameterIdentificator msEventTimeoutParamID
 msEventTimeout parameter identificator
NODE_ID nodeID
 ID of node to manipulate (from scene with ID SceneModule::sceneID).
Parameter::ParameterIdentificator nodeIDParamID
 nodeID parameter identificator


Detailed Description

Module processing mouse and key input and manipulating object - abstract.

Definition at line 23 of file manipmodule.h.


Constructor & Destructor Documentation

VRUT::ManipulatorModule::ManipulatorModule ( const MODULE_ID _id,
const wxString &  _name,
unsigned  _type,
EventHandler msgSink 
) [inline]

Class constructor.

We need to check for input events as fast as possible so no waiting for general events

Definition at line 80 of file manipmodule.h.

00081                             : SceneModule(_id, _name, (_type | MODULE_TYPE_MANIPULATOR), msgSink),
00082                             keyEventTimeoutParamID(_name, wxT("keyEventTimeout"), _id),
00083                             msEventTimeoutParamID(_name, wxT("msEventTimeout"), _id)
00084               {
00086                      SET_DEFAULT_PARAM(eventTimeoutParamID, wxT("0"));
00087                      keyEventTimeout = 10;
00088                      REGISTER_PARAM(keyEventTimeoutParamID, wxT("10"));
00089                      msEventTimeout = 10;
00090                      REGISTER_PARAM(msEventTimeoutParamID, wxT("10"));
00091                      nodeID = NODE_ID_NONE;
00092                      REGISTER_PARAM_GUI_TEXTCONTROL(nodeIDParamID, wxT("nodeID"), wxString::Format(wxT("%i"), NODE_ID_NONE), wxT("Manipulated node ID."));
00093                      REGISTER_LISTENER(Event::EVT_INPUT_KEY);
00094                      REGISTER_LISTENER(Event::EVT_INPUT_MOUSE);
00095               }

virtual VRUT::ManipulatorModule::~ManipulatorModule (  )  [inline, virtual]

Class destructor.

Definition at line 97 of file manipmodule.h.

00098               {
00099               }


Member Function Documentation

virtual void VRUT::ManipulatorModule::processEvent ( wxCommandEvent &  evt  )  [inline, protected, virtual]

Process event - Module overload.

Reimplemented from VRUT::SceneModule.

Reimplemented in VRUT::CameraManipulator, VRUT::CameraModule, VRUT::_manip, and VRUT::Navigation.

Definition at line 44 of file manipmodule.h.

00045               {
00046                      SceneModule::processEvent(evt);
00047                      switch (evt.GetEventType())
00048                      {
00049                      case Event::EVT_PARAM_SET:
00050                             UPDATE_PARAM_FROM_EVENT_LONG(keyEventTimeoutParamID, keyEventTimeout, evt);
00051                             UPDATE_PARAM_FROM_EVENT_LONG(msEventTimeoutParamID, msEventTimeout, evt);
00052                             UPDATE_PARAM_FROM_EVENT_ID(nodeIDParamID, nodeID, evt);
00053                             break;
00054                      default:
00055                             break;
00056                      }
00057               }

virtual void VRUT::ManipulatorModule::processKeyEvent ( wxKeyEvent &  evt  )  [protected, pure virtual]

Process key event.

Implemented in VRUT::CameraManipulator, VRUT::_manip, and VRUT::Navigation.

virtual void VRUT::ManipulatorModule::processMouseEvent ( wxMouseEvent &  evt  )  [protected, pure virtual]

Process mouse event.

Implemented in VRUT::CameraManipulator, VRUT::_manip, and VRUT::Navigation.

virtual void VRUT::ManipulatorModule::processNextEvent (  )  [inline, protected, virtual]

Process next event - Module overload NOTE: careful when setting eventTimeout too high

Reimplemented from VRUT::Module.

Definition at line 64 of file manipmodule.h.

00065               {
00066                      SceneModule::processNextEvent();
00067 
00068                      MessageQueueError err;
00069                      wxKeyEvent kevt = keyEvtQueue.ReceiveTimeout(keyEventTimeout, err);
00070                      if (err == wxMSGQUEUE_NO_ERROR)
00071                             processKeyEvent(kevt);
00072 
00073                      wxMouseEvent mevt = msEvtQueue.ReceiveTimeout(msEventTimeout, err);
00074                      if (err == wxMSGQUEUE_NO_ERROR)
00075                             processMouseEvent(mevt);
00076               }

void VRUT::ManipulatorModule::PostKeyEvent ( wxKeyEvent &  evt  )  [inline]

Post key event.

Definition at line 102 of file manipmodule.h.

00103               {
00104                      MessageQueueError err = keyEvtQueue.Post(evt);
00105                      wxASSERT_MSG(err == wxMSGQUEUE_NO_ERROR, wxT("<ManipulatorModule>Error posting key event - exceeded message queue limit"));
00106               }

void VRUT::ManipulatorModule::PostMouseEvent ( wxMouseEvent &  evt  )  [inline]

Post mouse event.

Definition at line 108 of file manipmodule.h.

00109               {
00110                      MessageQueueError err = msEvtQueue.Post(evt);
00111                      wxASSERT_MSG(err == wxMSGQUEUE_NO_ERROR, wxT("<ManipulatorModule>Error posting mouse event - exceeded message queue limit"));
00112               }


Member Data Documentation

MessageQueue<wxKeyEvent> VRUT::ManipulatorModule::keyEvtQueue [protected]

Message queue for key events posted to module.

Definition at line 27 of file manipmodule.h.

MessageQueue<wxMouseEvent> VRUT::ManipulatorModule::msEvtQueue [protected]

Message queue for mouse events posted to module.

Definition at line 29 of file manipmodule.h.

Amount of time in milliseconds to wait for incoming key event every loop.

Definition at line 31 of file manipmodule.h.

keyEventTimeout parameter identificator

Definition at line 33 of file manipmodule.h.

Amount of time in milliseconds to wait for incoming mouse event every loop.

Definition at line 35 of file manipmodule.h.

msEventTimeout parameter identificator

Definition at line 37 of file manipmodule.h.

ID of node to manipulate (from scene with ID SceneModule::sceneID).

Definition at line 39 of file manipmodule.h.

nodeID parameter identificator

Definition at line 41 of file manipmodule.h.


The documentation for this class was generated from the following file:

Generated on Tue Mar 10 14:41:43 2009 for VRUT by  doxygen 1.5.5