#include <ManipEventBase.h>
It is simplest if manipulators sub-class from this so that we are not duplicating the interface all over the place.
Template parameter MT is the ManipType, right now this is either a gutz::Manip or a gutz::Camera.
Only stores SmartPtrs not the acutal object, therefore copy and asignment only copies the pointers, does not create new events.
The role of this class is to provide the interface and event handling for all manipulator objects. It maps event handlers (see gutz::ManipEventBase) to buttons and keys defined in gutzKeyMouse.h It also handles mouse events and forwards them to the appropriate event handler. I chose to make this class a base for Manip and Camera since I really don't want to duplicate the interface in both of these classes and it wouldn't make sense to have more than one of them in any class. Plus it facilitates building and copying events without having to create a manipulator or a camera.
Definition at line 118 of file ManipEventBase.h.
[] Accessors | |
ManipEventTypeSP | operator[] (unsigned int key) const |
const, returns a pointer to the event, only if it is mapped! This is good since we don't want to add an event just to check if it exists!! | |
ManipEventTypeSP & | operator[] (unsigned int key) |
standard non-const, same as the map [] operator | |
Event Interface | |
ManipEventTypeSP | getEvent (const gutz::MouseEvent &me) const |
void | mapEvent (unsigned int button, ManipEventType *met) |
Event Interface | |
bool | mouse (ManipType *m, const gutz::MouseEvent &me) |
bool | move (ManipType *m, const gutz::MouseMoveEvent &mme) |
void | endEvent (ManipType *m, const gutz::MouseEvent &me) |
bool | tumble (ManipType *m) |
Event Management | |
void | clearEvents () |
nuke all events | |
void | cloneEvents (const EventMap &em) |
deep copy of events from some other map. | |
void | shareEvents (const EventMap &em) |
shallow copy of events from some other map | |
Public Types | |
typedef MT | ManipType |
typedef ManipEventBase< MT > | ManipEventType |
typedef SmartPtr< ManipEventType > | ManipEventTypeSP |
typedef std::map< unsigned int, ManipEventTypeSP, std::less< unsigned int > > | BaseType |
typedef BaseType::iterator | Iter |
typedef BaseType::const_iterator | CIter |
Public Member Functions | |
EventMap () | |
EventMap (const EventMap &em) | |
virtual | ~EventMap () |
EventMap & | operator= (const EventMap &em) |
Protected Attributes | |
ManipEventTypeSP | _lastEvent |
|
Definition at line 127 of file ManipEventBase.h. Referenced by gutz::EventMap< MT >::EventMap(). |
|
Definition at line 129 of file ManipEventBase.h. Referenced by gutz::EventMap< MT >::cloneEvents(), gutz::EventMap< MT >::operator[](), and gutz::EventMap< MT >::shareEvents(). |
|
Definition at line 128 of file ManipEventBase.h. |
|
Definition at line 125 of file ManipEventBase.h. |
|
Definition at line 126 of file ManipEventBase.h. Referenced by gutz::EventMap< MT >::getEvent(), and gutz::EventMap< MT >::operator[](). |
|
Definition at line 124 of file ManipEventBase.h. |
|
Definition at line 131 of file ManipEventBase.h. References gutz::EventMap< MT >::BaseType. |
|
Definition at line 132 of file ManipEventBase.h. References gutz::EventMap< MT >::BaseType. |
|
Definition at line 133 of file ManipEventBase.h. |
|
nuke all events
Definition at line 208 of file ManipEventBase.h. |
|
deep copy of events from some other map. Will likely be used like: myManip.cloneEvents( someOtherManip ); Definition at line 215 of file ManipEventBase.h. References gutz::EventMap< MT >::CIter, and gutz::EventMap< MT >::mapEvent(). |
|
Definition at line 191 of file ManipEventBase.h. References gutz::EventMap< MT >::_lastEvent. |
|
Definition at line 165 of file ManipEventBase.h. References gutz::MouseEvent::getButton(), gutz::EventMap< MT >::ManipEventTypeSP, and gutz::EventMap< MT >::operator[](). Referenced by gutz::EventMap< MT >::mouse(). |
|
Definition at line 170 of file ManipEventBase.h. References gutz::EventMap< MT >::operator[](). Referenced by gutz::EventMap< MT >::cloneEvents(), and gutz::EventMap< MT >::shareEvents(). |
|
Definition at line 180 of file ManipEventBase.h. References gutz::EventMap< MT >::_lastEvent, gutz::EventMap< MT >::getEvent(), and gutz::MouseEvent::isButtonDown(). |
|
Definition at line 186 of file ManipEventBase.h. References gutz::EventMap< MT >::_lastEvent. |
|
Definition at line 134 of file ManipEventBase.h. |
|
standard non-const, same as the map [] operator
Definition at line 155 of file ManipEventBase.h. References gutz::EventMap< MT >::ManipEventTypeSP. |
|
const, returns a pointer to the event, only if it is mapped! This is good since we don't want to add an event just to check if it exists!!
Definition at line 147 of file ManipEventBase.h. References gutz::EventMap< MT >::CIter, end, and gutz::EventMap< MT >::ManipEventTypeSP. Referenced by gutz::EventMap< MT >::getEvent(), and gutz::EventMap< MT >::mapEvent(). |
|
shallow copy of events from some other map
Definition at line 224 of file ManipEventBase.h. References gutz::EventMap< MT >::CIter, and gutz::EventMap< MT >::mapEvent(). |
|
Definition at line 195 of file ManipEventBase.h. References gutz::EventMap< MT >::_lastEvent. |
|
Definition at line 236 of file ManipEventBase.h. Referenced by gutz::EventMap< MT >::endEvent(), gutz::EventMap< MT >::mouse(), gutz::EventMap< MT >::move(), and gutz::EventMap< MT >::tumble(). |