opensurgsim
NimbleDevice.h
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_DEVICES_NIMBLE_NIMBLEDEVICE_H
17 #define SURGSIM_DEVICES_NIMBLE_NIMBLEDEVICE_H
18 
19 #include <memory>
20 #include <string>
21 
22 #include "SurgSim/Input/CommonDevice.h"
23 
24 namespace SurgSim
25 {
26 namespace Devices
27 {
28 class NimbleScaffold;
29 
30 SURGSIM_STATIC_REGISTRATION(NimbleDevice);
31 
58 {
59 public:
63  explicit NimbleDevice(const std::string& uniqueName);
64 
65  SURGSIM_CLASSNAME(SurgSim::Devices::NimbleDevice);
66 
68  virtual ~NimbleDevice();
69 
71  void setupToTrackLeftHand();
72 
74  void setupToTrackRightHand();
75 
76  bool initialize() override;
77 
78  bool isInitialized() const override;
79 
80 private:
81  friend class NimbleScaffold;
82 
83  bool finalize() override;
84 
86  std::shared_ptr<NimbleScaffold> m_scaffold;
87 
89  size_t m_trackedHandDataIndex;
90 };
91 
92 }; // namespace Devices
93 }; // namespace SurgSim
94 
95 #endif // SURGSIM_DEVICES_NIMBLE_NIMBLEDEVICE_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
A class that manages Nimble devices.
Definition: NimbleScaffold.h:36
A class implementing the communication with the Nimble server.
Definition: NimbleDevice.h:57
bool initialize() override
Fully initialize the device.
Definition: NimbleDevice.cpp:52
void setupToTrackRightHand()
Set the right hand to be tracked.
Definition: NimbleDevice.cpp:47
void setupToTrackLeftHand()
Set the left hand to be tracked.
Definition: NimbleDevice.cpp:42
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
NimbleDevice(const std::string &uniqueName)
Constructor.
Definition: NimbleDevice.cpp:29
bool isInitialized() const override
Definition: NimbleDevice.cpp:75
virtual ~NimbleDevice()
Destructor.
Definition: NimbleDevice.cpp:34