MouseScaffold.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_MOUSESCAFFOLD_H
#define SURGSIM_DEVICES_MOUSE_MOUSESCAFFOLD_H
#include <memory>
#include "SurgSim/Framework/Logger.h"
namespace SurgSim
{
namespace DataStructures
{
class DataGroup;
}
namespace Devices
{
class MouseDevice;
class OsgMouseHandler;
class MouseScaffold
{
friend class MouseDevice;
friend class MouseDeviceTest;
friend class OsgMouseHandler;
public:
MouseScaffold();
~MouseScaffold();
static std::shared_ptr<MouseScaffold> getOrCreateSharedInstance();
private:
struct DeviceData;
bool registerDevice(MouseDevice* device);
bool unregisterDevice();
bool updateDevice(int buttons, float x, float y, int scrollDeltaX, int scrollDeltaY);
OsgMouseHandler* getMouseHandler() const;
static SurgSim::DataStructures::DataGroup buildDeviceInputData();
std::shared_ptr<SurgSim::Framework::Logger> m_logger;
std::unique_ptr<DeviceData> m_device;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_MOUSE_MOUSESCAFFOLD_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::MouseScaffold::m_device
std::unique_ptr< DeviceData > m_device
The mouse device managed by this scaffold.
Definition: MouseScaffold.h:90
SurgSim::Devices::OsgMouseHandler
Definition: OsgMouseHandler.h:30
SurgSim::Devices::MouseScaffold::m_logger
std::shared_ptr< SurgSim::Framework::Logger > m_logger
Logger used by the scaffold and all devices.
Definition: MouseScaffold.h:88
SurgSim::Devices::MouseDevice
A class implementing the communication with a mouse.
Definition: MouseDevice.h:52
SurgSim::DataStructures::DataGroup
A collection of NamedData objects.
Definition: DataGroup.h:68
Logger.h
SurgSim::Devices::MouseScaffold
A class that implements the behavior of MouseDevice objects.
Definition: MouseScaffold.h:38
SurgSim::Devices::MouseScaffold::DeviceData
Struct to hold a MouseDevice object, a OsgMouseHandler, and a mutex for data passing.
Definition: MouseScaffold.cpp:34