opensurgsim
PhantomDevice.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_PHANTOM_PHANTOMDEVICE_H
17 #define SURGSIM_DEVICES_PHANTOM_PHANTOMDEVICE_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 PhantomScaffold;
29 
30 SURGSIM_STATIC_REGISTRATION(PhantomDevice);
31 
59 {
60 public:
64  explicit PhantomDevice(const std::string& uniqueName);
65 
66  SURGSIM_CLASSNAME(SurgSim::Devices::PhantomDevice);
67 
69  virtual ~PhantomDevice();
70 
74  void setInitializationName(const std::string& initializationName);
75 
80  std::string getInitializationName() const;
81 
82  bool initialize() override;
83 
84  bool isInitialized() const override;
85 
86 private:
87  friend class PhantomScaffold;
88 
89  bool finalize() override;
90 
91  std::shared_ptr<PhantomScaffold> m_scaffold;
92  std::string m_initializationName;
93 };
94 
95 }; // namespace Devices
96 }; // namespace SurgSim
97 
98 #endif // SURGSIM_DEVICES_PHANTOM_PHANTOMDEVICE_H
bool isInitialized() const override
Definition: PhantomDevice.cpp:80
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
bool initialize() override
Fully initialize the device.
Definition: PhantomDevice.cpp:55
virtual ~PhantomDevice()
Destructor.
Definition: PhantomDevice.cpp:36
void setInitializationName(const std::string &initializationName)
Sets the name used to register this device with the hardware library.
Definition: PhantomDevice.cpp:44
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
PhantomDevice(const std::string &uniqueName)
Constructor.
Definition: PhantomDevice.cpp:28
std::string getInitializationName() const
Gets the name used by the Phantom device configuration to refer to this device.
Definition: PhantomDevice.cpp:49
A class that manages Sensable PHANTOM devices.
Definition: PhantomScaffold.h:38
A class implementing the communication with a SensAble/Geomagic PHANTOM device.
Definition: PhantomDevice.h:58