#include <manipmodule.h>

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 | |
Definition at line 23 of file manipmodule.h.
| 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] |
| 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] |
| virtual void VRUT::ManipulatorModule::processMouseEvent | ( | wxMouseEvent & | evt | ) | [protected, pure virtual] |
| 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 }
MessageQueue<wxKeyEvent> VRUT::ManipulatorModule::keyEvtQueue [protected] |
MessageQueue<wxMouseEvent> VRUT::ManipulatorModule::msEvtQueue [protected] |
long VRUT::ManipulatorModule::keyEventTimeout [protected] |
Amount of time in milliseconds to wait for incoming key event every loop.
Definition at line 31 of file manipmodule.h.
long VRUT::ManipulatorModule::msEventTimeout [protected] |
Amount of time in milliseconds to wait for incoming mouse event every loop.
Definition at line 35 of file manipmodule.h.
NODE_ID VRUT::ManipulatorModule::nodeID [protected] |
ID of node to manipulate (from scene with ID SceneModule::sceneID).
Definition at line 39 of file manipmodule.h.
1.5.5