From 6b89ee0095b9012302d0871d2300e60422a62316 Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Thu, 29 Jul 2010 15:54:32 +0200 Subject: [PATCH] Transform is now per default Projective. Improved invert() in the Transform class. RotationBase offers matrix() to be conform with Transform's naming scheme. Added Translation::translation() to be conform with Transform's naming scheme. --- Eigen/src/Core/util/ForwardDeclarations.h | 2 +- Eigen/src/Geometry/RotationBase.h | 5 +++++ Eigen/src/Geometry/Transform.h | 5 ----- Eigen/src/Geometry/Translation.h | 3 +++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Eigen/src/Core/util/ForwardDeclarations.h b/Eigen/src/Core/util/ForwardDeclarations.h index ed4b8e6d9..423aa110e 100644 --- a/Eigen/src/Core/util/ForwardDeclarations.h +++ b/Eigen/src/Core/util/ForwardDeclarations.h @@ -180,7 +180,7 @@ template class QuaternionBase; template class Quaternion; template class Rotation2D; template class AngleAxis; -template class Transform; +template class Transform; template class ParametrizedLine; template class Hyperplane; template class Translation; diff --git a/Eigen/src/Geometry/RotationBase.h b/Eigen/src/Geometry/RotationBase.h index 5b6d10649..4f0eeca20 100644 --- a/Eigen/src/Geometry/RotationBase.h +++ b/Eigen/src/Geometry/RotationBase.h @@ -55,6 +55,11 @@ class RotationBase /** \returns an equivalent rotation matrix */ inline RotationMatrixType toRotationMatrix() const { return derived().toRotationMatrix(); } + /** \returns an equivalent rotation matrix + * This function is added to be conform with the Transform class' naming scheme. + */ + inline RotationMatrixType matrix() const { return derived().toRotationMatrix(); } + /** \returns the inverse rotation */ inline Derived inverse() const { return derived().inverse(); } diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index 70d172c10..68fda1323 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -954,11 +954,6 @@ Transform::inverse(TransformTraits hint) const // translation and remaining parts res.matrix().template topRightCorner() = - res.matrix().template topLeftCorner() * translation(); - if(int(Mode)!=int(AffineCompact)) - { - res.matrix().template block<1,Dim>(Dim,0).setZero(); - res.matrix().coeffRef(Dim,Dim) = 1; - } } return res; } diff --git a/Eigen/src/Geometry/Translation.h b/Eigen/src/Geometry/Translation.h index 8b8c9c25c..06db9956e 100644 --- a/Eigen/src/Geometry/Translation.h +++ b/Eigen/src/Geometry/Translation.h @@ -98,6 +98,9 @@ public: const VectorType& vector() const { return m_coeffs; } VectorType& vector() { return m_coeffs; } + const VectorType& translation() const { return m_coeffs; } + VectorType& translation() { return m_coeffs; } + /** Concatenates two translation */ inline Translation operator* (const Translation& other) const { return Translation(m_coeffs + other.m_coeffs); }