OculusScaffold.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 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_OCULUS_OCULUSSCAFFOLD_H
#define SURGSIM_DEVICES_OCULUS_OCULUSSCAFFOLD_H
#include <memory>
#include "SurgSim/DataStructures/DataGroup.h"
#include "SurgSim/Framework/BasicThread.h"
namespace SurgSim
{
namespace Framework
{
class Logger;
}
};
namespace SurgSim
{
namespace Devices
{
class OculusDevice;
class OculusScaffold : SurgSim::Framework::BasicThread
{
public:
~OculusScaffold();
protected:
bool doInitialize() override;
bool doStartUp() override;
bool doUpdate(double dt) override;
private:
struct StateData;
struct DeviceData;
friend class OculusDevice;
OculusScaffold();
static std::shared_ptr<OculusScaffold> getOrCreateSharedInstance();
bool registerDevice(OculusDevice* device);
bool doRegisterDevice(DeviceData* info);
bool unregisterDevice(const OculusDevice* device);
bool initializeSdk();
bool finalizeSdk();
static SurgSim::DataStructures::DataGroup buildDeviceInputData();
std::shared_ptr<SurgSim::Framework::Logger> m_logger;
std::unique_ptr<StateData> m_state;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_OCULUS_OCULUSSCAFFOLD_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
DataGroup.h
SurgSim::Devices::OculusScaffold
A class that manages Oculus Rift DK2 devices.
Definition: OculusScaffold.h:42
SurgSim::Devices::OculusScaffold::DeviceData
Definition: OculusScaffold.cpp:51
SurgSim::Devices::OculusScaffold::m_state
std::unique_ptr< StateData > m_state
Internal scaffold state.
Definition: OculusScaffold.h:100
SurgSim::Devices::OculusDevice
A class implementing the communication with Oculus Rift DK2.
Definition: OculusDevice.h:48
SurgSim::Devices::OculusScaffold::m_logger
std::shared_ptr< SurgSim::Framework::Logger > m_logger
Logger used by the scaffold and all devices.
Definition: OculusScaffold.h:97
SurgSim::Devices::OculusScaffold::StateData
Definition: OculusScaffold.cpp:81
SurgSim::DataStructures::DataGroup
A collection of NamedData objects.
Definition: DataGroup.h:68
SurgSim::Framework::BasicThread
Basic thread implementation, tries to maintain a constant rate, supplies startup an initialization...
Definition: BasicThread.h:48
BasicThread.h