Ignore:
Timestamp:
May 25, 2016, 7:13:59 AM (9 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

recurseMatching() now takes connections into account.

  • matchSphericalPointDistribution() replaced by getRemainingPoints() as that describes what it does. match...() sounds symmetrical which the function is no longer as connection is associated with former _newpolygon.
  • SphericalPointDistribution now has internal points and adjacency, initialized by initSelf().
  • findBestMatching() and getRemainingPoints() are no longer static functions.
  • all unit tests are working again, including the .._multiple() that tests for joint points due to bond degree greater than 1.
  • the huge case switch in SaturatedFragment::saturateAtom() now resides in initSelf().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp

    ra52369 r9cf90e  
    612612}
    613613
    614 /** UnitTest for matchSphericalPointDistributions() with two points
    615  */
    616 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_2()
     614/** UnitTest for getRemainingPoints() with two points
     615 */
     616void SphericalPointDistributionTest::getRemainingPointsTest_2()
    617617{
    618618  SphericalPointDistribution SPD(1.);
     
    621621    SphericalPointDistribution::WeightedPolygon_t polygon;
    622622    polygon += std::make_pair(Vector(1.,0.,0.), 1);
    623     SphericalPointDistribution::Polygon_t newpolygon =
    624         SPD.get<2>();
    625623    SphericalPointDistribution::Polygon_t expected;
    626624    expected += Vector(-1.,0.,0.);
    627625    SphericalPointDistribution::Polygon_t remaining =
    628         SphericalPointDistribution::matchSphericalPointDistributions(
    629             polygon,
    630             newpolygon);
     626        SPD.getRemainingPoints(polygon, 2);
    631627//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    632628    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    637633    SphericalPointDistribution::WeightedPolygon_t polygon;
    638634    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    639     SphericalPointDistribution::Polygon_t newpolygon =
    640         SPD.get<2>();
    641635    SphericalPointDistribution::Polygon_t expected;
    642636    expected += Vector(0.,-1.,0.);
    643637    SphericalPointDistribution::Polygon_t remaining =
    644         SphericalPointDistribution::matchSphericalPointDistributions(
    645             polygon,
    646             newpolygon);
     638        SPD.getRemainingPoints(polygon, 2);
    647639//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    648640    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    653645    SphericalPointDistribution::WeightedPolygon_t polygon;
    654646    polygon += std::make_pair( Vector(0.,0.,-1.), 1);
    655     SphericalPointDistribution::Polygon_t newpolygon =
    656         SPD.get<2>();
    657647    SphericalPointDistribution::Polygon_t expected;
    658648    expected += Vector(0.,0.,1.);
    659649    SphericalPointDistribution::Polygon_t remaining =
    660         SphericalPointDistribution::matchSphericalPointDistributions(
    661             polygon,
    662             newpolygon);
     650        SPD.getRemainingPoints(polygon, 2);
    663651//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    664652    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    670658    SphericalPointDistribution::WeightedPolygon_t polygon;
    671659    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>();
    674660    SphericalPointDistribution::Polygon_t expected;
    675661    expected += RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI);
    676662    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 */
     671void SphericalPointDistributionTest::getRemainingPointsTest_3()
    688672{
    689673  SphericalPointDistribution SPD(1.);
     
    693677    SphericalPointDistribution::WeightedPolygon_t polygon;
    694678    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    695     SphericalPointDistribution::Polygon_t newpolygon =
     679    SphericalPointDistribution::Polygon_t expected =
    696680        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);
    703684//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    704685    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    709690    SphericalPointDistribution::WeightedPolygon_t polygon;
    710691    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    711     SphericalPointDistribution::Polygon_t newpolygon =
     692    SphericalPointDistribution::Polygon_t expected =
    712693        SPD.get<3>();
    713     SphericalPointDistribution::Polygon_t expected = newpolygon;
    714694    expected.pop_front(); // remove first point
    715695    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
     
    719699    }
    720700    SphericalPointDistribution::Polygon_t remaining =
    721         SphericalPointDistribution::matchSphericalPointDistributions(
    722             polygon,
    723             newpolygon);
     701        SPD.getRemainingPoints(polygon, 3);
    724702//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    725703    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    731709    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    732710    polygon += std::make_pair( Vector(-0.5, sqrt(3)*0.5,0.), 1);
    733     SphericalPointDistribution::Polygon_t newpolygon =
     711    SphericalPointDistribution::Polygon_t expected =
    734712        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);
    742717//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    743718    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    754729    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
    755730    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 =
    757732        SPD.get<3>();
    758     SphericalPointDistribution::Polygon_t expected = newpolygon;
    759733    expected.pop_front(); // remove first point
    760734    expected.pop_front(); // remove second point
     
    763737      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    764738    SphericalPointDistribution::Polygon_t remaining =
    765         SphericalPointDistribution::matchSphericalPointDistributions(
    766             polygon,
    767             newpolygon);
     739        SPD.getRemainingPoints(polygon, 3);
    768740//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    769741    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    784756    SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant
    785757    SphericalPointDistribution::Polygon_t remaining =
    786         SphericalPointDistribution::matchSphericalPointDistributions(
    787             polygon,
    788             newpolygon);
     758        SPD.getRemainingPoints(polygon, 3);
    789759//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    790760    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    807777    SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant
    808778    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 */
     791void SphericalPointDistributionTest::getRemainingPointsTest_4()
    824792{
    825793  SphericalPointDistribution SPD(1.);
     
    829797    SphericalPointDistribution::WeightedPolygon_t polygon;
    830798    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    831     SphericalPointDistribution::Polygon_t newpolygon =
     799    SphericalPointDistribution::Polygon_t expected =
    832800        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);
    839804    //    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    840805        CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    845810    SphericalPointDistribution::WeightedPolygon_t polygon;
    846811    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    847     SphericalPointDistribution::Polygon_t newpolygon =
     812    SphericalPointDistribution::Polygon_t expected =
    848813        SPD.get<4>();
    849     SphericalPointDistribution::Polygon_t expected = newpolygon;
    850814    expected.pop_front(); // remove first point
    851815    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
     
    855819    }
    856820    SphericalPointDistribution::Polygon_t remaining =
    857         SphericalPointDistribution::matchSphericalPointDistributions(
    858             polygon,
    859             newpolygon);
     821        SPD.getRemainingPoints(polygon, 4);
    860822//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    861823    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    867829    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    868830    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 =
    870832        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);
    878837//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    879838    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    889848    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    890849    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 =
    892851        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);
    900856//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    901857    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    912868    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
    913869    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 =
    915871        SPD.get<4>();
    916     SphericalPointDistribution::Polygon_t expected = newpolygon;
    917872    expected.pop_front(); // remove first point
    918873    expected.pop_front(); // remove second point
     
    921876      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    922877    SphericalPointDistribution::Polygon_t remaining =
    923         SphericalPointDistribution::matchSphericalPointDistributions(
    924             polygon,
    925             newpolygon);
     878        SPD.getRemainingPoints(polygon, 4);
    926879//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    927880    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    938891    polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 1);
    939892    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 =
    941894        SPD.get<4>();
    942     SphericalPointDistribution::Polygon_t expected = newpolygon;
    943895    expected.pop_front(); // remove first point
    944896    expected.pop_front(); // remove second point
    945897    expected.pop_front(); // remove third point
    946898    SphericalPointDistribution::Polygon_t remaining =
    947         SphericalPointDistribution::matchSphericalPointDistributions(
    948             polygon,
    949             newpolygon);
     899        SPD.getRemainingPoints(polygon, 4);
    950900//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    951901    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    963913    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 47.6/180*M_PI), 1);
    964914    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 =
    966916        SPD.get<4>();
    967     SphericalPointDistribution::Polygon_t expected = newpolygon;
    968917    expected.pop_front(); // remove first point
    969918    expected.pop_front(); // remove second point
     
    973922      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    974923    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
    988935 * not all equal to one.
    989936 */
    990 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_multiple()
     937void SphericalPointDistributionTest::getRemainingPointsTest_multiple()
    991938{
    992939  SphericalPointDistribution SPD(1.);
     
    1002949    expected += Vector(-0.5773502691896,-5.551115123126e-17,-0.8164965809277);
    1003950    SphericalPointDistribution::Polygon_t remaining =
    1004         SphericalPointDistribution::matchSphericalPointDistributions(
    1005             polygon,
    1006             newpolygon);
     951        SPD.getRemainingPoints(polygon, 4);
    1007952//    std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl;
    1008953//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
     
    1021966    expected += Vector(-0.3535533905933,-0.3535533905933,-0.8660254037844);
    1022967    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;
    1027970//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    1028971    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    1041984    expected += Vector(0.3535534025157,-0.3535533856548,0.8660254009332);
    1042985    SphericalPointDistribution::Polygon_t remaining =
    1043         SphericalPointDistribution::matchSphericalPointDistributions(
    1044             polygon,
    1045             newpolygon);
     986        SPD.getRemainingPoints(polygon, 5);
    1046987//    std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl;
    1047988//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
     
    1057998        SPD.get<6>();
    1058999    SphericalPointDistribution::Polygon_t expected;
     1000    expected += Vector(0.,0.,1.);
    10591001    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);
    10651004//    std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl;
    10661005//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
     
    10691008}
    10701009
    1071 /** UnitTest for matchSphericalPointDistributions() with five points
    1072  */
    1073 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_5()
     1010/** UnitTest for getRemainingPoints() with five points
     1011 */
     1012void SphericalPointDistributionTest::getRemainingPointsTest_5()
    10741013{
    10751014  SphericalPointDistribution SPD(1.);
     
    10791018    SphericalPointDistribution::WeightedPolygon_t polygon;
    10801019    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    1081     SphericalPointDistribution::Polygon_t newpolygon =
     1020    SphericalPointDistribution::Polygon_t expected =
    10821021        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);
    10891025//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    10901026    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    10951031    SphericalPointDistribution::WeightedPolygon_t polygon;
    10961032    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    1097     SphericalPointDistribution::Polygon_t newpolygon =
     1033    SphericalPointDistribution::Polygon_t expected =
    10981034        SPD.get<5>();
    1099     SphericalPointDistribution::Polygon_t expected = newpolygon;
    11001035    expected.pop_front(); // remove first point
    11011036    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
     
    11051040    }
    11061041    SphericalPointDistribution::Polygon_t remaining =
    1107         SphericalPointDistribution::matchSphericalPointDistributions(
    1108             polygon,
    1109             newpolygon);
     1042        SPD.getRemainingPoints(polygon, 5);
    11101043//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    11111044    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    11171050    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    11181051    polygon += std::make_pair( Vector(-1.,0.,0.), 1);
    1119     SphericalPointDistribution::Polygon_t newpolygon =
     1052    SphericalPointDistribution::Polygon_t expected =
    11201053        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);
    11281058//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    11291059    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    11401070    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180.*M_PI), 1);
    11411071    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 =
    11431073        SPD.get<5>();
    1144     SphericalPointDistribution::Polygon_t expected = newpolygon;
    11451074    expected.pop_front(); // remove first point
    11461075    expected.pop_front(); // remove second point
     
    11491078      *iter = RotationAxis.rotateVector(*iter, 47.6/180.*M_PI);
    11501079    SphericalPointDistribution::Polygon_t remaining =
    1151         SphericalPointDistribution::matchSphericalPointDistributions(
    1152             polygon,
    1153             newpolygon);
     1080        SPD.getRemainingPoints(polygon, 5);
    11541081    // the three remaining points sit on a plane that may be rotated arbitrarily
    11551082    // so we cannot simply check for equality between expected and remaining
     
    11711098    polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1);
    11721099    polygon += std::make_pair( Vector(0.0, 1., 0.0), 1);
    1173     SphericalPointDistribution::Polygon_t newpolygon =
     1100    SphericalPointDistribution::Polygon_t expected =
    11741101        SPD.get<5>();
    1175     SphericalPointDistribution::Polygon_t expected = newpolygon;
    11761102    expected.pop_front(); // remove first point
    11771103    expected.pop_front(); // remove second point
    11781104    expected.pop_front(); // remove third point
    11791105    SphericalPointDistribution::Polygon_t remaining =
    1180         SphericalPointDistribution::matchSphericalPointDistributions(
    1181             polygon,
    1182             newpolygon);
     1106        SPD.getRemainingPoints(polygon, 5);
    11831107//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    11841108    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    11961120    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1);
    11971121    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 =
    11991123        SPD.get<5>();
    1200     SphericalPointDistribution::Polygon_t expected = newpolygon;
    12011124    expected.pop_front(); // remove first point
    12021125    expected.pop_front(); // remove second point
     
    12061129      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    12071130    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 */
     1143void SphericalPointDistributionTest::getRemainingPointsTest_6()
    12231144{
    12241145  SphericalPointDistribution SPD(1.);
     
    12281149    SphericalPointDistribution::WeightedPolygon_t polygon;
    12291150    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    1230     SphericalPointDistribution::Polygon_t newpolygon =
     1151    SphericalPointDistribution::Polygon_t expected =
    12311152        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);
    12381156//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    12391157    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    12441162    SphericalPointDistribution::WeightedPolygon_t polygon;
    12451163    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    1246     SphericalPointDistribution::Polygon_t newpolygon =
     1164    SphericalPointDistribution::Polygon_t expected =
    12471165        SPD.get<6>();
    1248     SphericalPointDistribution::Polygon_t expected = newpolygon;
    12491166    expected.pop_front(); // remove first point
    12501167    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
     
    12541171    }
    12551172    SphericalPointDistribution::Polygon_t remaining =
    1256         SphericalPointDistribution::matchSphericalPointDistributions(
    1257             polygon,
    1258             newpolygon);
     1173        SPD.getRemainingPoints(polygon, 6);
    12591174//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    12601175    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    12661181    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    12671182    polygon += std::make_pair( Vector(-1.,0.,0.), 1);
    1268     SphericalPointDistribution::Polygon_t newpolygon =
     1183    SphericalPointDistribution::Polygon_t expected =
    12691184        SPD.get<6>();
    1270     SphericalPointDistribution::Polygon_t expected = newpolygon;
    12711185    expected.pop_front(); // remove first point
    12721186    expected.pop_front(); // remove second spoint
    12731187    SphericalPointDistribution::Polygon_t remaining =
    1274         SphericalPointDistribution::matchSphericalPointDistributions(
    1275             polygon,
    1276             newpolygon);
     1188        SPD.getRemainingPoints(polygon, 6);
    12771189//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    12781190    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    12891201    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
    12901202    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 =
    12921204        SPD.get<6>();
    1293     SphericalPointDistribution::Polygon_t expected = newpolygon;
    12941205    expected.pop_front(); // remove first point
    12951206    expected.pop_front(); // remove second spoint
     
    12981209      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    12991210    SphericalPointDistribution::Polygon_t remaining =
    1300         SphericalPointDistribution::matchSphericalPointDistributions(
    1301             polygon,
    1302             newpolygon);
     1211        SPD.getRemainingPoints(polygon, 6);
    13031212    // the four remaining points sit on a plane that may have been rotated arbitrarily
    13041213    // so we cannot simply check for equality between expected and remaining
     
    13201229    polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1);
    13211230    polygon += std::make_pair( Vector(0.0, 1., 0.0), 1);
    1322     SphericalPointDistribution::Polygon_t newpolygon =
     1231    SphericalPointDistribution::Polygon_t expected =
    13231232        SPD.get<6>();
    1324     SphericalPointDistribution::Polygon_t expected = newpolygon;
    13251233    expected.pop_front(); // remove first point
    13261234    expected.pop_front(); // remove second point
    13271235    expected.pop_front(); // remove third point
    13281236    SphericalPointDistribution::Polygon_t remaining =
    1329         SphericalPointDistribution::matchSphericalPointDistributions(
    1330             polygon,
    1331             newpolygon);
     1237        SPD.getRemainingPoints(polygon, 6);
    13321238//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    13331239    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    13451251    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1);
    13461252    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 =
    13481254        SPD.get<6>();
    1349     SphericalPointDistribution::Polygon_t expected = newpolygon;
    13501255    expected.pop_front(); // remove first point
    13511256    expected.pop_front(); // remove second point
     
    13551260      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    13561261    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 */
     1274void SphericalPointDistributionTest::getRemainingPointsTest_7()
    13721275{
    13731276  SphericalPointDistribution SPD(1.);
     
    13771280    SphericalPointDistribution::WeightedPolygon_t polygon;
    13781281    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    1379     SphericalPointDistribution::Polygon_t newpolygon =
     1282    SphericalPointDistribution::Polygon_t expected =
    13801283        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);
    13871287//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    13881288    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    13931293    SphericalPointDistribution::WeightedPolygon_t polygon;
    13941294    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    1395     SphericalPointDistribution::Polygon_t newpolygon =
     1295    SphericalPointDistribution::Polygon_t expected =
    13961296        SPD.get<7>();
    1397     SphericalPointDistribution::Polygon_t expected = newpolygon;
    13981297    expected.pop_front(); // remove first point
    13991298    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
     
    14031302    }
    14041303    SphericalPointDistribution::Polygon_t remaining =
    1405         SphericalPointDistribution::matchSphericalPointDistributions(
    1406             polygon,
    1407             newpolygon);
     1304        SPD.getRemainingPoints(polygon, 7);
    14081305//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    14091306    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    14151312    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    14161313    polygon += std::make_pair( Vector(-1.,0.,0.), 1);
    1417     SphericalPointDistribution::Polygon_t newpolygon =
     1314    SphericalPointDistribution::Polygon_t expected =
    14181315        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);
    14261320//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    14271321    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    14381332    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
    14391333    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 =
    14411335        SPD.get<7>();
    1442     SphericalPointDistribution::Polygon_t expected = newpolygon;
    14431336    expected.pop_front(); // remove first point
    14441337    expected.pop_front(); // remove second point
     
    14471340      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    14481341    SphericalPointDistribution::Polygon_t remaining =
    1449         SphericalPointDistribution::matchSphericalPointDistributions(
    1450             polygon,
    1451             newpolygon);
     1342        SPD.getRemainingPoints(polygon, 7);
    14521343    // the five remaining points sit on a plane that may have been rotated arbitrarily
    14531344    // so we cannot simply check for equality between expected and remaining
     
    14691360    polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1);
    14701361    polygon += std::make_pair( Vector(0.0, 1., 0.0), 1);
    1471     SphericalPointDistribution::Polygon_t newpolygon =
     1362    SphericalPointDistribution::Polygon_t expected =
    14721363        SPD.get<7>();
    1473     SphericalPointDistribution::Polygon_t expected = newpolygon;
    14741364    expected.pop_front(); // remove first point
    14751365    expected.pop_front(); // remove second point
    14761366    expected.pop_front(); // remove third point
    14771367    SphericalPointDistribution::Polygon_t remaining =
    1478         SphericalPointDistribution::matchSphericalPointDistributions(
    1479             polygon,
    1480             newpolygon);
     1368        SPD.getRemainingPoints(polygon, 7);
    14811369//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    14821370    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    14941382    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1);
    14951383    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 =
    14971385        SPD.get<7>();
    1498     SphericalPointDistribution::Polygon_t expected = newpolygon;
    14991386    expected.pop_front(); // remove first point
    15001387    expected.pop_front(); // remove second point
     
    15041391      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    15051392    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 */
     1405void SphericalPointDistributionTest::getRemainingPointsTest_8()
    15211406{
    15221407  SphericalPointDistribution SPD(1.);
     
    15261411    SphericalPointDistribution::WeightedPolygon_t polygon;
    15271412    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    1528     SphericalPointDistribution::Polygon_t newpolygon =
     1413    SphericalPointDistribution::Polygon_t expected =
    15291414        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);
    15361418//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    15371419    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    15421424    SphericalPointDistribution::WeightedPolygon_t polygon;
    15431425    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    1544     SphericalPointDistribution::Polygon_t newpolygon =
     1426    SphericalPointDistribution::Polygon_t expected =
    15451427        SPD.get<8>();
    1546     SphericalPointDistribution::Polygon_t expected = newpolygon;
    15471428    expected.pop_front(); // remove first point
    15481429    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
     
    15511432      (*iter)[0] *= -1.;
    15521433    }
    1553    SphericalPointDistribution::Polygon_t remaining =
    1554         SphericalPointDistribution::matchSphericalPointDistributions(
    1555             polygon,
    1556             newpolygon);
     1434    SphericalPointDistribution::Polygon_t remaining =
     1435        SPD.getRemainingPoints(polygon, 8);
    15571436//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    15581437    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    15641443    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    15651444    polygon += std::make_pair( Vector(-1.,0.,0.), 1);
    1566     SphericalPointDistribution::Polygon_t newpolygon =
     1445    SphericalPointDistribution::Polygon_t expected =
    15671446        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);
    15751451//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    15761452    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    15871463    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
    15881464    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 =
    15901466        SPD.get<8>();
    1591     SphericalPointDistribution::Polygon_t expected = newpolygon;
    15921467    expected.pop_front(); // remove first point
    15931468    expected.pop_front(); // remove second point
     
    15961471      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    15971472    SphericalPointDistribution::Polygon_t remaining =
    1598         SphericalPointDistribution::matchSphericalPointDistributions(
    1599             polygon,
    1600             newpolygon);
     1473        SPD.getRemainingPoints(polygon, 8);
    16011474    // the six remaining points sit on two planes that may have been rotated arbitrarily
    16021475    // so we cannot simply check for equality between expected and remaining
     
    16221495    polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1);
    16231496    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 =
    16251498        SPD.get<8>();
    1626     SphericalPointDistribution::Polygon_t expected = newpolygon;
    16271499    expected.pop_front(); // remove first point
    16281500    expected.pop_front(); // remove second point
    16291501    expected.pop_front(); // remove third point
    16301502    SphericalPointDistribution::Polygon_t remaining =
    1631         SphericalPointDistribution::matchSphericalPointDistributions(
    1632             polygon,
    1633             newpolygon);
     1503        SPD.getRemainingPoints(polygon, 8);
    16341504//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    16351505    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    16471517    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1);
    16481518    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 =
    16501520        SPD.get<8>();
    1651     SphericalPointDistribution::Polygon_t expected = newpolygon;
    16521521    expected.pop_front(); // remove first point
    16531522    expected.pop_front(); // remove second point
     
    16571526      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    16581527    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.