35class EXPCL_VRPN VrpnClient :
public ClientBase {
37 explicit VrpnClient(
const std::string &server_name);
44 void write(std::ostream &out,
int indent_level = 0)
const;
50 virtual PT(ClientDevice) make_device(
TypeHandle device_type,
51 const std::string &device_name);
53 virtual bool disconnect_device(
TypeHandle device_type,
54 const std::string &device_name,
55 ClientDevice *device);
57 virtual void do_poll();
60 PT(ClientDevice) make_tracker_device(
const std::string &device_name);
61 PT(ClientDevice) make_button_device(
const std::string &device_name);
62 PT(ClientDevice) make_analog_device(
const std::string &device_name);
63 PT(ClientDevice) make_dial_device(
const std::string &device_name);
69 VrpnTracker *get_tracker(
const std::string &tracker_name);
72 VrpnButton *get_button(
const std::string &button_name);
75 VrpnAnalog *get_analog(
const std::string &analog_name);
78 VrpnDial *get_dial(
const std::string &dial_name);
82 std::string _server_name;
83 vrpn_Connection *_connection;
85 typedef pmap<std::string, VrpnTracker *> Trackers;
86 typedef pmap<std::string, VrpnButton *> Buttons;
87 typedef pmap<std::string, VrpnAnalog *> Analogs;
88 typedef pmap<std::string, VrpnDial *> Dials;
100 static void init_type() {
101 ClientBase::init_type();
103 ClientBase::get_class_type());
106 return get_class_type();
108 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
TypeHandle is the identifier used to differentiate C++ class types.
The Panda interface to a VRPN analog device.
This is the actual interface to a particular VRPN analog device, and all of its numbered controls.
static double convert_to_secs(struct timeval msg_time)
Little inline function to convert a struct timeval to only seconds.
void write(std::ostream &out, int indent_level=0) const
Writes a list of the active devices that the VrpnClient is currently polling each frame.
bool is_valid() const
Returns true if everything seems to be kosher with the server (even if there is no connection),...
const std::string & get_server_name() const
Returns the name of the server as passed to the VrpnClient constructor.
The Panda interface to a VRPN dial device.
This is the actual interface to a particular VRPN dial device, and all of its numbered dials.
The Panda interface to a VRPN tracker.
This is the actual interface to a particular VRPN tracker object, and all of its sensors.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool is_connected(MObject &node, const string &attribute_name)
Returns true if the named connection exists on the node and is connected to anything,...
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.