KeyboardDevice.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_KEYBOARD_KEYBOARDDEVICE_H
#define SURGSIM_DEVICES_KEYBOARD_KEYBOARDDEVICE_H
#include <memory>
#include <string>
#include "SurgSim/Input/CommonDevice.h"
namespace SurgSim
{
namespace Devices
{
class KeyboardScaffold;
class OsgKeyboardHandler;
SURGSIM_STATIC_REGISTRATION(KeyboardDevice);
class KeyboardDevice : public SurgSim::Input::CommonDevice
{
friend class KeyboardScaffold;
friend class KeyboardDeviceTest;
public:
explicit KeyboardDevice(const std::string& deviceName);
SURGSIM_CLASSNAME(SurgSim::Devices::KeyboardDevice);
virtual ~KeyboardDevice();
bool initialize() override;
bool isInitialized() const override;
OsgKeyboardHandler* getKeyboardHandler() const;
private:
bool finalize() override;
std::shared_ptr<KeyboardScaffold> m_scaffold;
};
}; // namespace Devices
}; // namespace SurgSim
#endif //SURGSIM_DEVICES_KEYBOARD_KEYBOARDDEVICE_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::KeyboardDevice::finalize
bool finalize() override
Finalize (de-initialize) the device.
Definition: KeyboardDevice.cpp:56
SurgSim::Devices::KeyboardDevice::isInitialized
bool isInitialized() const override
Definition: KeyboardDevice.cpp:64
SurgSim::Devices::KeyboardDevice::getKeyboardHandler
OsgKeyboardHandler * getKeyboardHandler() const
Get keyboard handler.
Definition: KeyboardDevice.cpp:69
SurgSim::Devices::KeyboardDevice::initialize
bool initialize() override
Fully initialize the device.
Definition: KeyboardDevice.cpp:42
SurgSim::Devices::KeyboardDevice::m_scaffold
std::shared_ptr< KeyboardScaffold > m_scaffold
Communication with hardware is handled by scaffold.
Definition: KeyboardDevice.h:73
SurgSim::Devices::KeyboardDevice
A class implementing the communication with a keyboard.
Definition: KeyboardDevice.h:46
SurgSim::Devices::KeyboardScaffold
A class that implements the behavior of KeyboardDevice objects.
Definition: KeyboardScaffold.h:38
SurgSim::Devices::KeyboardDevice::~KeyboardDevice
virtual ~KeyboardDevice()
Destructor.
Definition: KeyboardDevice.cpp:34
SurgSim::Devices::OsgKeyboardHandler
Definition: OsgKeyboardHandler.h:30
SurgSim::Input::CommonDevice
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
CommonDevice.h
SurgSim::Devices::KeyboardDevice::KeyboardDevice
KeyboardDevice(const std::string &deviceName)
Constructor.
Definition: KeyboardDevice.cpp:29
SurgSim::Devices::KeyboardDevice::KeyboardDeviceTest
friend class KeyboardDeviceTest
Definition: KeyboardDevice.h:49
SurgSim::Devices::KeyboardDevice::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Devices::KeyboardDevice)