MouseDevice.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_DEVICES_MOUSE_MOUSEDEVICE_H
#define SURGSIM_DEVICES_MOUSE_MOUSEDEVICE_H
#include "SurgSim/Input/CommonDevice.h"
#include <memory>
#include <string>
namespace SurgSim
{
namespace Devices
{
class MouseScaffold;
class OsgMouseHandler;
SURGSIM_STATIC_REGISTRATION(MouseDevice);
class MouseDevice : public SurgSim::Input::CommonDevice
{
friend class MouseScaffold;
friend class MouseDeviceTest;
public:
explicit MouseDevice(const std::string& deviceName);
SURGSIM_CLASSNAME(SurgSim::Devices::MouseDevice);
virtual ~MouseDevice();
bool initialize() override;
bool isInitialized() const override;
OsgMouseHandler* getMouseHandler() const;
private:
bool finalize() override;
std::shared_ptr<MouseScaffold> m_scaffold;
};
}; // namespace Devices
}; // namespace SurgSim
#endif //SURGSIM_DEVICES_MOUSE_MOUSEDEVICE_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::MouseDevice::~MouseDevice
virtual ~MouseDevice()
Destructor.
Definition: MouseDevice.cpp:33
SurgSim::Devices::MouseDevice::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Devices::MouseDevice)
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::finalize
bool finalize() override
Finalize (de-initialize) the device.
Definition: MouseDevice.cpp:55
SurgSim::Devices::MouseDevice::MouseDevice
MouseDevice(const std::string &deviceName)
Constructor.
Definition: MouseDevice.cpp:28
SurgSim::Devices::OsgMouseHandler
Definition: OsgMouseHandler.h:30
SurgSim::Devices::MouseDevice::initialize
bool initialize() override
Fully initialize the device.
Definition: MouseDevice.cpp:41
SurgSim::Devices::MouseDevice
A class implementing the communication with a mouse.
Definition: MouseDevice.h:52
SurgSim::Devices::MouseDevice::MouseDeviceTest
friend class MouseDeviceTest
Definition: MouseDevice.h:55
SurgSim::Devices::MouseDevice::getMouseHandler
OsgMouseHandler * getMouseHandler() const
Get mouse handler.
Definition: MouseDevice.cpp:68
SurgSim::Input::CommonDevice
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
SurgSim::Devices::MouseScaffold
A class that implements the behavior of MouseDevice objects.
Definition: MouseScaffold.h:38
CommonDevice.h
SurgSim::Devices::MouseDevice::isInitialized
bool isInitialized() const override
Definition: MouseDevice.cpp:63