From 8eab0bccbf8b1969f32bb006b61d2137f6f37ead Mon Sep 17 00:00:00 2001 From: Anthony Truchet Date: Thu, 30 Jul 2009 10:09:41 +0200 Subject: [PATCH] Bugfix in the Qt's QTransform and QMatrix support in Geometry/Transform.h Function 'Transform::toQMatrix(void) const' : - 'other' was a hasty copy/paste to be replaced my m_matrix - 'coeffRef' was incorect for const Transform Function 'Transform::toQTransform(void) const' : - return type was incorrect 'QMatrix' to be replaced by 'QTransform' - same bigfixes as in the previous point --- Eigen/src/Geometry/Transform.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index a796ba792..cc1b3c49a 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -335,9 +335,9 @@ template QMatrix Transform::toQMatrix(void) const { EIGEN_STATIC_ASSERT(Dim==2, YOU_MADE_A_PROGRAMMING_MISTAKE) - return QMatrix(other.coeffRef(0,0), other.coeffRef(1,0), - other.coeffRef(0,1), other.coeffRef(1,1), - other.coeffRef(0,2), other.coeffRef(1,2)); + return QMatrix(m_matrix.coeff(0,0), m_matrix.coeff(1,0), + m_matrix.coeff(0,1), m_matrix.coeff(1,1), + m_matrix.coeff(0,2), m_matrix.coeff(1,2)); } /** Initialises \c *this from a QTransform assuming the dimension is 2. @@ -369,12 +369,12 @@ Transform& Transform::operator=(const QTransform& other) * This function is available only if the token EIGEN_QT_SUPPORT is defined. */ template -QMatrix Transform::toQTransform(void) const +QTransform Transform::toQTransform(void) const { EIGEN_STATIC_ASSERT(Dim==2, YOU_MADE_A_PROGRAMMING_MISTAKE) - return QTransform(other.coeffRef(0,0), other.coeffRef(1,0), other.coeffRef(2,0) - other.coeffRef(0,1), other.coeffRef(1,1), other.coeffRef(2,1) - other.coeffRef(0,2), other.coeffRef(1,2), other.coeffRef(2,2); + return QTransform(m_matrix.coeff(0,0), m_matrix.coeff(1,0), m_matrix.coeff(2,0), + m_matrix.coeff(0,1), m_matrix.coeff(1,1), m_matrix.coeff(2,1), + m_matrix.coeff(0,2), m_matrix.coeff(1,2), m_matrix.coeff(2,2)); } #endif