9 #include "imstkDeviceManager.h" 10 #include "imstkDeviceClient.h" 15 #include <vrpn_Connection.h> 16 #include <vrpn_MainloopContainer.h> 22 class VRPNDeviceClient;
24 using VRPNDeviceType = int;
25 const VRPNDeviceType VRPNAnalog = 0x1;
26 const VRPNDeviceType VRPNButton = 0x2;
27 const VRPNDeviceType VRPNTracker = 0x4;
28 const VRPNDeviceType VRPNForce = 0x8;
51 VRPNDeviceManager(
const std::string& machine =
"localhost",
int port = vrpn_DEFAULT_LISTEN_PORT_NO);
57 void addDeviceClient(std::shared_ptr<VRPNDeviceClient> client);
67 std::shared_ptr<DeviceClient>
makeDeviceClient(
const std::string& deviceName, VRPNDeviceType deviceType);
68 std::shared_ptr<DeviceClient>
makeDeviceClient(
const std::string deviceName)
override;
88 const std::string m_machine =
"localhost";
89 const int m_port = vrpn_DEFAULT_LISTEN_PORT_NO;
93 std::shared_ptr<VRPNDeviceClient> client;
97 std::map<VRPNDeviceType, std::vector<std::shared_ptr<VRPNDeviceClient>>> m_deviceMap;
98 std::unique_ptr<vrpn_MainloopContainer> m_deviceConnections;
void updateModule() override
Run the server module.
connects to the vrpn.exe server and lets iMSTK attach devices to the server
std::shared_ptr< DeviceClient > makeDeviceClient(const std::string &deviceName, VRPNDeviceType deviceType)
Creates a client from the given parameters.
VRPNDeviceManager(const std::string &machine="localhost", int port=vrpn_DEFAULT_LISTEN_PORT_NO)
Constructor.
void uninitModule() override
Clean the server module.
Abstract class for DeviceManagers which must return a DeviceClient for which it manages.
bool initModule() override
Initialize the server module.