Added an EventQueue directly into osgProducer::Viewer.
This commit is contained in:
@@ -31,7 +31,7 @@ class OSGGA_EXPORT EventQueue : public osg::Referenced
|
||||
{
|
||||
public:
|
||||
|
||||
EventQueue();
|
||||
EventQueue(GUIEventAdapter::MouseYOrientation mouseYOrientation=GUIEventAdapter::Y_INCREASING_DOWNWARDS);
|
||||
|
||||
typedef std::list< osg::ref_ptr<GUIEventAdapter> > Events;
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ class OSGPRODUCER_EXPORT KeyboardMouseCallback : public Producer::KeyboardMouseC
|
||||
// local methods and members
|
||||
typedef osgGA::EventQueue::Events EventQueue;
|
||||
|
||||
void setEventQueue(osgGA::EventQueue* eventQueue) { _eventQueue = eventQueue; }
|
||||
osgGA::EventQueue* getEventQueue() { return _eventQueue.get(); }
|
||||
|
||||
bool takeEventQueue(EventQueue& queue);
|
||||
|
||||
@@ -255,6 +255,12 @@ class OSGPRODUCER_EXPORT Viewer : public OsgCameraGroup, public osgGA::GUIAction
|
||||
/** Compute, from normalized mouse coords, for all Cameras, intersections with the scene.*/
|
||||
bool computeIntersections(float x,float y,osgUtil::IntersectVisitor::HitList& hits,osg::Node::NodeMask traversalMask = 0xffffffff);
|
||||
|
||||
/** Set the EventQueue - a thread safe queue for registering events.*/
|
||||
void setEventQueue(osgGA::EventQueue* eventQueue) { _eventQueue = eventQueue; }
|
||||
|
||||
/** Get the EventQueue.*/
|
||||
osgGA::EventQueue* getEventQueue() { return _eventQueue.get(); }
|
||||
|
||||
void setKeyboardMouse(Producer::KeyboardMouse* kbm);
|
||||
Producer::KeyboardMouse* getKeyboardMouse() { return _kbm.get(); }
|
||||
const Producer::KeyboardMouse* getKeyboardMouse() const { return _kbm.get(); }
|
||||
@@ -310,6 +316,8 @@ class OSGPRODUCER_EXPORT Viewer : public OsgCameraGroup, public osgGA::GUIAction
|
||||
bool _writeImageWhenDone;
|
||||
std::string _writeImageFileName;
|
||||
|
||||
osg::ref_ptr<osgGA::EventQueue> _eventQueue;
|
||||
|
||||
osg::ref_ptr<Producer::KeyboardMouse> _kbm;
|
||||
|
||||
osg::ref_ptr<osgProducer::KeyboardMouseCallback> _kbmcb;
|
||||
|
||||
Reference in New Issue
Block a user