PoseTransform.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_DEVICEFILTERS_POSETRANSFORM_H
17 #define SURGSIM_DEVICES_DEVICEFILTERS_POSETRANSFORM_H
18 
19 #include <boost/thread/mutex.hpp>
20 #include <memory>
21 #include <string>
22 
26 #include "SurgSim/Math/Vector.h"
27 
28 namespace SurgSim
29 {
30 namespace Devices
31 {
32 
33 SURGSIM_STATIC_REGISTRATION(PoseTransform);
34 
54 {
55 public:
58  explicit PoseTransform(const std::string& name);
59 
61 
63  double getTranslationScale() const;
64 
69  void setTranslationScale(double translationScale);
70 
72  const Math::RigidTransform3d& getTransform() const;
73 
78  void setTransform(const Math::RigidTransform3d& transform);
79 
80 private:
81  void filterInput(const std::string& device, const DataStructures::DataGroup& dataToFilter,
82  DataStructures::DataGroup* result) override;
83 
84  void filterOutput(const std::string& device, const DataStructures::DataGroup& dataToFilter,
85  DataStructures::DataGroup* result) override;
86 
88  boost::mutex m_mutex;
89 
92 
95 
98 };
99 
100 }; // namespace Devices
101 }; // namespace SurgSim
102 
103 #endif // SURGSIM_DEVICES_DEVICEFILTERS_POSETRANSFORM_H
SurgSim::Devices::PoseTransform::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Devices::PoseTransform)
Vector.h
SurgSim::Devices::PoseTransform::getTranslationScale
double getTranslationScale() const
Definition: PoseTransform.cpp:172
SurgSim::Math::RigidTransform3d
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
SurgSim::Devices::PoseTransform::setTranslationScale
void setTranslationScale(double translationScale)
Set the translation scale factor so that each direction has the same scale.
Definition: PoseTransform.cpp:177
SurgSim::Devices::PoseTransform::filterInput
void filterInput(const std::string &device, const DataStructures::DataGroup &dataToFilter, DataStructures::DataGroup *result) override
Filter the input data.
Definition: PoseTransform.cpp:45
SurgSim::Devices::DeviceFilter
A device filter can be connected between a device and the InputConsumerInterface (e....
Definition: DeviceFilter.h:37
SurgSim::Devices::PoseTransform::m_mutex
boost::mutex m_mutex
The mutex that protects the transform and scaling factor.
Definition: PoseTransform.h:88
SurgSim::Devices::PoseTransform::setTransform
void setTransform(const Math::RigidTransform3d &transform)
Set the constant transform.
Definition: PoseTransform.cpp:188
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::DataStructures::DataGroup
A collection of NamedData objects.
Definition: DataGroup.h:68
SurgSim::Devices::PoseTransform::m_transformInverse
Math::RigidTransform3d m_transformInverse
The inverse of the pre-transform.
Definition: PoseTransform.h:94
RigidTransform.h
SurgSim::Devices::PoseTransform::PoseTransform
PoseTransform(const std::string &name)
Constructor.
Definition: PoseTransform.cpp:34
SurgSim::Devices::PoseTransform::getTransform
const Math::RigidTransform3d & getTransform() const
Definition: PoseTransform.cpp:183
SurgSim::Devices::PoseTransform::filterOutput
void filterOutput(const std::string &device, const DataStructures::DataGroup &dataToFilter, DataStructures::DataGroup *result) override
Filter the output data.
Definition: PoseTransform.cpp:77
DataGroup.h
SurgSim::Devices::PoseTransform::m_transform
Math::RigidTransform3d m_transform
The constant pre-transform.
Definition: PoseTransform.h:91
SurgSim::Devices::PoseTransform::m_translationScale
double m_translationScale
The scaling factor applied to each direction of the translation.
Definition: PoseTransform.h:97
string
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
DeviceFilter.h
SurgSim::Devices::PoseTransform
A device filter that transforms the input pose.
Definition: PoseTransform.h:53