/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */ /* Author(s): Anton Deguet Created on: 2005-11-14 (C) Copyright 2005-2007 Johns Hopkins University (JHU), All Rights Reserved. --- begin cisst license - do not edit --- This software is provided "as is" under an open source license, with no warranty. The complete license can be found in license.txt and http://www.cisst.org/cisst/license.txt. --- end cisst license --- */ #include "vctAxisAngleRotation3Test.h" #include "vctGenericRotationTest.h" #include #include template void vctAxisAngleRotation3Test::TestDefaultConstructor(void) { vctAxisAngleRotation3<_elementType> axisAngleRotation; vctGenericRotationTest::TestDefaultConstructor(axisAngleRotation); } void vctAxisAngleRotation3Test::TestDefaultConstructorDouble(void) { TestDefaultConstructor(); } void vctAxisAngleRotation3Test::TestDefaultConstructorFloat(void) { TestDefaultConstructor(); } template void vctAxisAngleRotation3Test::TestNormalize(void) { vctAxisAngleRotation3<_elementType> defaultRotation; CPPUNIT_ASSERT(defaultRotation.IsNormalized()); vctAxisAngleRotation3<_elementType> normalizedRotation; normalizedRotation.NormalizedOf(defaultRotation); CPPUNIT_ASSERT(normalizedRotation.IsNormalized()); vctAxisAngleRotation3<_elementType> rotation1, rotation2; vctRandom(rotation1); CPPUNIT_ASSERT(rotation1.IsNormalized()); rotation2.Assign(rotation1); rotation2.Angle() += 2 * cmnPI; normalizedRotation.NormalizedOf(rotation2); CPPUNIT_ASSERT(rotation1.AlmostEqual(normalizedRotation)); rotation2.Assign(rotation1); rotation2.Angle() += 4 * cmnPI; normalizedRotation.NormalizedOf(rotation2); CPPUNIT_ASSERT(rotation1.AlmostEqual(normalizedRotation)); rotation2.Assign(rotation1); rotation2.Angle() -= 4 * cmnPI; normalizedRotation.NormalizedOf(rotation2); CPPUNIT_ASSERT(rotation1.AlmostEqual(normalizedRotation)); rotation2.Assign(rotation1); rotation2.Angle() -= 2 * cmnPI; normalizedRotation.NormalizedOf(rotation2); CPPUNIT_ASSERT(rotation1.AlmostEqual(normalizedRotation)); } void vctAxisAngleRotation3Test::TestNormalizeDouble(void) { TestNormalize(); } void vctAxisAngleRotation3Test::TestNormalizeFloat(void) { TestNormalize(); } template void vctAxisAngleRotation3Test::TestConversionQuaternion(void) { vctAxisAngleRotation3<_elementType> axisAngleRotation; vctQuaternionRotation3Base > quaternionRotation; vctRandom(axisAngleRotation); vctGenericRotationTest::TestConversion(axisAngleRotation, quaternionRotation); } void vctAxisAngleRotation3Test::TestConversionQuaternionDouble(void) { TestConversionQuaternion(); } void vctAxisAngleRotation3Test::TestConversionQuaternionFloat(void) { TestConversionQuaternion(); } template void vctAxisAngleRotation3Test::TestConversionMatrix(void) { vctAxisAngleRotation3<_elementType> axisAngleRotation; vctMatrixRotation3<_elementType> matrixRotation; vctRandom(axisAngleRotation); vctGenericRotationTest::TestConversion(axisAngleRotation, matrixRotation); } void vctAxisAngleRotation3Test::TestConversionMatrixDouble(void) { TestConversionMatrix(); } void vctAxisAngleRotation3Test::TestConversionMatrixFloat(void) { TestConversionMatrix(); } template void vctAxisAngleRotation3Test::TestConversionRodriguez(void) { vctAxisAngleRotation3<_elementType> axisAngleRotation; vctRodriguezRotation3<_elementType> rodriguezRotation; vctRandom(axisAngleRotation); vctGenericRotationTest::TestConversion(axisAngleRotation, rodriguezRotation); } void vctAxisAngleRotation3Test::TestConversionRodriguezDouble(void) { TestConversionRodriguez(); } void vctAxisAngleRotation3Test::TestConversionRodriguezFloat(void) { TestConversionRodriguez(); } template void vctAxisAngleRotation3Test::TestFromSignaturesQuaternion(void) { vctAxisAngleRotation3<_elementType> toRotation; vctQuaternionRotation3Base > fromRotationNormalized, fromRotationNotNormalized; vctRandom(fromRotationNormalized); vctRandom(fromRotationNotNormalized); fromRotationNotNormalized.Add(_elementType(1.0)); vctGenericRotationTest::TestFromSignatures(toRotation, fromRotationNormalized, fromRotationNotNormalized); } void vctAxisAngleRotation3Test::TestFromSignaturesQuaternionDouble(void) { TestFromSignaturesQuaternion(); } void vctAxisAngleRotation3Test::TestFromSignaturesQuaternionFloat(void) { TestFromSignaturesQuaternion(); } template void vctAxisAngleRotation3Test::TestFromSignaturesMatrix(void) { vctAxisAngleRotation3<_elementType> toRotation; vctMatrixRotation3Base > fromRotationNormalized, fromRotationNotNormalized; vctRandom(fromRotationNormalized); vctRandom(fromRotationNotNormalized); fromRotationNotNormalized.Add(_elementType(1.0)); vctGenericRotationTest::TestFromSignatures(toRotation, fromRotationNormalized, fromRotationNotNormalized); } void vctAxisAngleRotation3Test::TestFromSignaturesMatrixDouble(void) { TestFromSignaturesMatrix(); } void vctAxisAngleRotation3Test::TestFromSignaturesMatrixFloat(void) { TestFromSignaturesMatrix(); } template void vctAxisAngleRotation3Test::TestFromSignaturesRodriguez(void) { vctAxisAngleRotation3<_elementType> toRotation; vctRodriguezRotation3<_elementType> fromRotationNormalized, fromRotationNotNormalized; vctRandom(fromRotationNormalized); vctRandom(fromRotationNotNormalized); fromRotationNotNormalized.Add(_elementType(20.0)); vctGenericRotationTest::TestFromSignatures(toRotation, fromRotationNormalized, fromRotationNotNormalized, true); } void vctAxisAngleRotation3Test::TestFromSignaturesRodriguezDouble(void) { TestFromSignaturesRodriguez(); } void vctAxisAngleRotation3Test::TestFromSignaturesRodriguezFloat(void) { TestFromSignaturesRodriguez(); } template void vctAxisAngleRotation3Test::TestRandom(void) { vctAxisAngleRotation3<_elementType> axisAngleRotation; vctRandom(axisAngleRotation); vctGenericRotationTest::TestRandom(axisAngleRotation); } void vctAxisAngleRotation3Test::TestRandomDouble(void) { TestRandom(); } void vctAxisAngleRotation3Test::TestRandomFloat(void) { TestRandom(); } CPPUNIT_TEST_SUITE_REGISTRATION(vctAxisAngleRotation3Test);