Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 2D transformation tests in debug #533

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions utest/ui/Transformations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ TEST(Transformation, ComputePureTranslationDataPoints2D)
const Eigen::Rotation2D<NumericType> rotation{ 0 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure translation.
{
const Eigen::Matrix<NumericType, 2, 1> translation{ -1.0001, 34.5 };
const Eigen::Rotation2D<NumericType> rotation{ 0 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
}

Expand Down Expand Up @@ -230,31 +230,31 @@ TEST(Transformation, ComputeRigidTransformDataPoints2D)
const Eigen::Rotation2D<NumericType> rotation{ 0 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure translation.
{
const Eigen::Matrix<NumericType, 2, 1> translation{ -1.0001, 34.5 };
const Eigen::Rotation2D<NumericType> rotation{ 0 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure rotation.
{
const Eigen::Matrix<NumericType, 2, 1> translation{ 0, 0 };
const Eigen::Rotation2D<NumericType> rotation{ 3.53453 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Translation + rotation.
{
const Eigen::Matrix<NumericType, 2, 1> translation{ -3.11, 100.222 };
const Eigen::Rotation2D<NumericType> rotation{ -123.3 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
}

Expand Down Expand Up @@ -310,7 +310,7 @@ TEST(Transformation, ComputeSimilarityTransformDataPoints2D)
const NumericType scale{ 1.0 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure Upscaling.
{
Expand All @@ -319,7 +319,7 @@ TEST(Transformation, ComputeSimilarityTransformDataPoints2D)
const NumericType scale{ 5.0 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure Downscaling.
{
Expand All @@ -328,7 +328,7 @@ TEST(Transformation, ComputeSimilarityTransformDataPoints2D)
const NumericType scale{ 0.1 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure translation + Downscaling.
{
Expand All @@ -337,7 +337,7 @@ TEST(Transformation, ComputeSimilarityTransformDataPoints2D)
const NumericType scale{ 0.5 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Pure rotation + Upscaling.
{
Expand All @@ -346,7 +346,7 @@ TEST(Transformation, ComputeSimilarityTransformDataPoints2D)
const NumericType scale{ 1.9 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
// Translation + rotation + Upscaling.
{
Expand All @@ -355,7 +355,7 @@ TEST(Transformation, ComputeSimilarityTransformDataPoints2D)
const NumericType scale{ 1.9 };
const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
// Transform and assert on the result.
assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
}
}

Expand Down