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