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