00001 #ifndef INPUTDEVICEDRIVER_H 00002 #define INPUTDEVICEDRIVER_H 00003 00004 #ifndef BALL_COMMON_GLOBAL_H 00005 # include <BALL/COMMON/global.h> 00006 #endif 00007 00008 #include <QtCore/QMutex> 00009 00010 class QWidget; 00011 00012 namespace BALL 00013 { 00014 namespace VIEW 00015 { 00016 class Scene; 00017 00018 class BALL_VIEW_EXPORT InputDeviceDriver 00019 { 00020 public: 00021 InputDeviceDriver(QWidget* reciever); 00022 virtual ~InputDeviceDriver(); 00023 00024 virtual bool setUp() = 0; 00025 virtual bool tearDown() = 0; 00026 00027 void setEnabled(bool enabled); 00028 bool isEnabled() { return enabled_; } 00029 00030 void setReceiver(Scene* s); 00031 QWidget* getReceiver(); 00032 00033 protected: 00034 void emitPositionChange(double x, double y, double z, double a, double b, double c); 00035 void emitPositionChange(double x, double y, double z, double q1, double q2, double q3, double q4); 00036 void emitHeadChange(double x, double y, double z, double q1, double q2, double q3, double q4); 00037 00038 private: 00039 QMutex receiverLock; 00040 00041 QWidget* receiver_; 00042 bool enabled_; 00043 }; 00044 00045 } 00046 } 00047 00048 #endif //INPUTDEVICEDRIVER_H 00049