vrpnButtonDevice.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Filename: vrpnButtonDevice.h
  2. // Created by: drose (26Jan01)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://etc.cmu.edu/panda3d/docs/license/ .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef VRPNBUTTONDEVICE_H
  19. #define VRPNBUTTONDEVICE_H
  20. #include "pandabase.h"
  21. #include "clientButtonDevice.h"
  22. class VrpnClient;
  23. class VrpnButton;
  24. ////////////////////////////////////////////////////////////////////
  25. // Class : VrpnButtonDevice
  26. // Description : The Panda interface to a VRPN button. This object
  27. // will be returned by VrpnClient::make_device(), for
  28. // attaching to a ButtonNode.
  29. //
  30. // This class does not need to be exported from the DLL.
  31. ////////////////////////////////////////////////////////////////////
  32. class VrpnButtonDevice : public ClientButtonDevice {
  33. public:
  34. VrpnButtonDevice(VrpnClient *client, const string &device_name,
  35. VrpnButton *vrpn_button);
  36. virtual ~VrpnButtonDevice();
  37. INLINE VrpnButton *get_vrpn_button() const;
  38. private:
  39. VrpnButton *_vrpn_button;
  40. public:
  41. static TypeHandle get_class_type() {
  42. return _type_handle;
  43. }
  44. static void init_type() {
  45. ClientButtonDevice::init_type();
  46. register_type(_type_handle, "VrpnButtonDevice",
  47. ClientButtonDevice::get_class_type());
  48. }
  49. virtual TypeHandle get_type() const {
  50. return get_class_type();
  51. }
  52. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  53. private:
  54. static TypeHandle _type_handle;
  55. friend class VrpnButton;
  56. };
  57. #include "vrpnButtonDevice.I"
  58. #endif