//C++ #ifndef PRODUCEREVENTCALLBACK #define PRODUCEREVENTCALLBACK #include #include // For definition of KeySymbol #include #include #include "ProducerEventAdapter.h" #include #include class ProducerEventCallback : public Producer::KeyboardMouseCallback { public: ProducerEventCallback(bool &done) : Producer::KeyboardMouseCallback(), _mx(0.0f),_my(0.0f),_mbutton(0), _done(done) {} virtual ~ProducerEventCallback(); virtual void keyPress( Producer::KeySymbol key ); virtual void keyRelease( Producer::KeySymbol key ); virtual void mouseMotion( float mx, float my); virtual void buttonPress( float mx, float my, unsigned int mbutton ); virtual void buttonRelease( float mx, float my, unsigned int mbutton ); typedef std::vector< osg::ref_ptr > EventQueue; void getEventQueue(EventQueue& queue); bool done() { return _done; } float mx() { return _mx; } float my() { return _my; } unsigned int mbutton() { return _mbutton; } double getTime() { return 0.0f; } private: float _mx, _my; unsigned int _mbutton; bool &_done; osg::Timer _timer; Producer::Mutex _eventQueueMutex; EventQueue _eventQueue; }; #endif