iMSTK
Interactive Medical Simulation Toolkit
imstkHaplyDeviceManager.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 "imstkDeviceManager.h"
10 #include "imstkMacros.h"
11 
12 #include <vector>
13 
14 namespace imstk
15 {
16 class HaplyDeviceClient;
17 
25 {
26 public:
27  HaplyDeviceManager() = default;
28  ~HaplyDeviceManager() override = default;
29 
30  IMSTK_TYPE_NAME(HaplyDeviceManager)
31 
32 
33  std::shared_ptr<DeviceClient> makeDeviceClient(std::string portName = "") override { return makeDeviceClient(portName, ""); }
37 
43  std::shared_ptr<DeviceClient> makeDeviceClient(std::string portName, std::string handlePortName);
44 
48  static std::vector<std::string> getInverse3PortNames();
49 
53  static std::vector<std::string> getHandlePortNames();
54 
55  static bool isDevicePresent();
56 
57 protected:
58  bool initModule() override;
59 
60  void updateModule() override;
61 
62  void uninitModule() override;
63 
64 private:
65  friend HaplyDeviceClient;
66 
67  std::vector<std::shared_ptr<HaplyDeviceClient>> m_deviceClients;
68 };
69 } // namespace imstk
static std::vector< std::string > getInverse3PortNames()
Autodetect and get all Inverse3 device port names.
std::shared_ptr< DeviceClient > makeDeviceClient(std::string portName="") override
Create a haptic device client and add it to the internal list.
Subclass of DeviceClient for haply, currently implemented only for the Inverse3. Warning: This code i...
Compound Geometry.
Devices manager using Haply, only supports Inverse3 right now Warning: This code is based off an earl...
static std::vector< std::string > getHandlePortNames()
Autodetect and get all the Haply handle port names.
Abstract class for DeviceManagers which must return a DeviceClient for which it manages.