- Timestamp:
- Aug 20, 2014, 1:06:16 PM (11 years ago)
- Children:
- ff72fb
- Parents:
- 0b517b
- git-author:
- Frederik Heber <heber@…> (07/12/14 19:07:44)
- git-committer:
- Frederik Heber <heber@…> (08/20/14 13:06:16)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp
r0b517b re6ca85 460 460 } 461 461 462 /** UnitTest for matchSphericalPointDistributions() with two points463 */ 464 void SphericalPointDistributionTest:: matchSphericalPointDistributionsTest_2()462 /** UnitTest for getRemainingPoints() with two points 463 */ 464 void SphericalPointDistributionTest::getRemainingPointsTest_2() 465 465 { 466 466 SphericalPointDistribution SPD(1.); … … 469 469 SphericalPointDistribution::WeightedPolygon_t polygon; 470 470 polygon += std::make_pair(Vector(1.,0.,0.), 1); 471 SphericalPointDistribution::Polygon_t newpolygon =472 SPD.get<2>();473 471 SphericalPointDistribution::Polygon_t expected; 474 472 expected += Vector(-1.,0.,0.); 475 473 SphericalPointDistribution::Polygon_t remaining = 476 SphericalPointDistribution::matchSphericalPointDistributions( 477 polygon, 478 newpolygon); 474 SPD.getRemainingPoints(polygon, 2); 479 475 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 480 476 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 485 481 SphericalPointDistribution::WeightedPolygon_t polygon; 486 482 polygon += std::make_pair( Vector(0.,1.,0.), 1); 487 SphericalPointDistribution::Polygon_t newpolygon =488 SPD.get<2>();489 483 SphericalPointDistribution::Polygon_t expected; 490 484 expected += Vector(0.,-1.,0.); 491 485 SphericalPointDistribution::Polygon_t remaining = 492 SphericalPointDistribution::matchSphericalPointDistributions( 493 polygon, 494 newpolygon); 486 SPD.getRemainingPoints(polygon, 2); 495 487 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 496 488 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 501 493 SphericalPointDistribution::WeightedPolygon_t polygon; 502 494 polygon += std::make_pair( Vector(0.,0.,-1.), 1); 503 SphericalPointDistribution::Polygon_t newpolygon =504 SPD.get<2>();505 495 SphericalPointDistribution::Polygon_t expected; 506 496 expected += Vector(0.,0.,1.); 507 497 SphericalPointDistribution::Polygon_t remaining = 508 SphericalPointDistribution::matchSphericalPointDistributions( 509 polygon, 510 newpolygon); 498 SPD.getRemainingPoints(polygon, 2); 511 499 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 512 500 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 518 506 SphericalPointDistribution::WeightedPolygon_t polygon; 519 507 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 520 SphericalPointDistribution::Polygon_t newpolygon =521 SPD.get<2>();522 508 SphericalPointDistribution::Polygon_t expected; 523 509 expected += RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI); 524 510 SphericalPointDistribution::Polygon_t remaining = 525 SphericalPointDistribution::matchSphericalPointDistributions( 526 polygon, 527 newpolygon); 528 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 529 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 530 } 531 } 532 533 /** UnitTest for matchSphericalPointDistributions() with three points 534 */ 535 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_3() 511 SPD.getRemainingPoints(polygon, 2); 512 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 513 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 514 } 515 } 516 517 /** UnitTest for getRemainingPoints() with three points 518 */ 519 void SphericalPointDistributionTest::getRemainingPointsTest_3() 536 520 { 537 521 SphericalPointDistribution SPD(1.); … … 541 525 SphericalPointDistribution::WeightedPolygon_t polygon; 542 526 polygon += std::make_pair( Vector(1.,0.,0.), 1); 543 SphericalPointDistribution::Polygon_t newpolygon=527 SphericalPointDistribution::Polygon_t expected = 544 528 SPD.get<3>(); 545 SphericalPointDistribution::Polygon_t expected = newpolygon; 546 expected.pop_front(); // remove first point 547 SphericalPointDistribution::Polygon_t remaining = 548 SphericalPointDistribution::matchSphericalPointDistributions( 549 polygon, 550 newpolygon); 529 expected.pop_front(); // remove first point 530 SphericalPointDistribution::Polygon_t remaining = 531 SPD.getRemainingPoints(polygon, 3); 551 532 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 552 533 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 557 538 SphericalPointDistribution::WeightedPolygon_t polygon; 558 539 polygon += std::make_pair( Vector(0.,1.,0.), 1); 559 SphericalPointDistribution::Polygon_t newpolygon=540 SphericalPointDistribution::Polygon_t expected = 560 541 SPD.get<3>(); 561 SphericalPointDistribution::Polygon_t expected = newpolygon;562 542 expected.pop_front(); // remove first point 563 543 for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin(); … … 567 547 } 568 548 SphericalPointDistribution::Polygon_t remaining = 569 SphericalPointDistribution::matchSphericalPointDistributions( 570 polygon, 571 newpolygon); 549 SPD.getRemainingPoints(polygon, 3); 572 550 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 573 551 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 579 557 polygon += std::make_pair( Vector(1.,0.,0.), 1); 580 558 polygon += std::make_pair( Vector(-0.5, sqrt(3)*0.5,0.), 1); 581 SphericalPointDistribution::Polygon_t newpolygon=559 SphericalPointDistribution::Polygon_t expected = 582 560 SPD.get<3>(); 583 SphericalPointDistribution::Polygon_t expected = newpolygon; 584 expected.pop_front(); // remove first point 585 expected.pop_front(); // remove second point 586 SphericalPointDistribution::Polygon_t remaining = 587 SphericalPointDistribution::matchSphericalPointDistributions( 588 polygon, 589 newpolygon); 561 expected.pop_front(); // remove first point 562 expected.pop_front(); // remove second point 563 SphericalPointDistribution::Polygon_t remaining = 564 SPD.getRemainingPoints(polygon, 3); 590 565 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 591 566 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 602 577 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 603 578 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-0.5, sqrt(3)*0.5,0.), 47.6/180*M_PI), 1); 604 SphericalPointDistribution::Polygon_t newpolygon=579 SphericalPointDistribution::Polygon_t expected = 605 580 SPD.get<3>(); 606 SphericalPointDistribution::Polygon_t expected = newpolygon;607 581 expected.pop_front(); // remove first point 608 582 expected.pop_front(); // remove second point … … 611 585 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 612 586 SphericalPointDistribution::Polygon_t remaining = 613 SphericalPointDistribution::matchSphericalPointDistributions( 614 polygon, 615 newpolygon); 587 SPD.getRemainingPoints(polygon, 3); 616 588 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 617 589 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 632 604 SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant 633 605 SphericalPointDistribution::Polygon_t remaining = 634 SphericalPointDistribution::matchSphericalPointDistributions( 635 polygon, 636 newpolygon); 606 SPD.getRemainingPoints(polygon, 3); 637 607 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 638 608 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 655 625 SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant 656 626 SphericalPointDistribution::Polygon_t remaining = 657 SphericalPointDistribution::matchSphericalPointDistributions( 658 polygon, 659 newpolygon); 660 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 661 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 662 // also slightly perturbed 663 const double amplitude = 0.05; 664 perturbPolygon(polygon, amplitude); 665 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 666 } 667 } 668 669 /** UnitTest for matchSphericalPointDistributions() with four points 670 */ 671 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_4() 627 SPD.getRemainingPoints(polygon, 3); 628 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 629 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 630 // also slightly perturbed 631 const double amplitude = 0.05; 632 perturbPolygon(polygon, amplitude); 633 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 634 } 635 } 636 637 /** UnitTest for getRemainingPoints() with four points 638 */ 639 void SphericalPointDistributionTest::getRemainingPointsTest_4() 672 640 { 673 641 SphericalPointDistribution SPD(1.); … … 677 645 SphericalPointDistribution::WeightedPolygon_t polygon; 678 646 polygon += std::make_pair( Vector(1.,0.,0.), 1); 679 SphericalPointDistribution::Polygon_t newpolygon=647 SphericalPointDistribution::Polygon_t expected = 680 648 SPD.get<4>(); 681 SphericalPointDistribution::Polygon_t expected = newpolygon; 682 expected.pop_front(); // remove first point 683 SphericalPointDistribution::Polygon_t remaining = 684 SphericalPointDistribution::matchSphericalPointDistributions( 685 polygon, 686 newpolygon); 649 expected.pop_front(); // remove first point 650 SphericalPointDistribution::Polygon_t remaining = 651 SPD.getRemainingPoints(polygon, 4); 687 652 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 688 653 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 693 658 SphericalPointDistribution::WeightedPolygon_t polygon; 694 659 polygon += std::make_pair( Vector(0.,1.,0.), 1); 695 SphericalPointDistribution::Polygon_t newpolygon=660 SphericalPointDistribution::Polygon_t expected = 696 661 SPD.get<4>(); 697 SphericalPointDistribution::Polygon_t expected = newpolygon;698 662 expected.pop_front(); // remove first point 699 663 for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin(); … … 703 667 } 704 668 SphericalPointDistribution::Polygon_t remaining = 705 SphericalPointDistribution::matchSphericalPointDistributions( 706 polygon, 707 newpolygon); 669 SPD.getRemainingPoints(polygon, 4); 708 670 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 709 671 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 715 677 polygon += std::make_pair( Vector(1.,0.,0.), 1); 716 678 polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 1); 717 SphericalPointDistribution::Polygon_t newpolygon=679 SphericalPointDistribution::Polygon_t expected = 718 680 SPD.get<4>(); 719 SphericalPointDistribution::Polygon_t expected = newpolygon; 720 expected.pop_front(); // remove first point 721 expected.pop_front(); // remove second point 722 SphericalPointDistribution::Polygon_t remaining = 723 SphericalPointDistribution::matchSphericalPointDistributions( 724 polygon, 725 newpolygon); 681 expected.pop_front(); // remove first point 682 expected.pop_front(); // remove second point 683 SphericalPointDistribution::Polygon_t remaining = 684 SPD.getRemainingPoints(polygon, 4); 726 685 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 727 686 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 737 696 polygon += std::make_pair( Vector(1.,0.,0.), 1); 738 697 polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 1); 739 SphericalPointDistribution::Polygon_t newpolygon=698 SphericalPointDistribution::Polygon_t expected = 740 699 SPD.get<4>(); 741 SphericalPointDistribution::Polygon_t expected = newpolygon; 742 expected.pop_front(); // remove first point 743 expected.pop_front(); // remove second point 744 SphericalPointDistribution::Polygon_t remaining = 745 SphericalPointDistribution::matchSphericalPointDistributions( 746 polygon, 747 newpolygon); 700 expected.pop_front(); // remove first point 701 expected.pop_front(); // remove second point 702 SphericalPointDistribution::Polygon_t remaining = 703 SPD.getRemainingPoints(polygon, 4); 748 704 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 749 705 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 760 716 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 761 717 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 47.6/180*M_PI), 1); 762 SphericalPointDistribution::Polygon_t newpolygon=718 SphericalPointDistribution::Polygon_t expected = 763 719 SPD.get<4>(); 764 SphericalPointDistribution::Polygon_t expected = newpolygon;765 720 expected.pop_front(); // remove first point 766 721 expected.pop_front(); // remove second point … … 769 724 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 770 725 SphericalPointDistribution::Polygon_t remaining = 771 SphericalPointDistribution::matchSphericalPointDistributions( 772 polygon, 773 newpolygon); 726 SPD.getRemainingPoints(polygon, 4); 774 727 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 775 728 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 786 739 polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 1); 787 740 polygon += std::make_pair( Vector(-1./3.0, -M_SQRT2/3.0, M_SQRT2/sqrt(3)), 1); 788 SphericalPointDistribution::Polygon_t newpolygon=741 SphericalPointDistribution::Polygon_t expected = 789 742 SPD.get<4>(); 790 SphericalPointDistribution::Polygon_t expected = newpolygon;791 743 expected.pop_front(); // remove first point 792 744 expected.pop_front(); // remove second point 793 745 expected.pop_front(); // remove third point 794 746 SphericalPointDistribution::Polygon_t remaining = 795 SphericalPointDistribution::matchSphericalPointDistributions( 796 polygon, 797 newpolygon); 747 SPD.getRemainingPoints(polygon, 4); 798 748 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 799 749 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 811 761 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 47.6/180*M_PI), 1); 812 762 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, -M_SQRT2/3.0, M_SQRT2/sqrt(3)), 47.6/180*M_PI), 1); 813 SphericalPointDistribution::Polygon_t newpolygon=763 SphericalPointDistribution::Polygon_t expected = 814 764 SPD.get<4>(); 815 SphericalPointDistribution::Polygon_t expected = newpolygon;816 765 expected.pop_front(); // remove first point 817 766 expected.pop_front(); // remove second point … … 821 770 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 822 771 SphericalPointDistribution::Polygon_t remaining = 823 SphericalPointDistribution::matchSphericalPointDistributions( 824 polygon, 825 newpolygon); 826 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 827 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 828 // also slightly perturbed 829 const double amplitude = 0.05; 830 perturbPolygon(polygon, amplitude); 831 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 832 } 833 } 834 835 /** UnitTest for matchSphericalPointDistributions() with four points and weights 772 SPD.getRemainingPoints(polygon, 4); 773 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 774 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 775 // also slightly perturbed 776 const double amplitude = 0.05; 777 perturbPolygon(polygon, amplitude); 778 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 779 } 780 } 781 782 /** UnitTest for getRemainingPoints() with four points and weights 836 783 * not all equal to one. 837 784 */ 838 void SphericalPointDistributionTest:: matchSphericalPointDistributionsTest_multiple()785 void SphericalPointDistributionTest::getRemainingPointsTest_multiple() 839 786 { 840 787 SphericalPointDistribution SPD(1.); … … 850 797 expected += Vector(-0.5773502691896,-5.551115123126e-17,-0.8164965809277); 851 798 SphericalPointDistribution::Polygon_t remaining = 852 SphericalPointDistribution::matchSphericalPointDistributions( 853 polygon, 854 newpolygon); 799 SPD.getRemainingPoints(polygon, 4); 855 800 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 856 801 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 869 814 expected += Vector(-0.3535533905933,-0.3535533905933,-0.8660254037844); 870 815 SphericalPointDistribution::Polygon_t remaining = 871 SphericalPointDistribution::matchSphericalPointDistributions( 872 polygon, 873 newpolygon); 874 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 816 SPD.getRemainingPoints(polygon, 5); 817 std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 875 818 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 876 819 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 889 832 expected += Vector(0.3535534025157,-0.3535533856548,0.8660254009332); 890 833 SphericalPointDistribution::Polygon_t remaining = 891 SphericalPointDistribution::matchSphericalPointDistributions( 892 polygon, 893 newpolygon); 834 SPD.getRemainingPoints(polygon, 5); 894 835 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 895 836 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 905 846 SPD.get<6>(); 906 847 SphericalPointDistribution::Polygon_t expected; 848 expected += Vector(0.,0.,1.); 907 849 expected += Vector(0.,0.,-1.); 908 expected += Vector(0.,0.,1.); 909 SphericalPointDistribution::Polygon_t remaining = 910 SphericalPointDistribution::matchSphericalPointDistributions( 911 polygon, 912 newpolygon); 850 SphericalPointDistribution::Polygon_t remaining = 851 SPD.getRemainingPoints(polygon, 6); 913 852 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 914 853 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 917 856 } 918 857 919 /** UnitTest for matchSphericalPointDistributions() with five points920 */ 921 void SphericalPointDistributionTest:: matchSphericalPointDistributionsTest_5()858 /** UnitTest for getRemainingPoints() with five points 859 */ 860 void SphericalPointDistributionTest::getRemainingPointsTest_5() 922 861 { 923 862 SphericalPointDistribution SPD(1.); … … 927 866 SphericalPointDistribution::WeightedPolygon_t polygon; 928 867 polygon += std::make_pair( Vector(1.,0.,0.), 1); 929 SphericalPointDistribution::Polygon_t newpolygon=868 SphericalPointDistribution::Polygon_t expected = 930 869 SPD.get<5>(); 931 SphericalPointDistribution::Polygon_t expected = newpolygon; 932 expected.pop_front(); // remove first point 933 SphericalPointDistribution::Polygon_t remaining = 934 SphericalPointDistribution::matchSphericalPointDistributions( 935 polygon, 936 newpolygon); 870 expected.pop_front(); // remove first point 871 SphericalPointDistribution::Polygon_t remaining = 872 SPD.getRemainingPoints(polygon, 5); 937 873 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 938 874 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 943 879 SphericalPointDistribution::WeightedPolygon_t polygon; 944 880 polygon += std::make_pair( Vector(0.,1.,0.), 1); 945 SphericalPointDistribution::Polygon_t newpolygon=881 SphericalPointDistribution::Polygon_t expected = 946 882 SPD.get<5>(); 947 SphericalPointDistribution::Polygon_t expected = newpolygon;948 883 expected.pop_front(); // remove first point 949 884 for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin(); … … 953 888 } 954 889 SphericalPointDistribution::Polygon_t remaining = 955 SphericalPointDistribution::matchSphericalPointDistributions( 956 polygon, 957 newpolygon); 890 SPD.getRemainingPoints(polygon, 5); 958 891 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 959 892 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 965 898 polygon += std::make_pair( Vector(1.,0.,0.), 1); 966 899 polygon += std::make_pair( Vector(-1.,0.,0.), 1); 967 SphericalPointDistribution::Polygon_t newpolygon=900 SphericalPointDistribution::Polygon_t expected = 968 901 SPD.get<5>(); 969 SphericalPointDistribution::Polygon_t expected = newpolygon; 970 expected.pop_front(); // remove first point 971 expected.pop_front(); // remove second point 972 SphericalPointDistribution::Polygon_t remaining = 973 SphericalPointDistribution::matchSphericalPointDistributions( 974 polygon, 975 newpolygon); 902 expected.pop_front(); // remove first point 903 expected.pop_front(); // remove second point 904 SphericalPointDistribution::Polygon_t remaining = 905 SPD.getRemainingPoints(polygon, 5); 976 906 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 977 907 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 988 918 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180.*M_PI), 1); 989 919 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180.*M_PI), 1); 990 SphericalPointDistribution::Polygon_t newpolygon=920 SphericalPointDistribution::Polygon_t expected = 991 921 SPD.get<5>(); 992 SphericalPointDistribution::Polygon_t expected = newpolygon;993 922 expected.pop_front(); // remove first point 994 923 expected.pop_front(); // remove second point … … 997 926 *iter = RotationAxis.rotateVector(*iter, 47.6/180.*M_PI); 998 927 SphericalPointDistribution::Polygon_t remaining = 999 SphericalPointDistribution::matchSphericalPointDistributions( 1000 polygon, 1001 newpolygon); 928 SPD.getRemainingPoints(polygon, 5); 1002 929 // the three remaining points sit on a plane that may be rotated arbitrarily 1003 930 // so we cannot simply check for equality between expected and remaining … … 1019 946 polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1); 1020 947 polygon += std::make_pair( Vector(0.0, 1., 0.0), 1); 1021 SphericalPointDistribution::Polygon_t newpolygon=948 SphericalPointDistribution::Polygon_t expected = 1022 949 SPD.get<5>(); 1023 SphericalPointDistribution::Polygon_t expected = newpolygon;1024 950 expected.pop_front(); // remove first point 1025 951 expected.pop_front(); // remove second point 1026 952 expected.pop_front(); // remove third point 1027 953 SphericalPointDistribution::Polygon_t remaining = 1028 SphericalPointDistribution::matchSphericalPointDistributions( 1029 polygon, 1030 newpolygon); 954 SPD.getRemainingPoints(polygon, 5); 1031 955 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1032 956 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1044 968 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1); 1045 969 polygon += std::make_pair(RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI), 1); 1046 SphericalPointDistribution::Polygon_t newpolygon=970 SphericalPointDistribution::Polygon_t expected = 1047 971 SPD.get<5>(); 1048 SphericalPointDistribution::Polygon_t expected = newpolygon;1049 972 expected.pop_front(); // remove first point 1050 973 expected.pop_front(); // remove second point … … 1054 977 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1055 978 SphericalPointDistribution::Polygon_t remaining = 1056 SphericalPointDistribution::matchSphericalPointDistributions( 1057 polygon, 1058 newpolygon); 1059 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1060 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1061 // also slightly perturbed 1062 const double amplitude = 0.05; 1063 perturbPolygon(polygon, amplitude); 1064 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1065 } 1066 } 1067 1068 /** UnitTest for matchSphericalPointDistributions() with six points 1069 */ 1070 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_6() 979 SPD.getRemainingPoints(polygon, 5); 980 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 981 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 982 // also slightly perturbed 983 const double amplitude = 0.05; 984 perturbPolygon(polygon, amplitude); 985 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 986 } 987 } 988 989 /** UnitTest for getRemainingPoints() with six points 990 */ 991 void SphericalPointDistributionTest::getRemainingPointsTest_6() 1071 992 { 1072 993 SphericalPointDistribution SPD(1.); … … 1076 997 SphericalPointDistribution::WeightedPolygon_t polygon; 1077 998 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1078 SphericalPointDistribution::Polygon_t newpolygon=999 SphericalPointDistribution::Polygon_t expected = 1079 1000 SPD.get<6>(); 1080 SphericalPointDistribution::Polygon_t expected = newpolygon; 1081 expected.pop_front(); // remove first point 1082 SphericalPointDistribution::Polygon_t remaining = 1083 SphericalPointDistribution::matchSphericalPointDistributions( 1084 polygon, 1085 newpolygon); 1001 expected.pop_front(); // remove first point 1002 SphericalPointDistribution::Polygon_t remaining = 1003 SPD.getRemainingPoints(polygon, 6); 1086 1004 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1087 1005 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1092 1010 SphericalPointDistribution::WeightedPolygon_t polygon; 1093 1011 polygon += std::make_pair( Vector(0.,1.,0.), 1); 1094 SphericalPointDistribution::Polygon_t newpolygon=1012 SphericalPointDistribution::Polygon_t expected = 1095 1013 SPD.get<6>(); 1096 SphericalPointDistribution::Polygon_t expected = newpolygon;1097 1014 expected.pop_front(); // remove first point 1098 1015 for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin(); … … 1102 1019 } 1103 1020 SphericalPointDistribution::Polygon_t remaining = 1104 SphericalPointDistribution::matchSphericalPointDistributions( 1105 polygon, 1106 newpolygon); 1021 SPD.getRemainingPoints(polygon, 6); 1107 1022 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1108 1023 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1114 1029 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1115 1030 polygon += std::make_pair( Vector(-1.,0.,0.), 1); 1116 SphericalPointDistribution::Polygon_t newpolygon=1031 SphericalPointDistribution::Polygon_t expected = 1117 1032 SPD.get<6>(); 1118 SphericalPointDistribution::Polygon_t expected = newpolygon;1119 1033 expected.pop_front(); // remove first point 1120 1034 expected.pop_front(); // remove second spoint 1121 1035 SphericalPointDistribution::Polygon_t remaining = 1122 SphericalPointDistribution::matchSphericalPointDistributions( 1123 polygon, 1124 newpolygon); 1036 SPD.getRemainingPoints(polygon, 6); 1125 1037 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1126 1038 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1137 1049 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 1138 1050 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI), 1); 1139 SphericalPointDistribution::Polygon_t newpolygon=1051 SphericalPointDistribution::Polygon_t expected = 1140 1052 SPD.get<6>(); 1141 SphericalPointDistribution::Polygon_t expected = newpolygon;1142 1053 expected.pop_front(); // remove first point 1143 1054 expected.pop_front(); // remove second spoint … … 1146 1057 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1147 1058 SphericalPointDistribution::Polygon_t remaining = 1148 SphericalPointDistribution::matchSphericalPointDistributions( 1149 polygon, 1150 newpolygon); 1059 SPD.getRemainingPoints(polygon, 6); 1151 1060 // the four remaining points sit on a plane that may have been rotated arbitrarily 1152 1061 // so we cannot simply check for equality between expected and remaining … … 1168 1077 polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1); 1169 1078 polygon += std::make_pair( Vector(0.0, 1., 0.0), 1); 1170 SphericalPointDistribution::Polygon_t newpolygon=1079 SphericalPointDistribution::Polygon_t expected = 1171 1080 SPD.get<6>(); 1172 SphericalPointDistribution::Polygon_t expected = newpolygon;1173 1081 expected.pop_front(); // remove first point 1174 1082 expected.pop_front(); // remove second point 1175 1083 expected.pop_front(); // remove third point 1176 1084 SphericalPointDistribution::Polygon_t remaining = 1177 SphericalPointDistribution::matchSphericalPointDistributions( 1178 polygon, 1179 newpolygon); 1085 SPD.getRemainingPoints(polygon, 6); 1180 1086 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1181 1087 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1193 1099 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1); 1194 1100 polygon += std::make_pair(RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI), 1); 1195 SphericalPointDistribution::Polygon_t newpolygon=1101 SphericalPointDistribution::Polygon_t expected = 1196 1102 SPD.get<6>(); 1197 SphericalPointDistribution::Polygon_t expected = newpolygon;1198 1103 expected.pop_front(); // remove first point 1199 1104 expected.pop_front(); // remove second point … … 1203 1108 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1204 1109 SphericalPointDistribution::Polygon_t remaining = 1205 SphericalPointDistribution::matchSphericalPointDistributions( 1206 polygon, 1207 newpolygon); 1208 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1209 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1210 // also slightly perturbed 1211 const double amplitude = 0.05; 1212 perturbPolygon(polygon, amplitude); 1213 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1214 } 1215 } 1216 1217 /** UnitTest for matchSphericalPointDistributions() with seven points 1218 */ 1219 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_7() 1110 SPD.getRemainingPoints(polygon, 6); 1111 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1112 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1113 // also slightly perturbed 1114 const double amplitude = 0.05; 1115 perturbPolygon(polygon, amplitude); 1116 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1117 } 1118 } 1119 1120 /** UnitTest for getRemainingPoints() with seven points 1121 */ 1122 void SphericalPointDistributionTest::getRemainingPointsTest_7() 1220 1123 { 1221 1124 SphericalPointDistribution SPD(1.); … … 1225 1128 SphericalPointDistribution::WeightedPolygon_t polygon; 1226 1129 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1227 SphericalPointDistribution::Polygon_t newpolygon=1130 SphericalPointDistribution::Polygon_t expected = 1228 1131 SPD.get<7>(); 1229 SphericalPointDistribution::Polygon_t expected = newpolygon; 1230 expected.pop_front(); // remove first point 1231 SphericalPointDistribution::Polygon_t remaining = 1232 SphericalPointDistribution::matchSphericalPointDistributions( 1233 polygon, 1234 newpolygon); 1132 expected.pop_front(); // remove first point 1133 SphericalPointDistribution::Polygon_t remaining = 1134 SPD.getRemainingPoints(polygon, 7); 1235 1135 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1236 1136 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1241 1141 SphericalPointDistribution::WeightedPolygon_t polygon; 1242 1142 polygon += std::make_pair( Vector(0.,1.,0.), 1); 1243 SphericalPointDistribution::Polygon_t newpolygon=1143 SphericalPointDistribution::Polygon_t expected = 1244 1144 SPD.get<7>(); 1245 SphericalPointDistribution::Polygon_t expected = newpolygon;1246 1145 expected.pop_front(); // remove first point 1247 1146 for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin(); … … 1251 1150 } 1252 1151 SphericalPointDistribution::Polygon_t remaining = 1253 SphericalPointDistribution::matchSphericalPointDistributions( 1254 polygon, 1255 newpolygon); 1152 SPD.getRemainingPoints(polygon, 7); 1256 1153 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1257 1154 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1263 1160 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1264 1161 polygon += std::make_pair( Vector(-1.,0.,0.), 1); 1265 SphericalPointDistribution::Polygon_t newpolygon=1162 SphericalPointDistribution::Polygon_t expected = 1266 1163 SPD.get<7>(); 1267 SphericalPointDistribution::Polygon_t expected = newpolygon; 1268 expected.pop_front(); // remove first point 1269 expected.pop_front(); // remove second point 1270 SphericalPointDistribution::Polygon_t remaining = 1271 SphericalPointDistribution::matchSphericalPointDistributions( 1272 polygon, 1273 newpolygon); 1164 expected.pop_front(); // remove first point 1165 expected.pop_front(); // remove second point 1166 SphericalPointDistribution::Polygon_t remaining = 1167 SPD.getRemainingPoints(polygon, 7); 1274 1168 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1275 1169 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1286 1180 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 1287 1181 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI), 1); 1288 SphericalPointDistribution::Polygon_t newpolygon=1182 SphericalPointDistribution::Polygon_t expected = 1289 1183 SPD.get<7>(); 1290 SphericalPointDistribution::Polygon_t expected = newpolygon;1291 1184 expected.pop_front(); // remove first point 1292 1185 expected.pop_front(); // remove second point … … 1295 1188 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1296 1189 SphericalPointDistribution::Polygon_t remaining = 1297 SphericalPointDistribution::matchSphericalPointDistributions( 1298 polygon, 1299 newpolygon); 1190 SPD.getRemainingPoints(polygon, 7); 1300 1191 // the five remaining points sit on a plane that may have been rotated arbitrarily 1301 1192 // so we cannot simply check for equality between expected and remaining … … 1317 1208 polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1); 1318 1209 polygon += std::make_pair( Vector(0.0, 1., 0.0), 1); 1319 SphericalPointDistribution::Polygon_t newpolygon=1210 SphericalPointDistribution::Polygon_t expected = 1320 1211 SPD.get<7>(); 1321 SphericalPointDistribution::Polygon_t expected = newpolygon;1322 1212 expected.pop_front(); // remove first point 1323 1213 expected.pop_front(); // remove second point 1324 1214 expected.pop_front(); // remove third point 1325 1215 SphericalPointDistribution::Polygon_t remaining = 1326 SphericalPointDistribution::matchSphericalPointDistributions( 1327 polygon, 1328 newpolygon); 1216 SPD.getRemainingPoints(polygon, 7); 1329 1217 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1330 1218 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1342 1230 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1); 1343 1231 polygon += std::make_pair(RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI), 1); 1344 SphericalPointDistribution::Polygon_t newpolygon=1232 SphericalPointDistribution::Polygon_t expected = 1345 1233 SPD.get<7>(); 1346 SphericalPointDistribution::Polygon_t expected = newpolygon;1347 1234 expected.pop_front(); // remove first point 1348 1235 expected.pop_front(); // remove second point … … 1352 1239 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1353 1240 SphericalPointDistribution::Polygon_t remaining = 1354 SphericalPointDistribution::matchSphericalPointDistributions( 1355 polygon, 1356 newpolygon); 1357 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1358 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1359 // also slightly perturbed 1360 const double amplitude = 0.05; 1361 perturbPolygon(polygon, amplitude); 1362 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1363 } 1364 } 1365 1366 /** UnitTest for matchSphericalPointDistributions() with eight points 1367 */ 1368 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_8() 1241 SPD.getRemainingPoints(polygon, 7); 1242 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1243 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1244 // also slightly perturbed 1245 const double amplitude = 0.05; 1246 perturbPolygon(polygon, amplitude); 1247 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1248 } 1249 } 1250 1251 /** UnitTest for getRemainingPoints() with eight points 1252 */ 1253 void SphericalPointDistributionTest::getRemainingPointsTest_8() 1369 1254 { 1370 1255 SphericalPointDistribution SPD(1.); … … 1374 1259 SphericalPointDistribution::WeightedPolygon_t polygon; 1375 1260 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1376 SphericalPointDistribution::Polygon_t newpolygon=1261 SphericalPointDistribution::Polygon_t expected = 1377 1262 SPD.get<8>(); 1378 SphericalPointDistribution::Polygon_t expected = newpolygon; 1379 expected.pop_front(); // remove first point 1380 SphericalPointDistribution::Polygon_t remaining = 1381 SphericalPointDistribution::matchSphericalPointDistributions( 1382 polygon, 1383 newpolygon); 1263 expected.pop_front(); // remove first point 1264 SphericalPointDistribution::Polygon_t remaining = 1265 SPD.getRemainingPoints(polygon, 8); 1384 1266 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1385 1267 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1390 1272 SphericalPointDistribution::WeightedPolygon_t polygon; 1391 1273 polygon += std::make_pair( Vector(0.,1.,0.), 1); 1392 SphericalPointDistribution::Polygon_t newpolygon=1274 SphericalPointDistribution::Polygon_t expected = 1393 1275 SPD.get<8>(); 1394 SphericalPointDistribution::Polygon_t expected = newpolygon;1395 1276 expected.pop_front(); // remove first point 1396 1277 for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin(); … … 1399 1280 (*iter)[0] *= -1.; 1400 1281 } 1401 SphericalPointDistribution::Polygon_t remaining = 1402 SphericalPointDistribution::matchSphericalPointDistributions( 1403 polygon, 1404 newpolygon); 1282 SphericalPointDistribution::Polygon_t remaining = 1283 SPD.getRemainingPoints(polygon, 8); 1405 1284 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1406 1285 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1412 1291 polygon += std::make_pair( Vector(1.,0.,0.), 1); 1413 1292 polygon += std::make_pair( Vector(-1.,0.,0.), 1); 1414 SphericalPointDistribution::Polygon_t newpolygon=1293 SphericalPointDistribution::Polygon_t expected = 1415 1294 SPD.get<8>(); 1416 SphericalPointDistribution::Polygon_t expected = newpolygon; 1417 expected.pop_front(); // remove first point 1418 expected.pop_front(); // remove second point 1419 SphericalPointDistribution::Polygon_t remaining = 1420 SphericalPointDistribution::matchSphericalPointDistributions( 1421 polygon, 1422 newpolygon); 1295 expected.pop_front(); // remove first point 1296 expected.pop_front(); // remove second point 1297 SphericalPointDistribution::Polygon_t remaining = 1298 SPD.getRemainingPoints(polygon, 8); 1423 1299 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1424 1300 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1435 1311 polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1); 1436 1312 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI), 1); 1437 SphericalPointDistribution::Polygon_t newpolygon=1313 SphericalPointDistribution::Polygon_t expected = 1438 1314 SPD.get<8>(); 1439 SphericalPointDistribution::Polygon_t expected = newpolygon;1440 1315 expected.pop_front(); // remove first point 1441 1316 expected.pop_front(); // remove second point … … 1444 1319 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1445 1320 SphericalPointDistribution::Polygon_t remaining = 1446 SphericalPointDistribution::matchSphericalPointDistributions( 1447 polygon, 1448 newpolygon); 1321 SPD.getRemainingPoints(polygon, 8); 1449 1322 // the six remaining points sit on two planes that may have been rotated arbitrarily 1450 1323 // so we cannot simply check for equality between expected and remaining … … 1470 1343 polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1); 1471 1344 polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0, 0.0), 1); 1472 SphericalPointDistribution::Polygon_t newpolygon=1345 SphericalPointDistribution::Polygon_t expected = 1473 1346 SPD.get<8>(); 1474 SphericalPointDistribution::Polygon_t expected = newpolygon;1475 1347 expected.pop_front(); // remove first point 1476 1348 expected.pop_front(); // remove second point 1477 1349 expected.pop_front(); // remove third point 1478 1350 SphericalPointDistribution::Polygon_t remaining = 1479 SphericalPointDistribution::matchSphericalPointDistributions( 1480 polygon, 1481 newpolygon); 1351 SPD.getRemainingPoints(polygon, 8); 1482 1352 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1483 1353 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1495 1365 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1); 1496 1366 polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0, 0.0), 47.6/180*M_PI), 1); 1497 SphericalPointDistribution::Polygon_t newpolygon=1367 SphericalPointDistribution::Polygon_t expected = 1498 1368 SPD.get<8>(); 1499 SphericalPointDistribution::Polygon_t expected = newpolygon;1500 1369 expected.pop_front(); // remove first point 1501 1370 expected.pop_front(); // remove second point … … 1505 1374 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1506 1375 SphericalPointDistribution::Polygon_t remaining = 1507 SphericalPointDistribution::matchSphericalPointDistributions( 1508 polygon, 1509 newpolygon); 1510 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1511 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1512 // also slightly perturbed 1513 const double amplitude = 0.05; 1514 perturbPolygon(polygon, amplitude); 1515 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1516 } 1517 } 1376 SPD.getRemainingPoints(polygon, 8); 1377 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1378 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1379 // also slightly perturbed 1380 const double amplitude = 0.05; 1381 perturbPolygon(polygon, amplitude); 1382 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1383 } 1384 }
Note:
See TracChangeset
for help on using the changeset viewer.
