opensurgsim
ReplayPoseDevice.h
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 
22 #include "SurgSim/Input/CommonDevice.h"
23 
24 namespace SurgSim
25 {
26 namespace Devices
27 {
28 
29 class ReplayPoseScaffold;
30 
31 SURGSIM_STATIC_REGISTRATION(ReplayPoseDevice);
32 
47 {
48 public:
51  explicit ReplayPoseDevice(const std::string& uniqueName);
52 
54  const std::string getFileName() const;
55 
57  void setFileName(const std::string& fileName);
58 
60  double getRate() const;
61 
64  void setRate(double rate);
65 
66  SURGSIM_CLASSNAME(SurgSim::Devices::ReplayPoseDevice);
67 
68  virtual ~ReplayPoseDevice();
69 
70  bool initialize() override;
71 
72  bool isInitialized() const override;
73 
74 private:
75  friend class ReplayPoseScaffold;
76 
77  bool finalize() override;
78 
79  std::shared_ptr<ReplayPoseScaffold> m_scaffold;
80 
82  std::string m_fileName;
83 
86  double m_rate;
87 };
88 
89 }; // namespace Devices
90 }; // namespace SurgSim
91 
92 #endif // SURGSIM_DEVICES_REPLAYPOSEDEVICE_REPLAYPOSEDEVICE_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
void setRate(double rate)
Definition: ReplayPoseDevice.cpp:61
void setFileName(const std::string &fileName)
Definition: ReplayPoseDevice.cpp:50
const std::string getFileName() const
Definition: ReplayPoseDevice.cpp:45
bool initialize() override
Fully initialize the device.
Definition: ReplayPoseDevice.cpp:67
ReplayPoseDevice(const std::string &uniqueName)
Constructor.
Definition: ReplayPoseDevice.cpp:28
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
Definition: ReplayPoseScaffold.h:34
A class implementing the replay pose device, which is a pretend device that replays a recorded motion...
Definition: ReplayPoseDevice.h:46
double getRate() const
Definition: ReplayPoseDevice.cpp:56
bool isInitialized() const override
Definition: ReplayPoseDevice.cpp:91