PoseComponent.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_FRAMEWORK_POSECOMPONENT_H
#define SURGSIM_FRAMEWORK_POSECOMPONENT_H
#include <memory>
#include "SurgSim/Framework/Component.h"
#include "SurgSim/Framework/Macros.h"
#include "SurgSim/Math/RigidTransform.h"
namespace SurgSim
{
namespace Framework
{
SURGSIM_STATIC_REGISTRATION(PoseComponent);
class PoseComponent : public Component
{
public:
explicit PoseComponent(const std::string& name);
SURGSIM_CLASSNAME(SurgSim::Framework::PoseComponent);
void setPose(const SurgSim::Math::RigidTransform3d& pose);
const SurgSim::Math::RigidTransform3d& getPose() const;
protected:
std::shared_ptr<PoseComponent> getPoseComponent() override;
std::shared_ptr<const PoseComponent> getPoseComponent() const override;
private:
bool doInitialize() override;
bool doWakeUp() override;
SurgSim::Math::RigidTransform3d m_pose;
};
}; // namespace Framework
}; // namespace SurgSim
#endif // SURGSIM_FRAMEWORK_POSECOMPONENT_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Framework::PoseComponent::getPoseComponent
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
SurgSim::Framework::PoseComponent::setPose
void setPose(const SurgSim::Math::RigidTransform3d &pose)
Set the Pose of the PoseComponent.
Definition: PoseComponent.cpp:31
Component.h
SurgSim::Framework::PoseComponent::doInitialize
bool doInitialize() override
Interface to be implemented by derived classes.
Definition: PoseComponent.cpp:51
SurgSim::Framework::Component
Component is the main interface class to pass information to the system managers each will decide whe...
Definition: Component.h:42
SurgSim::Framework::PoseComponent
The PoseComponent holds a pose.
Definition: PoseComponent.h:34
SurgSim::Framework::PoseComponent::PoseComponent
PoseComponent(const std::string &name)
Constructor.
Definition: PoseComponent.cpp:26
SurgSim::Framework::PoseComponent::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Framework::PoseComponent)
RigidTransform.h
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
Macros.h
SurgSim::Math::RigidTransform3d
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
SurgSim::Framework::PoseComponent::doWakeUp
bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: PoseComponent.cpp:56
SurgSim::Framework::PoseComponent::getPose
const SurgSim::Math::RigidTransform3d & getPose() const
Get the pose of the PoseComponent.
Definition: PoseComponent.cpp:36
SurgSim::Framework::PoseComponent::m_pose
SurgSim::Math::RigidTransform3d m_pose
Definition: PoseComponent.h:68