- Timestamp:
- Apr 28, 2021, 10:02:49 PM (4 years ago)
- Branches:
- Candidate_v1.7.0, stable
- Children:
- e0e77e
- Parents:
- 87c1cc
- git-author:
- Frederik Heber <frederik.heber@…> (04/17/21 09:41:33)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/28/21 22:02:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp
r87c1cc r2390e6 748 748 expected += Vector(-1.,0.,0.); 749 749 SphericalPointDistribution::Polygon_t remaining = 750 SPD.getRemainingPoints(polygon, 2 );750 SPD.getRemainingPoints(polygon, 2, 2); 751 751 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 752 752 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 760 760 expected += Vector(0.,-1.,0.); 761 761 SphericalPointDistribution::Polygon_t remaining = 762 SPD.getRemainingPoints(polygon, 2 );762 SPD.getRemainingPoints(polygon, 2, 2); 763 763 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 764 764 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 772 772 expected += Vector(0.,0.,1.); 773 773 SphericalPointDistribution::Polygon_t remaining = 774 SPD.getRemainingPoints(polygon, 2 );774 SPD.getRemainingPoints(polygon, 2, 2); 775 775 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 776 776 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 785 785 expected += RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI); 786 786 SphericalPointDistribution::Polygon_t remaining = 787 SPD.getRemainingPoints(polygon, 2 );787 SPD.getRemainingPoints(polygon, 2, 2); 788 788 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 789 789 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 805 805 expected.pop_front(); // remove first point 806 806 SphericalPointDistribution::Polygon_t remaining = 807 SPD.getRemainingPoints(polygon, 3 );807 SPD.getRemainingPoints(polygon, 3, 3); 808 808 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 809 809 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 823 823 } 824 824 SphericalPointDistribution::Polygon_t remaining = 825 SPD.getRemainingPoints(polygon, 3 );825 SPD.getRemainingPoints(polygon, 3, 3); 826 826 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 827 827 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 838 838 expected.pop_front(); // remove second point 839 839 SphericalPointDistribution::Polygon_t remaining = 840 SPD.getRemainingPoints(polygon, 3 );840 SPD.getRemainingPoints(polygon, 3, 3); 841 841 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 842 842 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 861 861 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 862 862 SphericalPointDistribution::Polygon_t remaining = 863 SPD.getRemainingPoints(polygon, 3 );863 SPD.getRemainingPoints(polygon, 3, 3); 864 864 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 865 865 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 880 880 SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant 881 881 SphericalPointDistribution::Polygon_t remaining = 882 SPD.getRemainingPoints(polygon, 3 );882 SPD.getRemainingPoints(polygon, 3, 3); 883 883 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 884 884 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 901 901 SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant 902 902 SphericalPointDistribution::Polygon_t remaining = 903 SPD.getRemainingPoints(polygon, 3 );903 SPD.getRemainingPoints(polygon, 3, 3); 904 904 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 905 905 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 925 925 expected.pop_front(); // remove first point 926 926 SphericalPointDistribution::Polygon_t remaining = 927 SPD.getRemainingPoints(polygon, 4 );927 SPD.getRemainingPoints(polygon, 4, 4); 928 928 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 929 929 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 943 943 } 944 944 SphericalPointDistribution::Polygon_t remaining = 945 SPD.getRemainingPoints(polygon, 4 );945 SPD.getRemainingPoints(polygon, 4, 4); 946 946 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 947 947 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 958 958 expected.pop_front(); // remove second point 959 959 SphericalPointDistribution::Polygon_t remaining = 960 SPD.getRemainingPoints(polygon, 4 );960 SPD.getRemainingPoints(polygon, 4, 4); 961 961 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 962 962 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 977 977 expected.pop_front(); // remove second point 978 978 SphericalPointDistribution::Polygon_t remaining = 979 SPD.getRemainingPoints(polygon, 4 );979 SPD.getRemainingPoints(polygon, 4, 4); 980 980 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 981 981 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1000 1000 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1001 1001 SphericalPointDistribution::Polygon_t remaining = 1002 SPD.getRemainingPoints(polygon, 4 );1002 SPD.getRemainingPoints(polygon, 4, 4); 1003 1003 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1004 1004 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1021 1021 expected.pop_front(); // remove third point 1022 1022 SphericalPointDistribution::Polygon_t remaining = 1023 SPD.getRemainingPoints(polygon, 4 );1023 SPD.getRemainingPoints(polygon, 4, 4); 1024 1024 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1025 1025 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1046 1046 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1047 1047 SphericalPointDistribution::Polygon_t remaining = 1048 SPD.getRemainingPoints(polygon, 4 );1048 SPD.getRemainingPoints(polygon, 4, 4); 1049 1049 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1050 1050 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1073 1073 expected += Vector(-0.5773502691896,-5.551115123126e-17,-0.8164965809277); 1074 1074 SphericalPointDistribution::Polygon_t remaining = 1075 SPD.getRemainingPoints(polygon, 4 );1075 SPD.getRemainingPoints(polygon, 4, 4); 1076 1076 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 1077 1077 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 1090 1090 expected += Vector(-0.3535533905933,-0.3535533905933,-0.8660254037844); 1091 1091 SphericalPointDistribution::Polygon_t remaining = 1092 SPD.getRemainingPoints(polygon, 5 );1092 SPD.getRemainingPoints(polygon, 5, 5); 1093 1093 std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 1094 1094 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 1108 1108 expected += Vector(0.3535534025157,-0.3535533856548,0.8660254009332); 1109 1109 SphericalPointDistribution::Polygon_t remaining = 1110 SPD.getRemainingPoints(polygon, 5 );1110 SPD.getRemainingPoints(polygon, 5, 5); 1111 1111 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 1112 1112 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 1125 1125 expected += Vector(0.,0.,-1.); 1126 1126 SphericalPointDistribution::Polygon_t remaining = 1127 SPD.getRemainingPoints(polygon, 6 );1127 SPD.getRemainingPoints(polygon, 6, 6); 1128 1128 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 1129 1129 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 1146 1146 expected.pop_front(); // remove first point 1147 1147 SphericalPointDistribution::Polygon_t remaining = 1148 SPD.getRemainingPoints(polygon, 5 );1148 SPD.getRemainingPoints(polygon, 5, 5); 1149 1149 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1150 1150 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1164 1164 } 1165 1165 SphericalPointDistribution::Polygon_t remaining = 1166 SPD.getRemainingPoints(polygon, 5 );1166 SPD.getRemainingPoints(polygon, 5, 5); 1167 1167 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1168 1168 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1179 1179 expected.pop_front(); // remove second point 1180 1180 SphericalPointDistribution::Polygon_t remaining = 1181 SPD.getRemainingPoints(polygon, 5 );1181 SPD.getRemainingPoints(polygon, 5, 5); 1182 1182 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1183 1183 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1202 1202 *iter = RotationAxis.rotateVector(*iter, 47.6/180.*M_PI); 1203 1203 SphericalPointDistribution::Polygon_t remaining = 1204 SPD.getRemainingPoints(polygon, 5 );1204 SPD.getRemainingPoints(polygon, 5, 5); 1205 1205 // the three remaining points sit on a plane that may be rotated arbitrarily 1206 1206 // so we cannot simply check for equality between expected and remaining … … 1228 1228 expected.pop_front(); // remove third point 1229 1229 SphericalPointDistribution::Polygon_t remaining = 1230 SPD.getRemainingPoints(polygon, 5 );1230 SPD.getRemainingPoints(polygon, 5, 5); 1231 1231 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1232 1232 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1253 1253 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1254 1254 SphericalPointDistribution::Polygon_t remaining = 1255 SPD.getRemainingPoints(polygon, 5 );1255 SPD.getRemainingPoints(polygon, 5, 5); 1256 1256 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1257 1257 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1277 1277 expected.pop_front(); // remove first point 1278 1278 SphericalPointDistribution::Polygon_t remaining = 1279 SPD.getRemainingPoints(polygon, 6 );1279 SPD.getRemainingPoints(polygon, 6, 6); 1280 1280 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1281 1281 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1295 1295 } 1296 1296 SphericalPointDistribution::Polygon_t remaining = 1297 SPD.getRemainingPoints(polygon, 6 );1297 SPD.getRemainingPoints(polygon, 6, 6); 1298 1298 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1299 1299 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1310 1310 expected.pop_front(); // remove second spoint 1311 1311 SphericalPointDistribution::Polygon_t remaining = 1312 SPD.getRemainingPoints(polygon, 6 );1312 SPD.getRemainingPoints(polygon, 6, 6); 1313 1313 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1314 1314 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1333 1333 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1334 1334 SphericalPointDistribution::Polygon_t remaining = 1335 SPD.getRemainingPoints(polygon, 6 );1335 SPD.getRemainingPoints(polygon, 6, 6); 1336 1336 // the four remaining points sit on a plane that may have been rotated arbitrarily 1337 1337 // so we cannot simply check for equality between expected and remaining … … 1359 1359 expected.pop_front(); // remove third point 1360 1360 SphericalPointDistribution::Polygon_t remaining = 1361 SPD.getRemainingPoints(polygon, 6 );1361 SPD.getRemainingPoints(polygon, 6, 6); 1362 1362 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1363 1363 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1384 1384 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1385 1385 SphericalPointDistribution::Polygon_t remaining = 1386 SPD.getRemainingPoints(polygon, 6 );1386 SPD.getRemainingPoints(polygon, 6, 6); 1387 1387 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1388 1388 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1408 1408 expected.pop_front(); // remove first point 1409 1409 SphericalPointDistribution::Polygon_t remaining = 1410 SPD.getRemainingPoints(polygon, 7 );1410 SPD.getRemainingPoints(polygon, 7, 7); 1411 1411 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1412 1412 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1426 1426 } 1427 1427 SphericalPointDistribution::Polygon_t remaining = 1428 SPD.getRemainingPoints(polygon, 7 );1428 SPD.getRemainingPoints(polygon, 7, 7); 1429 1429 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1430 1430 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1441 1441 expected.pop_front(); // remove second point 1442 1442 SphericalPointDistribution::Polygon_t remaining = 1443 SPD.getRemainingPoints(polygon, 7 );1443 SPD.getRemainingPoints(polygon, 7, 7); 1444 1444 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1445 1445 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1464 1464 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1465 1465 SphericalPointDistribution::Polygon_t remaining = 1466 SPD.getRemainingPoints(polygon, 7 );1466 SPD.getRemainingPoints(polygon, 7, 7); 1467 1467 // the five remaining points sit on a plane that may have been rotated arbitrarily 1468 1468 // so we cannot simply check for equality between expected and remaining … … 1490 1490 expected.pop_front(); // remove third point 1491 1491 SphericalPointDistribution::Polygon_t remaining = 1492 SPD.getRemainingPoints(polygon, 7 );1492 SPD.getRemainingPoints(polygon, 7, 7); 1493 1493 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1494 1494 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1515 1515 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1516 1516 SphericalPointDistribution::Polygon_t remaining = 1517 SPD.getRemainingPoints(polygon, 7 );1517 SPD.getRemainingPoints(polygon, 7, 7); 1518 1518 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1519 1519 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1539 1539 expected.pop_front(); // remove first point 1540 1540 SphericalPointDistribution::Polygon_t remaining = 1541 SPD.getRemainingPoints(polygon, 8 );1541 SPD.getRemainingPoints(polygon, 8, 8); 1542 1542 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1543 1543 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1557 1557 } 1558 1558 SphericalPointDistribution::Polygon_t remaining = 1559 SPD.getRemainingPoints(polygon, 8 );1559 SPD.getRemainingPoints(polygon, 8, 8); 1560 1560 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1561 1561 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1572 1572 expected.pop_front(); // remove second point 1573 1573 SphericalPointDistribution::Polygon_t remaining = 1574 SPD.getRemainingPoints(polygon, 8 );1574 SPD.getRemainingPoints(polygon, 8, 8); 1575 1575 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1576 1576 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1595 1595 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1596 1596 SphericalPointDistribution::Polygon_t remaining = 1597 SPD.getRemainingPoints(polygon, 8 );1597 SPD.getRemainingPoints(polygon, 8, 8); 1598 1598 // the six remaining points sit on two planes that may have been rotated arbitrarily 1599 1599 // so we cannot simply check for equality between expected and remaining … … 1625 1625 expected.pop_front(); // remove third point 1626 1626 SphericalPointDistribution::Polygon_t remaining = 1627 SPD.getRemainingPoints(polygon, 8 );1627 SPD.getRemainingPoints(polygon, 8, 8); 1628 1628 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1629 1629 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1650 1650 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1651 1651 SphericalPointDistribution::Polygon_t remaining = 1652 SPD.getRemainingPoints(polygon, 8 );1653 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1654 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1655 // also slightly perturbed 1656 const double amplitude = 0.05; 1657 perturbPolygon(polygon, amplitude); 1658 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1659 } 1660 } 1652 SPD.getRemainingPoints(polygon, 8, 8); 1653 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1654 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1655 // also slightly perturbed 1656 const double amplitude = 0.05; 1657 perturbPolygon(polygon, amplitude); 1658 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1659 } 1660 }
Note:
See TracChangeset
for help on using the changeset viewer.
