From Rafa Giatan and Robert Osfield, added support for User defined events, by adding
UserData to Events.
This commit is contained in:
@@ -358,3 +358,15 @@ GUIEventAdapter* EventQueue::createEvent()
|
||||
if (_accumulateEventState.valid()) return new GUIEventAdapter(*_accumulateEventState.get());
|
||||
else return new GUIEventAdapter();
|
||||
}
|
||||
|
||||
void EventQueue::userEvent(osg::Referenced* userEventData, double time)
|
||||
{
|
||||
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
|
||||
event->setEventType(GUIEventAdapter::USER);
|
||||
event->setUserData(userEventData);
|
||||
event->setTime(time);
|
||||
|
||||
addEvent(event);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@ GUIEventAdapter::GUIEventAdapter():
|
||||
_tabletPointerType(UNKNOWN)
|
||||
{}
|
||||
|
||||
GUIEventAdapter::GUIEventAdapter(const GUIEventAdapter& rhs):
|
||||
osg::Referenced(),
|
||||
GUIEventAdapter::GUIEventAdapter(const GUIEventAdapter& rhs,const osg::CopyOp& copyop):
|
||||
osg::Object(rhs,copyop),
|
||||
_handled(rhs._handled),
|
||||
_eventType(rhs._eventType),
|
||||
_time(rhs._time),
|
||||
|
||||
Reference in New Issue
Block a user