ReplayPoseDevice.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013-2015, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_DEVICES_REPLAYPOSEDEVICE_REPLAYPOSEDEVICE_H
17 #define SURGSIM_DEVICES_REPLAYPOSEDEVICE_REPLAYPOSEDEVICE_H
18 
19 #include <memory>
20 #include <string>
21 
23 
24 namespace SurgSim
25 {
26 namespace Devices
27 {
28 
29 class ReplayPoseScaffold;
30 
31 SURGSIM_STATIC_REGISTRATION(ReplayPoseDevice);
32 
45 {
46 public:
49  explicit ReplayPoseDevice(const std::string& uniqueName);
50 
52  const std::string getFileName() const;
53 
55  void setFileName(const std::string& fileName);
56 
58  double getRate() const;
59 
62  void setRate(double rate);
63 
65 
66  virtual ~ReplayPoseDevice();
67 
68  bool initialize() override;
69 
70  bool isInitialized() const override;
71 
72 private:
73  friend class ReplayPoseScaffold;
74 
75  bool finalize() override;
76 
77  std::shared_ptr<ReplayPoseScaffold> m_scaffold;
78 
80  std::string m_fileName;
81 
84  double m_rate;
85 };
86 
87 }; // namespace Devices
88 }; // namespace SurgSim
89 
90 #endif // SURGSIM_DEVICES_REPLAYPOSEDEVICE_REPLAYPOSEDEVICE_H
SurgSim::Devices::ReplayPoseDevice::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Devices::ReplayPoseDevice)
SurgSim::Devices::ReplayPoseDevice::setFileName
void setFileName(const std::string &fileName)
Definition: ReplayPoseDevice.cpp:50
SurgSim::Devices::ReplayPoseDevice::m_scaffold
std::shared_ptr< ReplayPoseScaffold > m_scaffold
Definition: ReplayPoseDevice.h:77
SurgSim::Devices::ReplayPoseDevice::setRate
void setRate(double rate)
Definition: ReplayPoseDevice.cpp:61
SurgSim::Devices::ReplayPoseDevice::initialize
bool initialize() override
Fully initialize the device.
Definition: ReplayPoseDevice.cpp:67
SurgSim::Devices::ReplayPoseDevice::isInitialized
bool isInitialized() const override
Definition: ReplayPoseDevice.cpp:91
SurgSim::Devices::ReplayPoseDevice::m_rate
double m_rate
The rate to run the device at (i.e.
Definition: ReplayPoseDevice.h:84
SurgSim::Devices::ReplayPoseDevice
A class implementing the replay pose device, which is a pretend device that replays a recorded motion...
Definition: ReplayPoseDevice.h:44
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Input::CommonDevice
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
SurgSim::Devices::ReplayPoseDevice::~ReplayPoseDevice
virtual ~ReplayPoseDevice()
Definition: ReplayPoseDevice.cpp:37
SurgSim::Devices::ReplayPoseScaffold
Definition: ReplayPoseScaffold.h:34
SurgSim::Devices::ReplayPoseDevice::finalize
bool finalize() override
Finalize (de-initialize) the device.
Definition: ReplayPoseDevice.cpp:83
SurgSim::Devices::ReplayPoseDevice::getFileName
const std::string getFileName() const
Definition: ReplayPoseDevice.cpp:45
CommonDevice.h
SurgSim::Devices::ReplayPoseDevice::m_fileName
std::string m_fileName
The filename to read the input transform from.
Definition: ReplayPoseDevice.h:80
SurgSim::Devices::ReplayPoseDevice::getRate
double getRate() const
Definition: ReplayPoseDevice.cpp:56
SurgSim::Devices::ReplayPoseDevice::ReplayPoseDevice
ReplayPoseDevice(const std::string &uniqueName)
Constructor.
Definition: ReplayPoseDevice.cpp:28