ReplayPoseDevice.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_REPLAYPOSEDEVICE_REPLAYPOSEDEVICE_H
#define SURGSIM_DEVICES_REPLAYPOSEDEVICE_REPLAYPOSEDEVICE_H
#include <memory>
#include <string>
#include "SurgSim/Input/CommonDevice.h"
namespace SurgSim
{
namespace Devices
{
class ReplayPoseScaffold;
SURGSIM_STATIC_REGISTRATION(ReplayPoseDevice);
class ReplayPoseDevice : public SurgSim::Input::CommonDevice
{
public:
explicit ReplayPoseDevice(const std::string& uniqueName);
const std::string getFileName() const;
void setFileName(const std::string& fileName);
double getRate() const;
void setRate(double rate);
SURGSIM_CLASSNAME(SurgSim::Devices::ReplayPoseDevice);
virtual ~ReplayPoseDevice();
bool initialize() override;
bool isInitialized() const override;
private:
friend class ReplayPoseScaffold;
bool finalize() override;
std::shared_ptr<ReplayPoseScaffold> m_scaffold;
std::string m_fileName;
double m_rate;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_REPLAYPOSEDEVICE_REPLAYPOSEDEVICE_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::ReplayPoseDevice::finalize
bool finalize() override
Finalize (de-initialize) the device.
Definition: ReplayPoseDevice.cpp:83
SurgSim::Devices::ReplayPoseDevice::setRate
void setRate(double rate)
Definition: ReplayPoseDevice.cpp:61
SurgSim::Devices::ReplayPoseDevice::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Devices::ReplayPoseDevice)
SurgSim::Devices::ReplayPoseDevice::~ReplayPoseDevice
virtual ~ReplayPoseDevice()
Definition: ReplayPoseDevice.cpp:37
SurgSim::Devices::ReplayPoseDevice::m_fileName
std::string m_fileName
The filename to read the input transform from.
Definition: ReplayPoseDevice.h:80
SurgSim::Devices::ReplayPoseDevice::setFileName
void setFileName(const std::string &fileName)
Definition: ReplayPoseDevice.cpp:50
SurgSim::Devices::ReplayPoseDevice::getFileName
const std::string getFileName() const
Definition: ReplayPoseDevice.cpp:45
SurgSim::Devices::ReplayPoseDevice::initialize
bool initialize() override
Fully initialize the device.
Definition: ReplayPoseDevice.cpp:67
SurgSim::Devices::ReplayPoseDevice::ReplayPoseDevice
ReplayPoseDevice(const std::string &uniqueName)
Constructor.
Definition: ReplayPoseDevice.cpp:28
SurgSim::Input::CommonDevice
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
SurgSim::Devices::ReplayPoseScaffold
Definition: ReplayPoseScaffold.h:34
SurgSim::Devices::ReplayPoseDevice
A class implementing the replay pose device, which is a pretend device that replays a recorded motion...
Definition: ReplayPoseDevice.h:44
CommonDevice.h
SurgSim::Devices::ReplayPoseDevice::getRate
double getRate() const
Definition: ReplayPoseDevice.cpp:56
SurgSim::Devices::ReplayPoseDevice::m_rate
double m_rate
The rate to run the device at (i.e.
Definition: ReplayPoseDevice.h:84
SurgSim::Devices::ReplayPoseDevice::isInitialized
bool isInitialized() const override
Definition: ReplayPoseDevice.cpp:91
SurgSim::Devices::ReplayPoseDevice::m_scaffold
std::shared_ptr< ReplayPoseScaffold > m_scaffold
Definition: ReplayPoseDevice.h:77