OculusDevice.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_OCULUSDEVICE_H
#define SURGSIM_DEVICES_OCULUS_OCULUSDEVICE_H
#include <memory>
#include <string>
#include "SurgSim/Input/CommonDevice.h"
namespace SurgSim
{
namespace Devices
{
class OculusScaffold;
SURGSIM_STATIC_REGISTRATION(OculusDevice);
class OculusDevice : public SurgSim::Input::CommonDevice
{
public:
explicit OculusDevice(const std::string& name);
SURGSIM_CLASSNAME(SurgSim::Devices::OculusDevice);
virtual ~OculusDevice();
bool initialize() override;
bool isInitialized() const override;
void setNearPlane(float nearPlane);
float getNearPlane() const;
void setFarPlane(float farPlane);
float getFarPlane() const;
private:
friend class OculusScaffold;
bool finalize() override;
float m_nearPlane;
float m_farPlane;
std::shared_ptr<OculusScaffold> m_scaffold;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_OCULUS_OCULUSDEVICE_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::OculusDevice::getFarPlane
float getFarPlane() const
Definition: OculusDevice.cpp:93
SurgSim::Devices::OculusScaffold
A class that manages Oculus Rift DK2 devices.
Definition: OculusScaffold.h:42
SurgSim::Devices::OculusDevice::setNearPlane
void setNearPlane(float nearPlane)
Set the near plane.
Definition: OculusDevice.cpp:72
SurgSim::Devices::OculusDevice::m_scaffold
std::shared_ptr< OculusScaffold > m_scaffold
Communication with hardware is handled by scaffold.
Definition: OculusDevice.h:90
SurgSim::Devices::OculusDevice::finalize
bool finalize() override
Finalize (de-initialize) the device.
Definition: OculusDevice.cpp:59
SurgSim::Devices::OculusDevice
A class implementing the communication with Oculus Rift DK2.
Definition: OculusDevice.h:48
SurgSim::Devices::OculusDevice::OculusDevice
OculusDevice(const std::string &name)
Constructor.
Definition: OculusDevice.cpp:28
SurgSim::Devices::OculusDevice::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Devices::OculusDevice)
SurgSim::Devices::OculusDevice::m_farPlane
float m_farPlane
Far Plane.
Definition: OculusDevice.h:87
SurgSim::Devices::OculusDevice::~OculusDevice
virtual ~OculusDevice()
Destructor.
Definition: OculusDevice.cpp:35
SurgSim::Devices::OculusDevice::isInitialized
bool isInitialized() const override
Definition: OculusDevice.cpp:67
SurgSim::Input::CommonDevice
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
SurgSim::Devices::OculusDevice::setFarPlane
void setFarPlane(float farPlane)
Set the far plane.
Definition: OculusDevice.cpp:85
CommonDevice.h
SurgSim::Devices::OculusDevice::m_nearPlane
float m_nearPlane
Near Plane.
Definition: OculusDevice.h:84
SurgSim::Devices::OculusDevice::getNearPlane
float getNearPlane() const
Definition: OculusDevice.cpp:80
SurgSim::Devices::OculusDevice::initialize
bool initialize() override
Fully initialize the device.
Definition: OculusDevice.cpp:44