opensurgsim
KeyboardDevice.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_KEYBOARD_KEYBOARDDEVICE_H
17 #define SURGSIM_DEVICES_KEYBOARD_KEYBOARDDEVICE_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 KeyboardScaffold;
29 class OsgKeyboardHandler;
30 
31 SURGSIM_STATIC_REGISTRATION(KeyboardDevice);
32 
47 {
48  friend class KeyboardScaffold;
49  friend class KeyboardDeviceTest;
50 
51 public:
54  explicit KeyboardDevice(const std::string& deviceName);
55 
56  SURGSIM_CLASSNAME(SurgSim::Devices::KeyboardDevice);
57 
59  virtual ~KeyboardDevice();
60 
61  bool initialize() override;
62 
63  bool isInitialized() const override;
64 
68 
69 private:
70  bool finalize() override;
71 
73  std::shared_ptr<KeyboardScaffold> m_scaffold;
74 };
75 
76 }; // namespace Devices
77 }; // namespace SurgSim
78 
79 #endif //SURGSIM_DEVICES_KEYBOARD_KEYBOARDDEVICE_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
bool isInitialized() const override
Definition: KeyboardDevice.cpp:64
OsgKeyboardHandler * getKeyboardHandler() const
Get keyboard handler.
Definition: KeyboardDevice.cpp:69
bool initialize() override
Fully initialize the device.
Definition: KeyboardDevice.cpp:42
A class implementing the communication with a keyboard.
Definition: KeyboardDevice.h:46
A class that implements the behavior of KeyboardDevice objects.
Definition: KeyboardScaffold.h:38
virtual ~KeyboardDevice()
Destructor.
Definition: KeyboardDevice.cpp:34
Definition: OsgKeyboardHandler.h:30
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
Definition: KeyboardDeviceTest.cpp:35
KeyboardDevice(const std::string &deviceName)
Constructor.
Definition: KeyboardDevice.cpp:29