LeapScaffold.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013-2015, 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_LEAP_LEAPSCAFFOLD_H
#define SURGSIM_DEVICES_LEAP_LEAPSCAFFOLD_H
#include <memory>
#include "SurgSim/DataStructures/DataGroup.h"
#include "SurgSim/Devices/Leap/LeapDevice.h"
namespace SurgSim
{
namespace Framework
{
class Logger;
};
namespace Devices
{
class LeapDevice;
class LeapScaffold
{
public:
virtual ~LeapScaffold();
private:
struct StateData;
struct DeviceData;
class Listener;
friend class LeapDevice;
LeapScaffold();
static std::shared_ptr<LeapScaffold> getOrCreateSharedInstance();
bool registerDevice(LeapDevice* device);
bool unregisterDevice(const LeapDevice* device);
bool doRegisterDevice(DeviceData* info);
void handleFrame();
void handleConnect();
void updateHandData();
void updateImageData();
static DataStructures::DataGroup buildDeviceInputData();
std::unique_ptr<StateData> m_state;
void setUseHmdTrackingMode(bool useHmdTrackingMode);
bool isUsingHmdTrackingMode() const;
std::shared_ptr<Framework::Logger> m_logger;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_LEAP_LEAPSCAFFOLD_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
DataGroup.h
SurgSim::Devices::LeapScaffold::StateData
Definition: LeapScaffold.cpp:136
LeapDevice.h
SurgSim::Devices::LeapDevice
A class implementing the communication with one hand tracked by Leap Motion camera.
Definition: LeapDevice.h:65
SurgSim::Devices::LeapScaffold
A class that manages Leap devices.
Definition: LeapScaffold.h:41
SurgSim::DataStructures::DataGroup
A collection of NamedData objects.
Definition: DataGroup.h:68
SurgSim::Devices::LeapScaffold::Listener
Definition: LeapScaffold.cpp:83
SurgSim::Devices::LeapScaffold::DeviceData
Definition: LeapScaffold.cpp:121
SurgSim::Devices::LeapScaffold::m_logger
std::shared_ptr< Framework::Logger > m_logger
Logger used by the scaffold.
Definition: LeapScaffold.h:109
SurgSim::Devices::LeapScaffold::m_state
std::unique_ptr< StateData > m_state
Internal scaffold state.
Definition: LeapScaffold.h:98