From Philipp Machler, "We have extended the support for Wacom Tablet devices:

- Mac OS X
  - not only pressure, but tilt and z-rotation is supported now
"
This commit is contained in:
Robert Osfield
2008-04-11 13:28:09 +00:00
parent 6fed4022a6
commit 76e0198007
5 changed files with 74 additions and 6 deletions

View File

@@ -89,8 +89,13 @@ class OSGGA_EXPORT EventQueue : public osg::Referenced
/** Method for adapting pen pressure events, placing this event on the back of the event queue, with specified time.*/
void penPressure(float pressure, double time);
/** Method for adapting pen orientation events, placing this event on the back of the event queue.*/
void penOrientation(float tiltX, float tiltY, float rotation) { penOrientation(tiltX, tiltY, rotation, getTime()); }
/** Method for adapting pen orientation events, placing this event on the back of the event queue, with specified time.*/
void penOrientation(float tiltX, float tiltY, float rotation, double time);
/** Method for adapting pen proximity events, placing this event on the back of the event queue.*/
void penProximity(GUIEventAdapter::TabletPointerType pt, bool isEntering) { penProximity(pt, isEntering, getTime()); }

View File

@@ -15,6 +15,7 @@
#define OSGGA_EVENT 1
#include <osg/Object>
#include <osg/Matrix>
#include <osgGA/Export>
namespace osgGA{
@@ -45,11 +46,12 @@ public:
RESIZE=256,
SCROLL=512,
PEN_PRESSURE=1024,
PEN_PROXIMITY_ENTER=2048,
PEN_PROXIMITY_LEAVE=4096,
CLOSE_WINDOW=8192,
QUIT_APPLICATION=16384,
USER=32768
PEN_ORIENTATION=2048,
PEN_PROXIMITY_ENTER=4096,
PEN_PROXIMITY_LEAVE=8192,
CLOSE_WINDOW=16384,
QUIT_APPLICATION=32768,
USER=65536
};
enum KeySymbol
@@ -360,6 +362,20 @@ public:
float getPenPressure() const { return _pressure; }
/// sets the pressure from a tablet
void setPenPressure(float pressure) { _pressure = pressure; }
/// get the tiltX, from a tablet input device (range -1 - 1)
float getPenTiltX() const { return _tiltX; }
/// sets the tiltX from a tablet
void setPenTiltX(float tiltX) { _tiltX = tiltX; }
/// get the tiltY, from a tablet input device (range -1 - 1)
float getPenTiltY() const { return _tiltY; }
/// sets the tiltY from a tablet
void setPenTiltY(float tiltY) { _tiltY = tiltY; }
/// get the rotation, from a tablet input device (range 0 - 2PI)
float getPenRotation() const { return _rotation; }
/// sets the rotation from a tablet
void setPenRotation(float rotation) { _rotation = rotation; }
/// get the orientation from a tablet input device as a matrix
const osg::Matrix getPenOrientation() const;
/// get the current used tablet pointer type
TabletPointerType getTabletPointerType() const { return _tabletPointerType; }
/// set the current used tablet pointer type
@@ -424,6 +440,9 @@ public:
float _mx;
float _my;
float _pressure;
float _tiltX;
float _tiltY;
float _rotation;
unsigned int _buttonMask;
unsigned int _modKeyMask;
ScrollingMotion _scrollingMotion;