opensurgsim
MouseDevice.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_MOUSE_MOUSEDEVICE_H
17 #define SURGSIM_DEVICES_MOUSE_MOUSEDEVICE_H
18 
19 #include "SurgSim/Input/CommonDevice.h"
20 
21 #include <memory>
22 #include <string>
23 
24 namespace SurgSim
25 {
26 namespace Devices
27 {
28 class MouseScaffold;
29 class OsgMouseHandler;
30 
31 SURGSIM_STATIC_REGISTRATION(MouseDevice);
32 
53 {
54  friend class MouseScaffold;
55  friend class MouseDeviceTest;
56 
57 public:
60  explicit MouseDevice(const std::string& deviceName);
61 
62  SURGSIM_CLASSNAME(SurgSim::Devices::MouseDevice);
63 
65  virtual ~MouseDevice();
66 
67  bool initialize() override;
68 
69  bool isInitialized() const override;
70 
74 
75 private:
76  bool finalize() override;
77 
79  std::shared_ptr<MouseScaffold> m_scaffold;
80 };
81 
82 }; // namespace Devices
83 }; // namespace SurgSim
84 
85 #endif //SURGSIM_DEVICES_MOUSE_MOUSEDEVICE_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
virtual ~MouseDevice()
Destructor.
Definition: MouseDevice.cpp:33
MouseDevice(const std::string &deviceName)
Constructor.
Definition: MouseDevice.cpp:28
Definition: OsgMouseHandler.h:30
bool initialize() override
Fully initialize the device.
Definition: MouseDevice.cpp:41
A class implementing the communication with a mouse.
Definition: MouseDevice.h:52
OsgMouseHandler * getMouseHandler() const
Get mouse handler.
Definition: MouseDevice.cpp:68
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
A class that implements the behavior of MouseDevice objects.
Definition: MouseScaffold.h:38
Definition: MouseDeviceTest.cpp:35
bool isInitialized() const override
Definition: MouseDevice.cpp:63