00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef SOQT_SPACEBALL_H
00025 #define SOQT_SPACEBALL_H
00026
00027 #include <Inventor/Qt/devices/SoQtDevice.h>
00028 #include <Inventor/SbLinear.h>
00029
00030
00031
00032 class SOQT_DLL_API SoQtSpaceball : public SoQtDevice {
00033 SOQT_OBJECT_HEADER(SoQtSpaceball, SoQtDevice);
00034
00035 public:
00036 enum Mask {
00037 MOTION_EVENT = 0x01, MOTION = MOTION_EVENT,
00038 PRESS_EVENT = 0x02, PRESS = PRESS_EVENT,
00039 RELEASE_EVENT = 0x04, RELEASE = RELEASE_EVENT,
00040 ALL_EVENTS = MOTION_EVENT | PRESS_EVENT | RELEASE_EVENT,
00041 ALL = ALL_EVENTS
00042 };
00043
00044 enum DeviceType {
00045 SPACE_BALL = 0x01,
00046 MAGELLAN_SPACE_MOUSE = 0x02
00047 };
00048
00049 SoQtSpaceball(int events = ALL_EVENTS);
00050 virtual ~SoQtSpaceball();
00051
00052 virtual void enable(QWidget * widget, SoQtEventHandler * handler, void * closure);
00053 virtual void disable(QWidget * widget, SoQtEventHandler * handler, void * closure);
00054
00055 virtual const SoEvent * translateEvent(QEvent * event);
00056
00057 void setRotationScaleFactor(float f);
00058 float getRotationScaleFactor(void) const;
00059 void setTranslationScaleFactor(float f);
00060 float getTranslationScaleFactor(void) const;
00061
00062 static SbBool exists(void);
00063
00064 void setFocusToWindow(SbBool flag);
00065 SbBool isFocusToWindow(void) const;
00066
00067 private:
00068 class SoQtSpaceballP * pimpl;
00069 };
00070
00071
00072
00073 #endif // ! SOQT_SPACEBALL_H