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 Device
27 {
28 
29 class MouseScaffold;
30 class OsgMouseHandler;
31 
52 {
53  friend class MouseScaffold;
54  friend class MouseDeviceTest;
55 
56 public:
59  explicit MouseDevice(const std::string& deviceName);
61  virtual ~MouseDevice();
62 
65  virtual bool initialize() override;
68  virtual bool finalize() override;
69 
72  bool isInitialized() const;
73 
77 
78 private:
80  std::shared_ptr<MouseScaffold> m_scaffold;
81 };
82 
83 }; // namespace Device
84 }; // namespace SurgSim
85 
86 #endif //SURGSIM_DEVICES_MOUSE_MOUSEDEVICE_H
Definition: DriveElementFromInputBehavior.cpp:27
A class implementing the communication with a mouse.
Definition: MouseDevice.h:51
A class that implements the behavior of MouseDevice objects.
Definition: MouseScaffold.h:38
Definition: OsgMouseHandler.h:30
OsgMouseHandler * getMouseHandler() const
Get mouse handler.
Definition: MouseDevice.cpp:65
std::shared_ptr< MouseScaffold > m_scaffold
Communication with hardware is handled by scaffold.
Definition: MouseDevice.h:80
virtual bool initialize() override
Initialize corresponding MouseScaffold.
Definition: MouseDevice.cpp:39
bool isInitialized() const
Check if the scaffold of this device is initialized.
Definition: MouseDevice.cpp:60
friend class MouseDeviceTest
Definition: MouseDevice.h:54
virtual bool finalize() override
"De"-initialize corresponding MouseScaffold.
Definition: MouseDevice.cpp:52
virtual ~MouseDevice()
Destructor.
Definition: MouseDevice.cpp:31
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:34
MouseDevice(const std::string &deviceName)
Constructor.
Definition: MouseDevice.cpp:26