iMSTK
Interactive Medical Simulation Toolkit
imstkVRPNDeviceClient.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkDeviceClient.h"
10 
11 #include "vrpn_Tracker.h"
12 #include "vrpn_Analog.h"
13 #include "vrpn_Button.h"
14 #include "vrpn_ForceDevice.h"
15 
16 #include "imstkVRPNDeviceManager.h"
17 
18 namespace imstk
19 {
28 {
29 public:
33  VRPNDeviceClient(const std::string& deviceName, VRPNDeviceType type, const std::string& ip = "localhost");
34 
38  virtual ~VRPNDeviceClient() override = default;
39 
46  static void VRPN_CALLBACK trackerPositionChangeHandler(void* userData, const _vrpn_TRACKERCB t);
47 
54  static void VRPN_CALLBACK trackerVelocityChangeHandler(void* userData, const _vrpn_TRACKERVELCB v);
55 
62  static void VRPN_CALLBACK analogChangeHandler(void* userData, const _vrpn_ANALOGCB a);
63 
70  static void VRPN_CALLBACK buttonChangeHandler(void* userData, const _vrpn_BUTTONCB b);
71 
73  VRPNDeviceType getType() const;
74 
75 private:
76  VRPNDeviceType m_type;
77 };
78 } // namespace imstk
static void VRPN_CALLBACK trackerPositionChangeHandler(void *userData, const _vrpn_TRACKERCB t)
VRPN call back for position and orientation data.
The device client's represents the device and provides an interface to acquire data from a device...
static void VRPN_CALLBACK trackerVelocityChangeHandler(void *userData, const _vrpn_TRACKERVELCB v)
VRPN call back for velocity data.
virtual ~VRPNDeviceClient() override=default
Destructor.
Compound Geometry.
static void VRPN_CALLBACK buttonChangeHandler(void *userData, const _vrpn_BUTTONCB b)
VRPN call back for button changed (pressed or released)
VRPNDeviceClient(const std::string &deviceName, VRPNDeviceType type, const std::string &ip="localhost")
Constructor.
static void VRPN_CALLBACK analogChangeHandler(void *userData, const _vrpn_ANALOGCB a)
VRPN call back analog data.
VRPNDeviceType getType() const
This class is the receiver of the updates sent by the vrpn_server.