NimbleDevice.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_NIMBLE_NIMBLEDEVICE_H
#define SURGSIM_DEVICES_NIMBLE_NIMBLEDEVICE_H
#include <memory>
#include <string>
#include "SurgSim/Input/CommonDevice.h"
namespace SurgSim
{
namespace Devices
{
class NimbleScaffold;
SURGSIM_STATIC_REGISTRATION(NimbleDevice);
class NimbleDevice : public SurgSim::Input::CommonDevice
{
public:
explicit NimbleDevice(const std::string& uniqueName);
SURGSIM_CLASSNAME(SurgSim::Devices::NimbleDevice);
virtual ~NimbleDevice();
void setupToTrackLeftHand();
void setupToTrackRightHand();
bool initialize() override;
bool isInitialized() const override;
private:
friend class NimbleScaffold;
bool finalize() override;
std::shared_ptr<NimbleScaffold> m_scaffold;
size_t m_trackedHandDataIndex;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_NIMBLE_NIMBLEDEVICE_H
SurgSim::Devices::NimbleDevice::finalize
bool finalize() override
Finalize (de-initialize) the device.
Definition: NimbleDevice.cpp:67
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::NimbleScaffold
A class that manages Nimble devices.
Definition: NimbleScaffold.h:36
SurgSim::Devices::NimbleDevice
A class implementing the communication with the Nimble server.
Definition: NimbleDevice.h:57
SurgSim::Devices::NimbleDevice::initialize
bool initialize() override
Fully initialize the device.
Definition: NimbleDevice.cpp:52
SurgSim::Devices::NimbleDevice::setupToTrackRightHand
void setupToTrackRightHand()
Set the right hand to be tracked.
Definition: NimbleDevice.cpp:47
SurgSim::Devices::NimbleDevice::setupToTrackLeftHand
void setupToTrackLeftHand()
Set the left hand to be tracked.
Definition: NimbleDevice.cpp:42
SurgSim::Devices::NimbleDevice::m_scaffold
std::shared_ptr< NimbleScaffold > m_scaffold
The shared pointer to the NimbleScaffold.
Definition: NimbleDevice.h:86
SurgSim::Devices::NimbleDevice::m_trackedHandDataIndex
size_t m_trackedHandDataIndex
Indicate whether the hand tracked is left (0) or right (1).
Definition: NimbleDevice.h:89
SurgSim::Input::CommonDevice
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
CommonDevice.h
SurgSim::Devices::NimbleDevice::NimbleDevice
NimbleDevice(const std::string &uniqueName)
Constructor.
Definition: NimbleDevice.cpp:29
SurgSim::Devices::NimbleDevice::isInitialized
bool isInitialized() const override
Definition: NimbleDevice.cpp:75
SurgSim::Devices::NimbleDevice::~NimbleDevice
virtual ~NimbleDevice()
Destructor.
Definition: NimbleDevice.cpp:34
SurgSim::Devices::NimbleDevice::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Devices::NimbleDevice)