opensurgsim
PoseComponent.h
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, 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_FRAMEWORK_POSECOMPONENT_H
17 #define SURGSIM_FRAMEWORK_POSECOMPONENT_H
18 
19 #include <memory>
20 
21 #include "SurgSim/Framework/Component.h"
22 #include "SurgSim/Framework/Macros.h"
24 
25 namespace SurgSim
26 {
27 
28 namespace Framework
29 {
30 SURGSIM_STATIC_REGISTRATION(PoseComponent);
31 
34 class PoseComponent : public Component
35 {
36 public:
39  explicit PoseComponent(const std::string& name);
40 
41  SURGSIM_CLASSNAME(SurgSim::Framework::PoseComponent);
42 
45  void setPose(const SurgSim::Math::RigidTransform3d& pose);
46 
50 
51 protected:
56  std::shared_ptr<PoseComponent> getPoseComponent() override;
57 
62  std::shared_ptr<const PoseComponent> getPoseComponent() const override;
63 
64 private:
65  bool doInitialize() override;
66  bool doWakeUp() override;
67 
69 };
70 
71 }; // namespace Framework
72 }; // namespace SurgSim
73 
74 #endif // SURGSIM_FRAMEWORK_POSECOMPONENT_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
std::shared_ptr< PoseComponent > getPoseComponent() override
Get the PoseComponent for this component A PoseComponent cannot have a PoseComponent, so this will return nullptr.
Definition: PoseComponent.cpp:46
void setPose(const SurgSim::Math::RigidTransform3d &pose)
Set the Pose of the PoseComponent.
Definition: PoseComponent.cpp:31
Component is the main interface class to pass information to the system managers each will decide whe...
Definition: Component.h:42
The PoseComponent holds a pose.
Definition: PoseComponent.h:34
PoseComponent(const std::string &name)
Constructor.
Definition: PoseComponent.cpp:26
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
const SurgSim::Math::RigidTransform3d & getPose() const
Get the pose of the PoseComponent.
Definition: PoseComponent.cpp:36