Added Dragger::s/getActivationModKeyMask(..) and Dragger::s/getActivationKeyEvent(...) methods to make it possible to have draggers that only respond when you press a specified modified key or standard key.

Changed the optional dragger in osgvolume to require the shift key to be pressed for the dragger to become active.
This commit is contained in:
Robert Osfield
2009-07-03 19:16:53 +00:00
parent cb1b874167
commit 6e6a7c960e
8 changed files with 287 additions and 164 deletions

View File

@@ -217,8 +217,11 @@ class OSGMANIPULATOR_EXPORT Dragger : public osg::MatrixTransform
void setHandleEvents(bool flag);
bool getHandleEvents() const { return _handleEvents; }
void setDraggerActive(bool active) { _draggerActive = active; }
bool getDraggerActive() const { return _draggerActive; }
void setActivationModKeyMask(unsigned int mask) { _activationModKeyMask = mask; }
unsigned int getActivationModKeyMask() const { return _activationModKeyMask; }
void setActivationKeyEvent(int key) { _activationKeyEvent = key; }
int getActivationKeyEvent() const { return _activationKeyEvent; }
virtual void traverse(osg::NodeVisitor& nv);
@@ -260,8 +263,17 @@ class OSGMANIPULATOR_EXPORT Dragger : public osg::MatrixTransform
virtual bool receive(const MotionCommand& command);
void dispatch(MotionCommand& command);
void setDraggerActive(bool active) { _draggerActive = active; }
bool getDraggerActive() const { return _draggerActive; }
bool _handleEvents;
bool _draggerActive;
unsigned int _activationModKeyMask;
int _activationKeyEvent;
bool _activationPermittedByModKeyMask;
bool _activationPermittedByKeyEvent;
osgManipulator::PointerInfo _pointer;
Dragger* _parentDragger;