Added extra access methods on osgProducer::KeyboardMouseCallback, and added

support for reading and writing keyboard/mouse events in osgcluster.
This commit is contained in:
Robert Osfield
2005-08-29 12:05:17 +00:00
parent b316dc30e8
commit ffb06a8c49
5 changed files with 200 additions and 21 deletions

View File

@@ -173,6 +173,45 @@ double KeyboardMouseCallback::getEventQueue(EventQueue& queue)
return swapTime;
}
double KeyboardMouseCallback::copyEventQueue(EventQueue& queue) const
{
double swapTime;
queue.clear();
_eventQueueMutex.lock();
queue = _eventQueue;
swapTime = getTime();
_eventQueueMutex.unlock();
return swapTime;
}
double KeyboardMouseCallback::setEventQueue(EventQueue& queue)
{
double swapTime;
queue.clear();
_eventQueueMutex.lock();
_eventQueue = queue;
swapTime = getTime();
_eventQueueMutex.unlock();
return swapTime;
}
double KeyboardMouseCallback::appendEventQueue(EventQueue& queue)
{
double swapTime;
queue.clear();
_eventQueueMutex.lock();
_eventQueue.insert(_eventQueue.end(),queue.begin(),queue.end());
swapTime = getTime();
_eventQueueMutex.unlock();
return swapTime;
}
EventAdapter* KeyboardMouseCallback::createEventAdapter()
{
EventAdapter* ea = new EventAdapter;