- Timestamp:
- May 25, 2016, 7:13:59 AM (9 years ago)
- Children:
- ec9bd2
- Parents:
- a52369
- git-author:
- Frederik Heber <heber@…> (07/12/14 19:07:44)
- git-committer:
- Frederik Heber <heber@…> (05/25/16 07:13:59)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp
ra52369 r9cf90e 612 612 } 613 613 614 /** UnitTest for matchSphericalPointDistributions() with two points615 */ 616 void SphericalPointDistributionTest:: matchSphericalPointDistributionsTest_2()614 /** UnitTest for getRemainingPoints() with two points 615 */ 616 void SphericalPointDistributionTest::getRemainingPointsTest_2() 617 617 { 618 618 SphericalPointDistribution SPD(1.); … … 621 621 SphericalPointDistribution::WeightedPolygon_t polygon; 622 622 polygon += std::make_pair(Vector(1.,0.,0.), 1); 623 SphericalPointDistribution::Polygon_t newpolygon =624 SPD.get<2>();625 623 SphericalPointDistribution::Polygon_t expected; 626 624 expected += Vector(-1.,0.,0.); 627 625 SphericalPointDistribution::Polygon_t remaining = 628 SphericalPointDistribution::matchSphericalPointDistributions( 629 polygon, 630 newpolygon); 626 SPD.getRemainingPoints(polygon, 2); 631 627 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 632 628 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 637 633 SphericalPointDistribution::WeightedPolygon_t polygon; 638 634 polygon += std::make_pair( Vector(0.,1.,0.), 1); 639 SphericalPointDistribution::Polygon_t newpolygon =640 SPD.get<2>();641 635 SphericalPointDistribution::Polygon_t expected; 642 636 expected += Vector(0.,-1.,0.); 643 637 SphericalPointDistribution::Polygon_t remaining = 644 SphericalPointDistribution::matchSphericalPointDistributions( 645 polygon, 646 newpolygon); 638 SPD.getRemainingPoints(polygon, 2); 647 639 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 648 640 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 653 645 SphericalPointDistribution::WeightedPolygon_t polygon; 654 646 polygon += std::make_pair( Vector(0.,0.,-1.), 1); 655 SphericalPointDistribution::Polygon_t newpolygon =656 SPD.get<2>();657 647 SphericalPointDistribution::Polygon_t expected; 658 648 expected += Vector(0.,0.,1.); 659 649 SphericalPointDistribution::Polygon_t remaining = 660 SphericalPointDistribution::matchSphericalPointDistributions( 661 polygon, 662 newpolygon); 650 SPD.getRemainingPoints(polygon, 2); 663 651 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 664 652 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 670 658 SphericalPointDistribution::WeightedPolygon_t polygon; 671 659 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 672 SphericalPointDistribution::Polygon_t newpolygon =673 SPD.get<2>();674 660 SphericalPointDistribution::Polygon_t expected; 675 661 expected += RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI); 676 662 SphericalPointDistribution::Polygon_t remaining = 677 SphericalPointDistribution::matchSphericalPointDistributions( 678 polygon, 679 newpolygon); 680 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 681 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 682 } 683 } 684 685 /** UnitTest for matchSphericalPointDistributions() with three points 686 */ 687 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_3() 663 SPD.getRemainingPoints(polygon, 2); 664 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 665 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 666 } 667 } 668 669 /** UnitTest for getRemainingPoints() with three points 670 */ 671 void SphericalPointDistributionTest::getRemainingPointsTest_3() 688 672 { 689 673 SphericalPointDistribution SPD(1.); … … 693 677 SphericalPointDistribution::WeightedPolygon_t polygon; 694 678 polygon += std::make_pair( Vector(1.,0.,0.), 1); 695 SphericalPointDistribution::Polygon_t newpolygon=679 SphericalPointDistribution::Polygon_t expected = 696 680 SPD.get<3>(); 697 SphericalPointDistribution::Polygon_t expected = newpolygon; 698 expected.pop_front(); // remove first point 699 SphericalPointDistribution::Polygon_t remaining = 700 SphericalPointDistribution::matchSphericalPointDistributions( 701 polygon, 702 newpolygon); 681 expected.pop_front(); // remove first point 682 SphericalPointDistribution::Polygon_t remaining = 683 SPD.getRemainingPoints(polygon, 3); 703 684 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 704 685 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 709 690 SphericalPointDistribution::WeightedPolygon_t polygon; 710 691 polygon += std::make_pair( Vector(0.,1.,0.), 1); 711 SphericalPointDistribution::Polygon_t newpolygon=692 SphericalPointDistribution::Polygon_t expected = 712 693 SPD.get<3>(); 713 SphericalPointDistribution::Polygon_t expected = newpolygon;714 694 expected.pop_front(); // remove first point 715 695 for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin(); … … 719 699 } 720 700 SphericalPointDistribution::Polygon_t remaining = 721 SphericalPointDistribution::matchSphericalPointDistributions( 722 polygon, 723 newpolygon); 701 SPD.getRemainingPoints(polygon, 3); 724 702 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 725 703 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 731 709 polygon += std::make_pair( Vector(1.,0.,0.), 1); 732 710 polygon += std::make_pair( Vector(-0.5, sqrt(3)*0.5,0.), 1); 733 SphericalPointDistribution::Polygon_t newpolygon=711 SphericalPointDistribution::Polygon_t expected = 734 712 SPD.get<3>(); 735 SphericalPointDistribution::Polygon_t expected = newpolygon; 736 expected.pop_front(); // remove first point 737 expected.pop_front(); // remove second point 738 SphericalPointDistribution::Polygon_t remaining = 739 SphericalPointDistribution::matchSphericalPointDistributions( 740 polygon, 741 newpolygon); 713 expected.pop_front(); // remove first point 714 expected.pop_front(); // remove second point 715 SphericalPointDistribution::Polygon_t remaining = 716 SPD.getRemainingPoints(polygon, 3); 742 717 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 743 718 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 754 729 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 755 730 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-0.5, sqrt(3)*0.5,0.), 47.6/180*M_PI), 1); 756 SphericalPointDistribution::Polygon_t newpolygon=731 SphericalPointDistribution::Polygon_t expected = 757 732 SPD.get<3>(); 758 SphericalPointDistribution::Polygon_t expected = newpolygon;759 733 expected.pop_front(); // remove first point 760 734 expected.pop_front(); // remove second point … … 763 737 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 764 738 SphericalPointDistribution::Polygon_t remaining = 765 SphericalPointDistribution::matchSphericalPointDistributions( 766 polygon, 767 newpolygon); 739 SPD.getRemainingPoints(polygon, 3); 768 740 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 769 741 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 784 756 SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant 785 757 SphericalPointDistribution::Polygon_t remaining = 786 SphericalPointDistribution::matchSphericalPointDistributions( 787 polygon, 788 newpolygon); 758 SPD.getRemainingPoints(polygon, 3); 789 759 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 790 760 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 807 777 SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant 808 778 SphericalPointDistribution::Polygon_t remaining = 809 SphericalPointDistribution::matchSphericalPointDistributions( 810 polygon, 811 newpolygon); 812 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 813 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 814 // also slightly perturbed 815 const double amplitude = 0.05; 816 perturbPolygon(polygon, amplitude); 817 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 818 } 819 } 820 821 /** UnitTest for matchSphericalPointDistributions() with four points 822 */ 823 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_4() 779 SPD.getRemainingPoints(polygon, 3); 780 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 781 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 782 // also slightly perturbed 783 const double amplitude = 0.05; 784 perturbPolygon(polygon, amplitude); 785 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 786 } 787 } 788 789 /** UnitTest for getRemainingPoints() with four points 790 */ 791 void SphericalPointDistributionTest::getRemainingPointsTest_4() 824 792 { 825 793 SphericalPointDistribution SPD(1.); … … 829 797 SphericalPointDistribution::WeightedPolygon_t polygon; 830 798 polygon += std::make_pair( Vector(1.,0.,0.), 1); 831 SphericalPointDistribution::Polygon_t newpolygon=799 SphericalPointDistribution::Polygon_t expected = 832 800 SPD.get<4>(); 833 SphericalPointDistribution::Polygon_t expected = newpolygon; 834 expected.pop_front(); // remove first point 835 SphericalPointDistribution::Polygon_t remaining = 836 SphericalPointDistribution::matchSphericalPointDistributions( 837 polygon, 838 newpolygon); 801 expected.pop_front(); // remove first point 802 SphericalPointDistribution::Polygon_t remaining = 803 SPD.getRemainingPoints(polygon, 4); 839 804 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 840 805 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 845 810 SphericalPointDistribution::WeightedPolygon_t polygon; 846 811 polygon += std::make_pair( Vector(0.,1.,0.), 1); 847 SphericalPointDistribution::Polygon_t newpolygon=812 SphericalPointDistribution::Polygon_t expected = 848 813 SPD.get<4>(); 849 SphericalPointDistribution::Polygon_t expected = newpolygon;850 814 expected.pop_front(); // remove first point 851 815 for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin(); … … 855 819 } 856 820 SphericalPointDistribution::Polygon_t remaining = 857 SphericalPointDistribution::matchSphericalPointDistributions( 858 polygon, 859 newpolygon); 821 SPD.getRemainingPoints(polygon, 4); 860 822 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 861 823 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 867 829 polygon += std::make_pair( Vector(1.,0.,0.), 1); 868 830 polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 1); 869 SphericalPointDistribution::Polygon_t newpolygon=831 SphericalPointDistribution::Polygon_t expected = 870 832 SPD.get<4>(); 871 SphericalPointDistribution::Polygon_t expected = newpolygon; 872 expected.pop_front(); // remove first point 873 expected.pop_front(); // remove second point 874 SphericalPointDistribution::Polygon_t remaining = 875 SphericalPointDistribution::matchSphericalPointDistributions( 876 polygon, 877 newpolygon); 833 expected.pop_front(); // remove first point 834 expected.pop_front(); // remove second point 835 SphericalPointDistribution::Polygon_t remaining = 836 SPD.getRemainingPoints(polygon, 4); 878 837 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 879 838 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 889 848 polygon += std::make_pair( Vector(1.,0.,0.), 1); 890 849 polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 1); 891 SphericalPointDistribution::Polygon_t newpolygon=850 SphericalPointDistribution::Polygon_t expected = 892 851 SPD.get<4>(); 893 SphericalPointDistribution::Polygon_t expected = newpolygon; 894 expected.pop_front(); // remove first point 895 expected.pop_front(); // remove second point 896 SphericalPointDistribution::Polygon_t remaining = 897 SphericalPointDistribution::matchSphericalPointDistributions( 898 polygon, 899 newpolygon); 852 expected.pop_front(); // remove first point 853 expected.pop_front(); // remove second point 854 SphericalPointDistribution::Polygon_t remaining = 855 SPD.getRemainingPoints(polygon, 4); 900 856 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 901 857 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 912 868 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 913 869 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 47.6/180*M_PI), 1); 914 SphericalPointDistribution::Polygon_t newpolygon=870 SphericalPointDistribution::Polygon_t expected = 915 871 SPD.get<4>(); 916 SphericalPointDistribution::Polygon_t expected = newpolygon;917 872 expected.pop_front(); // remove first point 918 873 expected.pop_front(); // remove second point … … 921 876 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 922 877 SphericalPointDistribution::Polygon_t remaining = 923 SphericalPointDistribution::matchSphericalPointDistributions( 924 polygon, 925 newpolygon); 878 SPD.getRemainingPoints(polygon, 4); 926 879 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 927 880 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 938 891 polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 1); 939 892 polygon += std::make_pair( Vector(-1./3.0, -M_SQRT2/3.0, M_SQRT2/sqrt(3)), 1); 940 SphericalPointDistribution::Polygon_t newpolygon=893 SphericalPointDistribution::Polygon_t expected = 941 894 SPD.get<4>(); 942 SphericalPointDistribution::Polygon_t expected = newpolygon;943 895 expected.pop_front(); // remove first point 944 896 expected.pop_front(); // remove second point 945 897 expected.pop_front(); // remove third point 946 898 SphericalPointDistribution::Polygon_t remaining = 947 SphericalPointDistribution::matchSphericalPointDistributions( 948 polygon, 949 newpolygon); 899 SPD.getRemainingPoints(polygon, 4); 950 900 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 951 901 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 963 913 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 47.6/180*M_PI), 1); 964 914 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, -M_SQRT2/3.0, M_SQRT2/sqrt(3)), 47.6/180*M_PI), 1); 965 SphericalPointDistribution::Polygon_t newpolygon=915 SphericalPointDistribution::Polygon_t expected = 966 916 SPD.get<4>(); 967 SphericalPointDistribution::Polygon_t expected = newpolygon;968 917 expected.pop_front(); // remove first point 969 918 expected.pop_front(); // remove second point … … 973 922 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 974 923 SphericalPointDistribution::Polygon_t remaining = 975 SphericalPointDistribution::matchSphericalPointDistributions( 976 polygon, 977 newpolygon); 978 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 979 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 980 // also slightly perturbed 981 const double amplitude = 0.05; 982 perturbPolygon(polygon, amplitude); 983 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 984 } 985 } 986 987 /** UnitTest for matchSphericalPointDistributions() with four points and weights 924 SPD.getRemainingPoints(polygon, 4); 925 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 926 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 927 // also slightly perturbed 928 const double amplitude = 0.05; 929 perturbPolygon(polygon, amplitude); 930 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 931 } 932 } 933 934 /** UnitTest for getRemainingPoints() with four points and weights 988 935 * not all equal to one. 989 936 */ 990 void SphericalPointDistributionTest:: matchSphericalPointDistributionsTest_multiple()937 void SphericalPointDistributionTest::getRemainingPointsTest_multiple() 991 938 { 992 939 SphericalPointDistribution SPD(1.); … … 1002 949 expected += Vector(-0.5773502691896,-5.551115123126e-17,-0.8164965809277); 1003 950 SphericalPointDistribution::Polygon_t remaining = 1004 SphericalPointDistribution::matchSphericalPointDistributions( 1005 polygon, 1006 newpolygon); 951 SPD.getRemainingPoints(polygon, 4); 1007 952 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 1008 953 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 1021 966 expected += Vector(-0.3535533905933,-0.3535533905933,-0.8660254037844); 1022 967 SphericalPointDistribution::Polygon_t remaining = 1023 SphericalPointDistribution::matchSphericalPointDistributions( 1024 polygon, 1025 newpolygon); 1026 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 968 SPD.getRemainingPoints(polygon, 5); 969 std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 1027 970 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1028 971 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1041 984 expected += Vector(0.3535534025157,-0.3535533856548,0.8660254009332); 1042 985 SphericalPointDistribution::Polygon_t remaining = 1043 SphericalPointDistribution::matchSphericalPointDistributions( 1044 polygon, 1045 newpolygon); 986 SPD.getRemainingPoints(polygon, 5); 1046 987 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 1047 988 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 1057 998 SPD.get<6>(); 1058 999 SphericalPointDistribution::Polygon_t expected; 1000 expected += Vector(0.,0.,1.); 1059 1001 expected += Vector(0.,0.,-1.); 1060 expected += Vector(0.,0.,1.); 1061 SphericalPointDistribution::Polygon_t remaining = 1062 SphericalPointDistribution::matchSphericalPointDistributions( 1063 polygon, 1064 newpolygon); 1002 SphericalPointDistribution::Polygon_t remaining = 1003 SPD.getRemainingPoints(polygon, 6); 1065 1004 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 1066 1005 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 1069 1008 } 1070 1009 1071 /** UnitTest for matchSphericalPointDistributions() with five points1072 */ 1073 void SphericalPointDistributionTest:: matchSphericalPointDistributionsTest_5()1010 /** UnitTest for getRemainingPoints() with five points 1011 */ 1012 void SphericalPointDistributionTest::getRemainingPointsTest_5() 1074 1013 { 1075 1014 SphericalPointDistribution SPD(1.); … … 1079 1018 SphericalPointDistribution::WeightedPolygon_t polygon; 1080 1019 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1081 SphericalPointDistribution::Polygon_t newpolygon=1020 SphericalPointDistribution::Polygon_t expected = 1082 1021 SPD.get<5>(); 1083 SphericalPointDistribution::Polygon_t expected = newpolygon; 1084 expected.pop_front(); // remove first point 1085 SphericalPointDistribution::Polygon_t remaining = 1086 SphericalPointDistribution::matchSphericalPointDistributions( 1087 polygon, 1088 newpolygon); 1022 expected.pop_front(); // remove first point 1023 SphericalPointDistribution::Polygon_t remaining = 1024 SPD.getRemainingPoints(polygon, 5); 1089 1025 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1090 1026 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1095 1031 SphericalPointDistribution::WeightedPolygon_t polygon; 1096 1032 polygon += std::make_pair( Vector(0.,1.,0.), 1); 1097 SphericalPointDistribution::Polygon_t newpolygon=1033 SphericalPointDistribution::Polygon_t expected = 1098 1034 SPD.get<5>(); 1099 SphericalPointDistribution::Polygon_t expected = newpolygon;1100 1035 expected.pop_front(); // remove first point 1101 1036 for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin(); … … 1105 1040 } 1106 1041 SphericalPointDistribution::Polygon_t remaining = 1107 SphericalPointDistribution::matchSphericalPointDistributions( 1108 polygon, 1109 newpolygon); 1042 SPD.getRemainingPoints(polygon, 5); 1110 1043 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1111 1044 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1117 1050 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1118 1051 polygon += std::make_pair( Vector(-1.,0.,0.), 1); 1119 SphericalPointDistribution::Polygon_t newpolygon=1052 SphericalPointDistribution::Polygon_t expected = 1120 1053 SPD.get<5>(); 1121 SphericalPointDistribution::Polygon_t expected = newpolygon; 1122 expected.pop_front(); // remove first point 1123 expected.pop_front(); // remove second point 1124 SphericalPointDistribution::Polygon_t remaining = 1125 SphericalPointDistribution::matchSphericalPointDistributions( 1126 polygon, 1127 newpolygon); 1054 expected.pop_front(); // remove first point 1055 expected.pop_front(); // remove second point 1056 SphericalPointDistribution::Polygon_t remaining = 1057 SPD.getRemainingPoints(polygon, 5); 1128 1058 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1129 1059 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1140 1070 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180.*M_PI), 1); 1141 1071 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180.*M_PI), 1); 1142 SphericalPointDistribution::Polygon_t newpolygon=1072 SphericalPointDistribution::Polygon_t expected = 1143 1073 SPD.get<5>(); 1144 SphericalPointDistribution::Polygon_t expected = newpolygon;1145 1074 expected.pop_front(); // remove first point 1146 1075 expected.pop_front(); // remove second point … … 1149 1078 *iter = RotationAxis.rotateVector(*iter, 47.6/180.*M_PI); 1150 1079 SphericalPointDistribution::Polygon_t remaining = 1151 SphericalPointDistribution::matchSphericalPointDistributions( 1152 polygon, 1153 newpolygon); 1080 SPD.getRemainingPoints(polygon, 5); 1154 1081 // the three remaining points sit on a plane that may be rotated arbitrarily 1155 1082 // so we cannot simply check for equality between expected and remaining … … 1171 1098 polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1); 1172 1099 polygon += std::make_pair( Vector(0.0, 1., 0.0), 1); 1173 SphericalPointDistribution::Polygon_t newpolygon=1100 SphericalPointDistribution::Polygon_t expected = 1174 1101 SPD.get<5>(); 1175 SphericalPointDistribution::Polygon_t expected = newpolygon;1176 1102 expected.pop_front(); // remove first point 1177 1103 expected.pop_front(); // remove second point 1178 1104 expected.pop_front(); // remove third point 1179 1105 SphericalPointDistribution::Polygon_t remaining = 1180 SphericalPointDistribution::matchSphericalPointDistributions( 1181 polygon, 1182 newpolygon); 1106 SPD.getRemainingPoints(polygon, 5); 1183 1107 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1184 1108 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1196 1120 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1); 1197 1121 polygon += std::make_pair(RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI), 1); 1198 SphericalPointDistribution::Polygon_t newpolygon=1122 SphericalPointDistribution::Polygon_t expected = 1199 1123 SPD.get<5>(); 1200 SphericalPointDistribution::Polygon_t expected = newpolygon;1201 1124 expected.pop_front(); // remove first point 1202 1125 expected.pop_front(); // remove second point … … 1206 1129 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1207 1130 SphericalPointDistribution::Polygon_t remaining = 1208 SphericalPointDistribution::matchSphericalPointDistributions( 1209 polygon, 1210 newpolygon); 1211 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1212 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1213 // also slightly perturbed 1214 const double amplitude = 0.05; 1215 perturbPolygon(polygon, amplitude); 1216 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1217 } 1218 } 1219 1220 /** UnitTest for matchSphericalPointDistributions() with six points 1221 */ 1222 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_6() 1131 SPD.getRemainingPoints(polygon, 5); 1132 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1133 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1134 // also slightly perturbed 1135 const double amplitude = 0.05; 1136 perturbPolygon(polygon, amplitude); 1137 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1138 } 1139 } 1140 1141 /** UnitTest for getRemainingPoints() with six points 1142 */ 1143 void SphericalPointDistributionTest::getRemainingPointsTest_6() 1223 1144 { 1224 1145 SphericalPointDistribution SPD(1.); … … 1228 1149 SphericalPointDistribution::WeightedPolygon_t polygon; 1229 1150 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1230 SphericalPointDistribution::Polygon_t newpolygon=1151 SphericalPointDistribution::Polygon_t expected = 1231 1152 SPD.get<6>(); 1232 SphericalPointDistribution::Polygon_t expected = newpolygon; 1233 expected.pop_front(); // remove first point 1234 SphericalPointDistribution::Polygon_t remaining = 1235 SphericalPointDistribution::matchSphericalPointDistributions( 1236 polygon, 1237 newpolygon); 1153 expected.pop_front(); // remove first point 1154 SphericalPointDistribution::Polygon_t remaining = 1155 SPD.getRemainingPoints(polygon, 6); 1238 1156 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1239 1157 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1244 1162 SphericalPointDistribution::WeightedPolygon_t polygon; 1245 1163 polygon += std::make_pair( Vector(0.,1.,0.), 1); 1246 SphericalPointDistribution::Polygon_t newpolygon=1164 SphericalPointDistribution::Polygon_t expected = 1247 1165 SPD.get<6>(); 1248 SphericalPointDistribution::Polygon_t expected = newpolygon;1249 1166 expected.pop_front(); // remove first point 1250 1167 for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin(); … … 1254 1171 } 1255 1172 SphericalPointDistribution::Polygon_t remaining = 1256 SphericalPointDistribution::matchSphericalPointDistributions( 1257 polygon, 1258 newpolygon); 1173 SPD.getRemainingPoints(polygon, 6); 1259 1174 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1260 1175 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1266 1181 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1267 1182 polygon += std::make_pair( Vector(-1.,0.,0.), 1); 1268 SphericalPointDistribution::Polygon_t newpolygon=1183 SphericalPointDistribution::Polygon_t expected = 1269 1184 SPD.get<6>(); 1270 SphericalPointDistribution::Polygon_t expected = newpolygon;1271 1185 expected.pop_front(); // remove first point 1272 1186 expected.pop_front(); // remove second spoint 1273 1187 SphericalPointDistribution::Polygon_t remaining = 1274 SphericalPointDistribution::matchSphericalPointDistributions( 1275 polygon, 1276 newpolygon); 1188 SPD.getRemainingPoints(polygon, 6); 1277 1189 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1278 1190 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1289 1201 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 1290 1202 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI), 1); 1291 SphericalPointDistribution::Polygon_t newpolygon=1203 SphericalPointDistribution::Polygon_t expected = 1292 1204 SPD.get<6>(); 1293 SphericalPointDistribution::Polygon_t expected = newpolygon;1294 1205 expected.pop_front(); // remove first point 1295 1206 expected.pop_front(); // remove second spoint … … 1298 1209 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1299 1210 SphericalPointDistribution::Polygon_t remaining = 1300 SphericalPointDistribution::matchSphericalPointDistributions( 1301 polygon, 1302 newpolygon); 1211 SPD.getRemainingPoints(polygon, 6); 1303 1212 // the four remaining points sit on a plane that may have been rotated arbitrarily 1304 1213 // so we cannot simply check for equality between expected and remaining … … 1320 1229 polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1); 1321 1230 polygon += std::make_pair( Vector(0.0, 1., 0.0), 1); 1322 SphericalPointDistribution::Polygon_t newpolygon=1231 SphericalPointDistribution::Polygon_t expected = 1323 1232 SPD.get<6>(); 1324 SphericalPointDistribution::Polygon_t expected = newpolygon;1325 1233 expected.pop_front(); // remove first point 1326 1234 expected.pop_front(); // remove second point 1327 1235 expected.pop_front(); // remove third point 1328 1236 SphericalPointDistribution::Polygon_t remaining = 1329 SphericalPointDistribution::matchSphericalPointDistributions( 1330 polygon, 1331 newpolygon); 1237 SPD.getRemainingPoints(polygon, 6); 1332 1238 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1333 1239 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1345 1251 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1); 1346 1252 polygon += std::make_pair(RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI), 1); 1347 SphericalPointDistribution::Polygon_t newpolygon=1253 SphericalPointDistribution::Polygon_t expected = 1348 1254 SPD.get<6>(); 1349 SphericalPointDistribution::Polygon_t expected = newpolygon;1350 1255 expected.pop_front(); // remove first point 1351 1256 expected.pop_front(); // remove second point … … 1355 1260 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1356 1261 SphericalPointDistribution::Polygon_t remaining = 1357 SphericalPointDistribution::matchSphericalPointDistributions( 1358 polygon, 1359 newpolygon); 1360 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1361 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1362 // also slightly perturbed 1363 const double amplitude = 0.05; 1364 perturbPolygon(polygon, amplitude); 1365 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1366 } 1367 } 1368 1369 /** UnitTest for matchSphericalPointDistributions() with seven points 1370 */ 1371 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_7() 1262 SPD.getRemainingPoints(polygon, 6); 1263 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1264 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1265 // also slightly perturbed 1266 const double amplitude = 0.05; 1267 perturbPolygon(polygon, amplitude); 1268 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1269 } 1270 } 1271 1272 /** UnitTest for getRemainingPoints() with seven points 1273 */ 1274 void SphericalPointDistributionTest::getRemainingPointsTest_7() 1372 1275 { 1373 1276 SphericalPointDistribution SPD(1.); … … 1377 1280 SphericalPointDistribution::WeightedPolygon_t polygon; 1378 1281 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1379 SphericalPointDistribution::Polygon_t newpolygon=1282 SphericalPointDistribution::Polygon_t expected = 1380 1283 SPD.get<7>(); 1381 SphericalPointDistribution::Polygon_t expected = newpolygon; 1382 expected.pop_front(); // remove first point 1383 SphericalPointDistribution::Polygon_t remaining = 1384 SphericalPointDistribution::matchSphericalPointDistributions( 1385 polygon, 1386 newpolygon); 1284 expected.pop_front(); // remove first point 1285 SphericalPointDistribution::Polygon_t remaining = 1286 SPD.getRemainingPoints(polygon, 7); 1387 1287 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1388 1288 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1393 1293 SphericalPointDistribution::WeightedPolygon_t polygon; 1394 1294 polygon += std::make_pair( Vector(0.,1.,0.), 1); 1395 SphericalPointDistribution::Polygon_t newpolygon=1295 SphericalPointDistribution::Polygon_t expected = 1396 1296 SPD.get<7>(); 1397 SphericalPointDistribution::Polygon_t expected = newpolygon;1398 1297 expected.pop_front(); // remove first point 1399 1298 for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin(); … … 1403 1302 } 1404 1303 SphericalPointDistribution::Polygon_t remaining = 1405 SphericalPointDistribution::matchSphericalPointDistributions( 1406 polygon, 1407 newpolygon); 1304 SPD.getRemainingPoints(polygon, 7); 1408 1305 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1409 1306 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1415 1312 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1416 1313 polygon += std::make_pair( Vector(-1.,0.,0.), 1); 1417 SphericalPointDistribution::Polygon_t newpolygon=1314 SphericalPointDistribution::Polygon_t expected = 1418 1315 SPD.get<7>(); 1419 SphericalPointDistribution::Polygon_t expected = newpolygon; 1420 expected.pop_front(); // remove first point 1421 expected.pop_front(); // remove second point 1422 SphericalPointDistribution::Polygon_t remaining = 1423 SphericalPointDistribution::matchSphericalPointDistributions( 1424 polygon, 1425 newpolygon); 1316 expected.pop_front(); // remove first point 1317 expected.pop_front(); // remove second point 1318 SphericalPointDistribution::Polygon_t remaining = 1319 SPD.getRemainingPoints(polygon, 7); 1426 1320 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1427 1321 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1438 1332 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 1439 1333 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI), 1); 1440 SphericalPointDistribution::Polygon_t newpolygon=1334 SphericalPointDistribution::Polygon_t expected = 1441 1335 SPD.get<7>(); 1442 SphericalPointDistribution::Polygon_t expected = newpolygon;1443 1336 expected.pop_front(); // remove first point 1444 1337 expected.pop_front(); // remove second point … … 1447 1340 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1448 1341 SphericalPointDistribution::Polygon_t remaining = 1449 SphericalPointDistribution::matchSphericalPointDistributions( 1450 polygon, 1451 newpolygon); 1342 SPD.getRemainingPoints(polygon, 7); 1452 1343 // the five remaining points sit on a plane that may have been rotated arbitrarily 1453 1344 // so we cannot simply check for equality between expected and remaining … … 1469 1360 polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1); 1470 1361 polygon += std::make_pair( Vector(0.0, 1., 0.0), 1); 1471 SphericalPointDistribution::Polygon_t newpolygon=1362 SphericalPointDistribution::Polygon_t expected = 1472 1363 SPD.get<7>(); 1473 SphericalPointDistribution::Polygon_t expected = newpolygon;1474 1364 expected.pop_front(); // remove first point 1475 1365 expected.pop_front(); // remove second point 1476 1366 expected.pop_front(); // remove third point 1477 1367 SphericalPointDistribution::Polygon_t remaining = 1478 SphericalPointDistribution::matchSphericalPointDistributions( 1479 polygon, 1480 newpolygon); 1368 SPD.getRemainingPoints(polygon, 7); 1481 1369 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1482 1370 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1494 1382 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1); 1495 1383 polygon += std::make_pair(RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI), 1); 1496 SphericalPointDistribution::Polygon_t newpolygon=1384 SphericalPointDistribution::Polygon_t expected = 1497 1385 SPD.get<7>(); 1498 SphericalPointDistribution::Polygon_t expected = newpolygon;1499 1386 expected.pop_front(); // remove first point 1500 1387 expected.pop_front(); // remove second point … … 1504 1391 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1505 1392 SphericalPointDistribution::Polygon_t remaining = 1506 SphericalPointDistribution::matchSphericalPointDistributions( 1507 polygon, 1508 newpolygon); 1509 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1510 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1511 // also slightly perturbed 1512 const double amplitude = 0.05; 1513 perturbPolygon(polygon, amplitude); 1514 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1515 } 1516 } 1517 1518 /** UnitTest for matchSphericalPointDistributions() with eight points 1519 */ 1520 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_8() 1393 SPD.getRemainingPoints(polygon, 7); 1394 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1395 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1396 // also slightly perturbed 1397 const double amplitude = 0.05; 1398 perturbPolygon(polygon, amplitude); 1399 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1400 } 1401 } 1402 1403 /** UnitTest for getRemainingPoints() with eight points 1404 */ 1405 void SphericalPointDistributionTest::getRemainingPointsTest_8() 1521 1406 { 1522 1407 SphericalPointDistribution SPD(1.); … … 1526 1411 SphericalPointDistribution::WeightedPolygon_t polygon; 1527 1412 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1528 SphericalPointDistribution::Polygon_t newpolygon=1413 SphericalPointDistribution::Polygon_t expected = 1529 1414 SPD.get<8>(); 1530 SphericalPointDistribution::Polygon_t expected = newpolygon; 1531 expected.pop_front(); // remove first point 1532 SphericalPointDistribution::Polygon_t remaining = 1533 SphericalPointDistribution::matchSphericalPointDistributions( 1534 polygon, 1535 newpolygon); 1415 expected.pop_front(); // remove first point 1416 SphericalPointDistribution::Polygon_t remaining = 1417 SPD.getRemainingPoints(polygon, 8); 1536 1418 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1537 1419 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1542 1424 SphericalPointDistribution::WeightedPolygon_t polygon; 1543 1425 polygon += std::make_pair( Vector(0.,1.,0.), 1); 1544 SphericalPointDistribution::Polygon_t newpolygon=1426 SphericalPointDistribution::Polygon_t expected = 1545 1427 SPD.get<8>(); 1546 SphericalPointDistribution::Polygon_t expected = newpolygon;1547 1428 expected.pop_front(); // remove first point 1548 1429 for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin(); … … 1551 1432 (*iter)[0] *= -1.; 1552 1433 } 1553 SphericalPointDistribution::Polygon_t remaining = 1554 SphericalPointDistribution::matchSphericalPointDistributions( 1555 polygon, 1556 newpolygon); 1434 SphericalPointDistribution::Polygon_t remaining = 1435 SPD.getRemainingPoints(polygon, 8); 1557 1436 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1558 1437 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1564 1443 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1565 1444 polygon += std::make_pair( Vector(-1.,0.,0.), 1); 1566 SphericalPointDistribution::Polygon_t newpolygon=1445 SphericalPointDistribution::Polygon_t expected = 1567 1446 SPD.get<8>(); 1568 SphericalPointDistribution::Polygon_t expected = newpolygon; 1569 expected.pop_front(); // remove first point 1570 expected.pop_front(); // remove second point 1571 SphericalPointDistribution::Polygon_t remaining = 1572 SphericalPointDistribution::matchSphericalPointDistributions( 1573 polygon, 1574 newpolygon); 1447 expected.pop_front(); // remove first point 1448 expected.pop_front(); // remove second point 1449 SphericalPointDistribution::Polygon_t remaining = 1450 SPD.getRemainingPoints(polygon, 8); 1575 1451 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1576 1452 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1587 1463 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 1588 1464 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI), 1); 1589 SphericalPointDistribution::Polygon_t newpolygon=1465 SphericalPointDistribution::Polygon_t expected = 1590 1466 SPD.get<8>(); 1591 SphericalPointDistribution::Polygon_t expected = newpolygon;1592 1467 expected.pop_front(); // remove first point 1593 1468 expected.pop_front(); // remove second point … … 1596 1471 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1597 1472 SphericalPointDistribution::Polygon_t remaining = 1598 SphericalPointDistribution::matchSphericalPointDistributions( 1599 polygon, 1600 newpolygon); 1473 SPD.getRemainingPoints(polygon, 8); 1601 1474 // the six remaining points sit on two planes that may have been rotated arbitrarily 1602 1475 // so we cannot simply check for equality between expected and remaining … … 1622 1495 polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1); 1623 1496 polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0, 0.0), 1); 1624 SphericalPointDistribution::Polygon_t newpolygon=1497 SphericalPointDistribution::Polygon_t expected = 1625 1498 SPD.get<8>(); 1626 SphericalPointDistribution::Polygon_t expected = newpolygon;1627 1499 expected.pop_front(); // remove first point 1628 1500 expected.pop_front(); // remove second point 1629 1501 expected.pop_front(); // remove third point 1630 1502 SphericalPointDistribution::Polygon_t remaining = 1631 SphericalPointDistribution::matchSphericalPointDistributions( 1632 polygon, 1633 newpolygon); 1503 SPD.getRemainingPoints(polygon, 8); 1634 1504 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1635 1505 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1647 1517 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1); 1648 1518 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0, 0.0), 47.6/180*M_PI), 1); 1649 SphericalPointDistribution::Polygon_t newpolygon=1519 SphericalPointDistribution::Polygon_t expected = 1650 1520 SPD.get<8>(); 1651 SphericalPointDistribution::Polygon_t expected = newpolygon;1652 1521 expected.pop_front(); // remove first point 1653 1522 expected.pop_front(); // remove second point … … 1657 1526 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1658 1527 SphericalPointDistribution::Polygon_t remaining = 1659 SphericalPointDistribution::matchSphericalPointDistributions( 1660 polygon, 1661 newpolygon); 1662 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1663 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1664 // also slightly perturbed 1665 const double amplitude = 0.05; 1666 perturbPolygon(polygon, amplitude); 1667 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1668 } 1669 } 1528 SPD.getRemainingPoints(polygon, 8); 1529 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1530 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1531 // also slightly perturbed 1532 const double amplitude = 0.05; 1533 perturbPolygon(polygon, amplitude); 1534 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1535 } 1536 }
Note:
See TracChangeset
for help on using the changeset viewer.
