Ignore:
Timestamp:
Aug 20, 2014, 1:06:16 PM (11 years ago)
Author:
Frederik Heber <heber@…>
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)
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

    r0b517b re6ca85  
    460460}
    461461
    462 /** UnitTest for matchSphericalPointDistributions() with two points
    463  */
    464 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_2()
     462/** UnitTest for getRemainingPoints() with two points
     463 */
     464void SphericalPointDistributionTest::getRemainingPointsTest_2()
    465465{
    466466  SphericalPointDistribution SPD(1.);
     
    469469    SphericalPointDistribution::WeightedPolygon_t polygon;
    470470    polygon += std::make_pair(Vector(1.,0.,0.), 1);
    471     SphericalPointDistribution::Polygon_t newpolygon =
    472         SPD.get<2>();
    473471    SphericalPointDistribution::Polygon_t expected;
    474472    expected += Vector(-1.,0.,0.);
    475473    SphericalPointDistribution::Polygon_t remaining =
    476         SphericalPointDistribution::matchSphericalPointDistributions(
    477             polygon,
    478             newpolygon);
     474        SPD.getRemainingPoints(polygon, 2);
    479475//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    480476    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    485481    SphericalPointDistribution::WeightedPolygon_t polygon;
    486482    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    487     SphericalPointDistribution::Polygon_t newpolygon =
    488         SPD.get<2>();
    489483    SphericalPointDistribution::Polygon_t expected;
    490484    expected += Vector(0.,-1.,0.);
    491485    SphericalPointDistribution::Polygon_t remaining =
    492         SphericalPointDistribution::matchSphericalPointDistributions(
    493             polygon,
    494             newpolygon);
     486        SPD.getRemainingPoints(polygon, 2);
    495487//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    496488    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    501493    SphericalPointDistribution::WeightedPolygon_t polygon;
    502494    polygon += std::make_pair( Vector(0.,0.,-1.), 1);
    503     SphericalPointDistribution::Polygon_t newpolygon =
    504         SPD.get<2>();
    505495    SphericalPointDistribution::Polygon_t expected;
    506496    expected += Vector(0.,0.,1.);
    507497    SphericalPointDistribution::Polygon_t remaining =
    508         SphericalPointDistribution::matchSphericalPointDistributions(
    509             polygon,
    510             newpolygon);
     498        SPD.getRemainingPoints(polygon, 2);
    511499//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    512500    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    518506    SphericalPointDistribution::WeightedPolygon_t polygon;
    519507    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>();
    522508    SphericalPointDistribution::Polygon_t expected;
    523509    expected += RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI);
    524510    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 */
     519void SphericalPointDistributionTest::getRemainingPointsTest_3()
    536520{
    537521  SphericalPointDistribution SPD(1.);
     
    541525    SphericalPointDistribution::WeightedPolygon_t polygon;
    542526    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    543     SphericalPointDistribution::Polygon_t newpolygon =
     527    SphericalPointDistribution::Polygon_t expected =
    544528        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);
    551532//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    552533    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    557538    SphericalPointDistribution::WeightedPolygon_t polygon;
    558539    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    559     SphericalPointDistribution::Polygon_t newpolygon =
     540    SphericalPointDistribution::Polygon_t expected =
    560541        SPD.get<3>();
    561     SphericalPointDistribution::Polygon_t expected = newpolygon;
    562542    expected.pop_front(); // remove first point
    563543    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
     
    567547    }
    568548    SphericalPointDistribution::Polygon_t remaining =
    569         SphericalPointDistribution::matchSphericalPointDistributions(
    570             polygon,
    571             newpolygon);
     549        SPD.getRemainingPoints(polygon, 3);
    572550//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    573551    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    579557    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    580558    polygon += std::make_pair( Vector(-0.5, sqrt(3)*0.5,0.), 1);
    581     SphericalPointDistribution::Polygon_t newpolygon =
     559    SphericalPointDistribution::Polygon_t expected =
    582560        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);
    590565//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    591566    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    602577    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
    603578    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 =
    605580        SPD.get<3>();
    606     SphericalPointDistribution::Polygon_t expected = newpolygon;
    607581    expected.pop_front(); // remove first point
    608582    expected.pop_front(); // remove second point
     
    611585      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    612586    SphericalPointDistribution::Polygon_t remaining =
    613         SphericalPointDistribution::matchSphericalPointDistributions(
    614             polygon,
    615             newpolygon);
     587        SPD.getRemainingPoints(polygon, 3);
    616588//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    617589    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    632604    SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant
    633605    SphericalPointDistribution::Polygon_t remaining =
    634         SphericalPointDistribution::matchSphericalPointDistributions(
    635             polygon,
    636             newpolygon);
     606        SPD.getRemainingPoints(polygon, 3);
    637607//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    638608    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    655625    SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant
    656626    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 */
     639void SphericalPointDistributionTest::getRemainingPointsTest_4()
    672640{
    673641  SphericalPointDistribution SPD(1.);
     
    677645    SphericalPointDistribution::WeightedPolygon_t polygon;
    678646    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    679     SphericalPointDistribution::Polygon_t newpolygon =
     647    SphericalPointDistribution::Polygon_t expected =
    680648        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);
    687652    //    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    688653        CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    693658    SphericalPointDistribution::WeightedPolygon_t polygon;
    694659    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    695     SphericalPointDistribution::Polygon_t newpolygon =
     660    SphericalPointDistribution::Polygon_t expected =
    696661        SPD.get<4>();
    697     SphericalPointDistribution::Polygon_t expected = newpolygon;
    698662    expected.pop_front(); // remove first point
    699663    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
     
    703667    }
    704668    SphericalPointDistribution::Polygon_t remaining =
    705         SphericalPointDistribution::matchSphericalPointDistributions(
    706             polygon,
    707             newpolygon);
     669        SPD.getRemainingPoints(polygon, 4);
    708670//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    709671    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    715677    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    716678    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 =
    718680        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);
    726685//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    727686    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    737696    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    738697    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 =
    740699        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);
    748704//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    749705    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    760716    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
    761717    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 =
    763719        SPD.get<4>();
    764     SphericalPointDistribution::Polygon_t expected = newpolygon;
    765720    expected.pop_front(); // remove first point
    766721    expected.pop_front(); // remove second point
     
    769724      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    770725    SphericalPointDistribution::Polygon_t remaining =
    771         SphericalPointDistribution::matchSphericalPointDistributions(
    772             polygon,
    773             newpolygon);
     726        SPD.getRemainingPoints(polygon, 4);
    774727//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    775728    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    786739    polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 1);
    787740    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 =
    789742        SPD.get<4>();
    790     SphericalPointDistribution::Polygon_t expected = newpolygon;
    791743    expected.pop_front(); // remove first point
    792744    expected.pop_front(); // remove second point
    793745    expected.pop_front(); // remove third point
    794746    SphericalPointDistribution::Polygon_t remaining =
    795         SphericalPointDistribution::matchSphericalPointDistributions(
    796             polygon,
    797             newpolygon);
     747        SPD.getRemainingPoints(polygon, 4);
    798748//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    799749    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    811761    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 47.6/180*M_PI), 1);
    812762    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 =
    814764        SPD.get<4>();
    815     SphericalPointDistribution::Polygon_t expected = newpolygon;
    816765    expected.pop_front(); // remove first point
    817766    expected.pop_front(); // remove second point
     
    821770      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    822771    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
    836783 * not all equal to one.
    837784 */
    838 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_multiple()
     785void SphericalPointDistributionTest::getRemainingPointsTest_multiple()
    839786{
    840787  SphericalPointDistribution SPD(1.);
     
    850797    expected += Vector(-0.5773502691896,-5.551115123126e-17,-0.8164965809277);
    851798    SphericalPointDistribution::Polygon_t remaining =
    852         SphericalPointDistribution::matchSphericalPointDistributions(
    853             polygon,
    854             newpolygon);
     799        SPD.getRemainingPoints(polygon, 4);
    855800//    std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl;
    856801//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
     
    869814    expected += Vector(-0.3535533905933,-0.3535533905933,-0.8660254037844);
    870815    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;
    875818//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    876819    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    889832    expected += Vector(0.3535534025157,-0.3535533856548,0.8660254009332);
    890833    SphericalPointDistribution::Polygon_t remaining =
    891         SphericalPointDistribution::matchSphericalPointDistributions(
    892             polygon,
    893             newpolygon);
     834        SPD.getRemainingPoints(polygon, 5);
    894835//    std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl;
    895836//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
     
    905846        SPD.get<6>();
    906847    SphericalPointDistribution::Polygon_t expected;
     848    expected += Vector(0.,0.,1.);
    907849    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);
    913852//    std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl;
    914853//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
     
    917856}
    918857
    919 /** UnitTest for matchSphericalPointDistributions() with five points
    920  */
    921 void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_5()
     858/** UnitTest for getRemainingPoints() with five points
     859 */
     860void SphericalPointDistributionTest::getRemainingPointsTest_5()
    922861{
    923862  SphericalPointDistribution SPD(1.);
     
    927866    SphericalPointDistribution::WeightedPolygon_t polygon;
    928867    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    929     SphericalPointDistribution::Polygon_t newpolygon =
     868    SphericalPointDistribution::Polygon_t expected =
    930869        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);
    937873//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    938874    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    943879    SphericalPointDistribution::WeightedPolygon_t polygon;
    944880    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    945     SphericalPointDistribution::Polygon_t newpolygon =
     881    SphericalPointDistribution::Polygon_t expected =
    946882        SPD.get<5>();
    947     SphericalPointDistribution::Polygon_t expected = newpolygon;
    948883    expected.pop_front(); // remove first point
    949884    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
     
    953888    }
    954889    SphericalPointDistribution::Polygon_t remaining =
    955         SphericalPointDistribution::matchSphericalPointDistributions(
    956             polygon,
    957             newpolygon);
     890        SPD.getRemainingPoints(polygon, 5);
    958891//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    959892    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    965898    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    966899    polygon += std::make_pair( Vector(-1.,0.,0.), 1);
    967     SphericalPointDistribution::Polygon_t newpolygon =
     900    SphericalPointDistribution::Polygon_t expected =
    968901        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);
    976906//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    977907    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    988918    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180.*M_PI), 1);
    989919    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 =
    991921        SPD.get<5>();
    992     SphericalPointDistribution::Polygon_t expected = newpolygon;
    993922    expected.pop_front(); // remove first point
    994923    expected.pop_front(); // remove second point
     
    997926      *iter = RotationAxis.rotateVector(*iter, 47.6/180.*M_PI);
    998927    SphericalPointDistribution::Polygon_t remaining =
    999         SphericalPointDistribution::matchSphericalPointDistributions(
    1000             polygon,
    1001             newpolygon);
     928        SPD.getRemainingPoints(polygon, 5);
    1002929    // the three remaining points sit on a plane that may be rotated arbitrarily
    1003930    // so we cannot simply check for equality between expected and remaining
     
    1019946    polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1);
    1020947    polygon += std::make_pair( Vector(0.0, 1., 0.0), 1);
    1021     SphericalPointDistribution::Polygon_t newpolygon =
     948    SphericalPointDistribution::Polygon_t expected =
    1022949        SPD.get<5>();
    1023     SphericalPointDistribution::Polygon_t expected = newpolygon;
    1024950    expected.pop_front(); // remove first point
    1025951    expected.pop_front(); // remove second point
    1026952    expected.pop_front(); // remove third point
    1027953    SphericalPointDistribution::Polygon_t remaining =
    1028         SphericalPointDistribution::matchSphericalPointDistributions(
    1029             polygon,
    1030             newpolygon);
     954        SPD.getRemainingPoints(polygon, 5);
    1031955//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    1032956    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    1044968    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1);
    1045969    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 =
    1047971        SPD.get<5>();
    1048     SphericalPointDistribution::Polygon_t expected = newpolygon;
    1049972    expected.pop_front(); // remove first point
    1050973    expected.pop_front(); // remove second point
     
    1054977      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    1055978    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 */
     991void SphericalPointDistributionTest::getRemainingPointsTest_6()
    1071992{
    1072993  SphericalPointDistribution SPD(1.);
     
    1076997    SphericalPointDistribution::WeightedPolygon_t polygon;
    1077998    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    1078     SphericalPointDistribution::Polygon_t newpolygon =
     999    SphericalPointDistribution::Polygon_t expected =
    10791000        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);
    10861004//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    10871005    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    10921010    SphericalPointDistribution::WeightedPolygon_t polygon;
    10931011    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    1094     SphericalPointDistribution::Polygon_t newpolygon =
     1012    SphericalPointDistribution::Polygon_t expected =
    10951013        SPD.get<6>();
    1096     SphericalPointDistribution::Polygon_t expected = newpolygon;
    10971014    expected.pop_front(); // remove first point
    10981015    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
     
    11021019    }
    11031020    SphericalPointDistribution::Polygon_t remaining =
    1104         SphericalPointDistribution::matchSphericalPointDistributions(
    1105             polygon,
    1106             newpolygon);
     1021        SPD.getRemainingPoints(polygon, 6);
    11071022//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    11081023    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    11141029    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    11151030    polygon += std::make_pair( Vector(-1.,0.,0.), 1);
    1116     SphericalPointDistribution::Polygon_t newpolygon =
     1031    SphericalPointDistribution::Polygon_t expected =
    11171032        SPD.get<6>();
    1118     SphericalPointDistribution::Polygon_t expected = newpolygon;
    11191033    expected.pop_front(); // remove first point
    11201034    expected.pop_front(); // remove second spoint
    11211035    SphericalPointDistribution::Polygon_t remaining =
    1122         SphericalPointDistribution::matchSphericalPointDistributions(
    1123             polygon,
    1124             newpolygon);
     1036        SPD.getRemainingPoints(polygon, 6);
    11251037//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    11261038    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    11371049    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
    11381050    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 =
    11401052        SPD.get<6>();
    1141     SphericalPointDistribution::Polygon_t expected = newpolygon;
    11421053    expected.pop_front(); // remove first point
    11431054    expected.pop_front(); // remove second spoint
     
    11461057      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    11471058    SphericalPointDistribution::Polygon_t remaining =
    1148         SphericalPointDistribution::matchSphericalPointDistributions(
    1149             polygon,
    1150             newpolygon);
     1059        SPD.getRemainingPoints(polygon, 6);
    11511060    // the four remaining points sit on a plane that may have been rotated arbitrarily
    11521061    // so we cannot simply check for equality between expected and remaining
     
    11681077    polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1);
    11691078    polygon += std::make_pair( Vector(0.0, 1., 0.0), 1);
    1170     SphericalPointDistribution::Polygon_t newpolygon =
     1079    SphericalPointDistribution::Polygon_t expected =
    11711080        SPD.get<6>();
    1172     SphericalPointDistribution::Polygon_t expected = newpolygon;
    11731081    expected.pop_front(); // remove first point
    11741082    expected.pop_front(); // remove second point
    11751083    expected.pop_front(); // remove third point
    11761084    SphericalPointDistribution::Polygon_t remaining =
    1177         SphericalPointDistribution::matchSphericalPointDistributions(
    1178             polygon,
    1179             newpolygon);
     1085        SPD.getRemainingPoints(polygon, 6);
    11801086//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    11811087    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    11931099    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1);
    11941100    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 =
    11961102        SPD.get<6>();
    1197     SphericalPointDistribution::Polygon_t expected = newpolygon;
    11981103    expected.pop_front(); // remove first point
    11991104    expected.pop_front(); // remove second point
     
    12031108      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    12041109    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 */
     1122void SphericalPointDistributionTest::getRemainingPointsTest_7()
    12201123{
    12211124  SphericalPointDistribution SPD(1.);
     
    12251128    SphericalPointDistribution::WeightedPolygon_t polygon;
    12261129    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    1227     SphericalPointDistribution::Polygon_t newpolygon =
     1130    SphericalPointDistribution::Polygon_t expected =
    12281131        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);
    12351135//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    12361136    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    12411141    SphericalPointDistribution::WeightedPolygon_t polygon;
    12421142    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    1243     SphericalPointDistribution::Polygon_t newpolygon =
     1143    SphericalPointDistribution::Polygon_t expected =
    12441144        SPD.get<7>();
    1245     SphericalPointDistribution::Polygon_t expected = newpolygon;
    12461145    expected.pop_front(); // remove first point
    12471146    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
     
    12511150    }
    12521151    SphericalPointDistribution::Polygon_t remaining =
    1253         SphericalPointDistribution::matchSphericalPointDistributions(
    1254             polygon,
    1255             newpolygon);
     1152        SPD.getRemainingPoints(polygon, 7);
    12561153//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    12571154    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    12631160    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    12641161    polygon += std::make_pair( Vector(-1.,0.,0.), 1);
    1265     SphericalPointDistribution::Polygon_t newpolygon =
     1162    SphericalPointDistribution::Polygon_t expected =
    12661163        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);
    12741168//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    12751169    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    12861180    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
    12871181    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 =
    12891183        SPD.get<7>();
    1290     SphericalPointDistribution::Polygon_t expected = newpolygon;
    12911184    expected.pop_front(); // remove first point
    12921185    expected.pop_front(); // remove second point
     
    12951188      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    12961189    SphericalPointDistribution::Polygon_t remaining =
    1297         SphericalPointDistribution::matchSphericalPointDistributions(
    1298             polygon,
    1299             newpolygon);
     1190        SPD.getRemainingPoints(polygon, 7);
    13001191    // the five remaining points sit on a plane that may have been rotated arbitrarily
    13011192    // so we cannot simply check for equality between expected and remaining
     
    13171208    polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1);
    13181209    polygon += std::make_pair( Vector(0.0, 1., 0.0), 1);
    1319     SphericalPointDistribution::Polygon_t newpolygon =
     1210    SphericalPointDistribution::Polygon_t expected =
    13201211        SPD.get<7>();
    1321     SphericalPointDistribution::Polygon_t expected = newpolygon;
    13221212    expected.pop_front(); // remove first point
    13231213    expected.pop_front(); // remove second point
    13241214    expected.pop_front(); // remove third point
    13251215    SphericalPointDistribution::Polygon_t remaining =
    1326         SphericalPointDistribution::matchSphericalPointDistributions(
    1327             polygon,
    1328             newpolygon);
     1216        SPD.getRemainingPoints(polygon, 7);
    13291217//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    13301218    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    13421230    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1);
    13431231    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 =
    13451233        SPD.get<7>();
    1346     SphericalPointDistribution::Polygon_t expected = newpolygon;
    13471234    expected.pop_front(); // remove first point
    13481235    expected.pop_front(); // remove second point
     
    13521239      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    13531240    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 */
     1253void SphericalPointDistributionTest::getRemainingPointsTest_8()
    13691254{
    13701255  SphericalPointDistribution SPD(1.);
     
    13741259    SphericalPointDistribution::WeightedPolygon_t polygon;
    13751260    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    1376     SphericalPointDistribution::Polygon_t newpolygon =
     1261    SphericalPointDistribution::Polygon_t expected =
    13771262        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);
    13841266//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    13851267    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    13901272    SphericalPointDistribution::WeightedPolygon_t polygon;
    13911273    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    1392     SphericalPointDistribution::Polygon_t newpolygon =
     1274    SphericalPointDistribution::Polygon_t expected =
    13931275        SPD.get<8>();
    1394     SphericalPointDistribution::Polygon_t expected = newpolygon;
    13951276    expected.pop_front(); // remove first point
    13961277    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
     
    13991280      (*iter)[0] *= -1.;
    14001281    }
    1401    SphericalPointDistribution::Polygon_t remaining =
    1402         SphericalPointDistribution::matchSphericalPointDistributions(
    1403             polygon,
    1404             newpolygon);
     1282    SphericalPointDistribution::Polygon_t remaining =
     1283        SPD.getRemainingPoints(polygon, 8);
    14051284//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    14061285    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    14121291    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    14131292    polygon += std::make_pair( Vector(-1.,0.,0.), 1);
    1414     SphericalPointDistribution::Polygon_t newpolygon =
     1293    SphericalPointDistribution::Polygon_t expected =
    14151294        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);
    14231299//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    14241300    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    14351311    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
    14361312    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 =
    14381314        SPD.get<8>();
    1439     SphericalPointDistribution::Polygon_t expected = newpolygon;
    14401315    expected.pop_front(); // remove first point
    14411316    expected.pop_front(); // remove second point
     
    14441319      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    14451320    SphericalPointDistribution::Polygon_t remaining =
    1446         SphericalPointDistribution::matchSphericalPointDistributions(
    1447             polygon,
    1448             newpolygon);
     1321        SPD.getRemainingPoints(polygon, 8);
    14491322    // the six remaining points sit on two planes that may have been rotated arbitrarily
    14501323    // so we cannot simply check for equality between expected and remaining
     
    14701343    polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1);
    14711344    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 =
    14731346        SPD.get<8>();
    1474     SphericalPointDistribution::Polygon_t expected = newpolygon;
    14751347    expected.pop_front(); // remove first point
    14761348    expected.pop_front(); // remove second point
    14771349    expected.pop_front(); // remove third point
    14781350    SphericalPointDistribution::Polygon_t remaining =
    1479         SphericalPointDistribution::matchSphericalPointDistributions(
    1480             polygon,
    1481             newpolygon);
     1351        SPD.getRemainingPoints(polygon, 8);
    14821352//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
    14831353    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
     
    14951365    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1);
    14961366    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 =
    14981368        SPD.get<8>();
    1499     SphericalPointDistribution::Polygon_t expected = newpolygon;
    15001369    expected.pop_front(); // remove first point
    15011370    expected.pop_front(); // remove second point
     
    15051374      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
    15061375    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.