00001
00015
00016 #ifdef USE_VRPN
00017
00018
00019 #ifndef VRPNBUTTONDEVICE_H
00020 #define VRPNBUTTONDEVICE_H
00021
00022
00023 #include <G3D/G3DAll.h>
00024 using namespace G3D;
00025 #include <iostream>
00026
00027 #include "InputDevice.H"
00028
00029 class vrpn_Button_Remote;
00030
00031 namespace VRG3D {
00032
00035 class VRPNButtonDevice : public InputDevice
00036 {
00037 public:
00038 VRPNButtonDevice(const std::string &vrpnButtonDeviceName,
00039 const Array<std::string> &eventsToGenerate);
00040
00041 virtual ~VRPNButtonDevice();
00042
00043 void pollForInput(Array<EventRef> &events);
00044
00045 std::string getEventName(int buttonNumber);
00046 void sendEvent(int buttonNumber, bool down);
00047
00048 private:
00049 vrpn_Button_Remote *_vrpnDevice;
00050 Array<std::string> _eventNames;
00051 Array<EventRef> _pendingEvents;
00052 };
00053
00054 }
00055
00056 #endif
00057
00058 #endif // USE_VRPN defined
00059
00060