Bug 487 - Transform concatenation fails with THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS
: Transform concatenation fails with THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORM...
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: Geometry
: 3.1
: All All
: Normal major
Assigned To: Nobody
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-07-03 14:04 UTC by Ferdinand Beyer
Modified: 2012-07-04 18:26 UTC (History)
3 users (show)



Attachments

Description Ferdinand Beyer 2012-07-03 14:04:06 UTC
The following code fails to compile because of the static assertion
THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS:

    Affine2f a = Translation2f(Vector2f(1, 1)) *
                 Rotation2Df(-0.5f) *
                 Scaling(2.0f);

Origin in Geometry/Transform.h, line 809:

Transform<Scalar,Dim,Mode,Options>&
Transform<Scalar,Dim,Mode,Options>::scale(Scalar s)
{
  EIGEN_STATIC_ASSERT(Mode!=int(Isometry),
THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)

I guess that (Translation * Rotation) yields a temporary isometry, and this
cannot be scaled.

My current workaround is to switch the order of rotation and scaling:

    Affine2f a = Translation2f(Vector2f(1, 1)) *
                 Scaling(2.0f) *
                 Rotation2Df(-0.5f);
Comment 1 Gael Guennebaud 2012-07-04 18:26:35 UTC
thank you for the report, fixed:

https://bitbucket.org/eigen/eigen/changeset/71230229983b/
changeset:   71230229983b
user:        ggael
date:        2012-07-04 18:25:07
summary:     fix bug 487: isometry * scaling was not compiling

https://bitbucket.org/eigen/eigen/changeset/20f06227c1d4/
changeset:   20f06227c1d4
branch:      3.1

Note You need to log in before you can comment on or make changes to this bug.