Panda3D
vrpnButtonDevice.h
1 // Filename: vrpnButtonDevice.h
2 // Created by: drose (26Jan01)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef VRPNBUTTONDEVICE_H
16 #define VRPNBUTTONDEVICE_H
17 
18 #include "pandabase.h"
19 
20 #include "clientButtonDevice.h"
21 
22 class VrpnClient;
23 class VrpnButton;
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : VrpnButtonDevice
27 // Description : The Panda interface to a VRPN button. This object
28 // will be returned by VrpnClient::make_device(), for
29 // attaching to a ButtonNode.
30 //
31 // This class does not need to be exported from the DLL.
32 ////////////////////////////////////////////////////////////////////
34 public:
35  VrpnButtonDevice(VrpnClient *client, const string &device_name,
36  VrpnButton *vrpn_button);
37  virtual ~VrpnButtonDevice();
38 
39  INLINE VrpnButton *get_vrpn_button() const;
40 
41 private:
42  VrpnButton *_vrpn_button;
43 
44 public:
45  static TypeHandle get_class_type() {
46  return _type_handle;
47  }
48  static void init_type() {
49  ClientButtonDevice::init_type();
50  register_type(_type_handle, "VrpnButtonDevice",
51  ClientButtonDevice::get_class_type());
52  }
53  virtual TypeHandle get_type() const {
54  return get_class_type();
55  }
56  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
57 
58 private:
59  static TypeHandle _type_handle;
60 
61  friend class VrpnButton;
62 };
63 
64 #include "vrpnButtonDevice.I"
65 
66 #endif
VrpnButton * get_vrpn_button() const
Returns a pointer to the particular VrpnButton this device gets its data from.
A specific ClientBase that connects to a VRPN server and records information on the connected VRPN de...
Definition: vrpnClient.h:38
A device, attached to the ClientBase by a ButtonNode, that records the data from a single named butto...
The Panda interface to a VRPN button.
This is the actual interface to a particular VRPN button device, and all of its numbered buttons...
Definition: vrpnButton.h:42
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85