MouseDevice.h
Go to the documentation of this file.
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 
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 
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
SurgSim::Devices::MouseDevice::m_scaffold
std::shared_ptr< MouseScaffold > m_scaffold
Communication with hardware is handled by scaffold.
Definition: MouseDevice.h:79
SurgSim::Devices::MouseDevice::isInitialized
bool isInitialized() const override
Definition: MouseDevice.cpp:63
SurgSim::Devices::MouseDevice::MouseDeviceTest
friend class MouseDeviceTest
Definition: MouseDevice.h:55
SurgSim::Devices::MouseDevice::MouseDevice
MouseDevice(const std::string &deviceName)
Constructor.
Definition: MouseDevice.cpp:28
SurgSim::Devices::MouseDevice
A class implementing the communication with a mouse.
Definition: MouseDevice.h:52
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::OsgMouseHandler
Definition: OsgMouseHandler.h:30
SurgSim::Input::CommonDevice
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
SurgSim::Devices::MouseDevice::getMouseHandler
OsgMouseHandler * getMouseHandler() const
Get mouse handler.
Definition: MouseDevice.cpp:68
SurgSim::Devices::MouseScaffold
A class that implements the behavior of MouseDevice objects.
Definition: MouseScaffold.h:38
CommonDevice.h
SurgSim::Devices::MouseDevice::~MouseDevice
virtual ~MouseDevice()
Destructor.
Definition: MouseDevice.cpp:33
SurgSim::Devices::MouseDevice::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Devices::MouseDevice)
SurgSim::Devices::MouseDevice::finalize
bool finalize() override
Finalize (de-initialize) the device.
Definition: MouseDevice.cpp:55
MouseDevice
MouseDevice
Definition: CMakeLists.txt:35
string
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
SurgSim::Devices::MouseDevice::initialize
bool initialize() override
Fully initialize the device.
Definition: MouseDevice.cpp:41