Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75182 - in sandbox/gtl: boost/polygon boost/polygon/detail libs/polygon/test
From: sydorchuk.andriy_at_[hidden]
Date: 2011-10-30 17:01:28


Author: asydorchuk
Date: 2011-10-30 17:01:27 EDT (Sun, 30 Oct 2011)
New Revision: 75182
URL: http://svn.boost.org/trac/boost/changeset/75182

Log:
Updaring site event construction (removing index from constructors).
Updating builder typedefs.
Text files modified:
   sandbox/gtl/boost/polygon/detail/voronoi_calc_kernel.hpp | 12
   sandbox/gtl/boost/polygon/detail/voronoi_structures.hpp | 53 +++--
   sandbox/gtl/boost/polygon/voronoi_builder.hpp | 25 +-
   sandbox/gtl/libs/polygon/test/voronoi_calc_kernel_test.cpp | 360 ++++++++++++++++++++-------------------
   sandbox/gtl/libs/polygon/test/voronoi_structures_test.cpp | 4
   5 files changed, 239 insertions(+), 215 deletions(-)

Modified: sandbox/gtl/boost/polygon/detail/voronoi_calc_kernel.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/voronoi_calc_kernel.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/voronoi_calc_kernel.hpp 2011-10-30 17:01:27 EDT (Sun, 30 Oct 2011)
@@ -285,7 +285,8 @@
                 const site_type &right_site,
                 const site_type &new_site) const {
             // Handle temporary segment sites.
- if (left_site.index() == right_site.index()) {
+ if (left_site.point0() == right_site.point0() &&
+ left_site.point1() == right_site.point1()) {
                 return get_orientation(left_site.point0(),
                                        left_site.point1(),
                                        new_site.point0()) == LEFT;
@@ -494,7 +495,8 @@
                  const site_type &site2,
                  const site_type &site3,
                  int point_index) const {
- if (site2.index() == site3.index()) {
+ if (site2.point0() == site3.point0() &&
+ site2.point1() == site3.point1()) {
                 return false;
             }
             if (point_index == 2) {
@@ -510,9 +512,11 @@
         bool sss(const site_type &site1,
                  const site_type &site2,
                  const site_type &site3) const {
- if (site1.index() == site2.index())
+ if (site1.point0() == site2.point0() &&
+ site1.point1() == site2.point1())
                  return false;
- if (site2.index() == site3.index())
+ if (site2.point0() == site3.point0() &&
+ site2.point1() == site3.point1())
                  return false;
              return true;
         }

Modified: sandbox/gtl/boost/polygon/detail/voronoi_structures.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/voronoi_structures.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/voronoi_structures.hpp 2011-10-30 17:01:27 EDT (Sun, 30 Oct 2011)
@@ -45,12 +45,14 @@
             return y_;
         }
 
- void x(coordinate_type x) {
+ point_2d& x(coordinate_type x) {
             x_ = x;
+ return *this;
         }
 
- void y(coordinate_type y) {
+ point_2d& y(coordinate_type y) {
             y_ = y;
+ return *this;
         }
     private:
         coordinate_type x_;
@@ -85,32 +87,33 @@
         site_event() :
             point0_(0, 0),
             point1_(0, 0),
+ site_index_(0),
             is_inverse_(false) {}
 
- site_event(coordinate_type x, coordinate_type y, int index) :
+ site_event(coordinate_type x, coordinate_type y) :
             point0_(x, y),
             point1_(x, y),
- site_index_(index),
+ site_index_(0),
             is_inverse_(false) {}
 
- site_event(const point_type &point, int index) :
+ site_event(const point_type &point) :
             point0_(point),
             point1_(point),
- site_index_(index),
+ site_index_(0),
             is_inverse_(false) {}
 
         site_event(coordinate_type x1, coordinate_type y1,
- coordinate_type x2, coordinate_type y2, int index):
+ coordinate_type x2, coordinate_type y2):
             point0_(x1, y1),
             point1_(x2, y2),
- site_index_(index),
+ site_index_(0),
             is_inverse_(false) {}
 
         site_event(const point_type &point1,
- const point_type &point2, int index) :
+ const point_type &point2) :
             point0_(point1),
             point1_(point2),
- site_index_(index),
+ site_index_(0),
             is_inverse_(false) {}
 
         bool operator==(const site_event &that) const {
@@ -171,12 +174,14 @@
             return is_inverse_ ? point0_ : point1_;
         }
 
- void index(int index) {
+ site_event& index(int index) {
             site_index_ = index;
+ return *this;
         }
 
- void inverse() {
+ site_event& inverse() {
             is_inverse_ ^= true;
+ return *this;
         }
 
         int index() const {
@@ -231,24 +236,27 @@
             return center_x_;
         }
 
- void x(coordinate_type center_x) {
+ circle_event& x(coordinate_type center_x) {
             center_x_ = center_x;
+ return *this;
         }
 
         coordinate_type y() const {
             return center_y_;
         }
 
- void y(coordinate_type center_y) {
+ circle_event& y(coordinate_type center_y) {
             center_y_ = center_y;
+ return *this;
         }
 
         coordinate_type lower_x() const {
             return lower_x_;
         }
 
- void lower_x(coordinate_type lower_x) {
+ circle_event& lower_x(coordinate_type lower_x) {
             lower_x_ = lower_x;
+ return *this;
         }
 
         coordinate_type lower_y() const {
@@ -259,8 +267,9 @@
             return is_active_;
         }
 
- void deactivate() {
+ circle_event& deactivate() {
             is_active_ = false;
+ return *this;
         }
     private:
         coordinate_type center_x_;
@@ -356,8 +365,9 @@
             return left_site_;
         }
 
- void left_site(const site_type &site) {
+ beach_line_node_key& left_site(const site_type &site) {
             left_site_ = site;
+ return *this;
         }
 
         const site_type &right_site() const {
@@ -368,8 +378,9 @@
             return right_site_;
         }
 
- void right_site(const site_type &site) {
+ beach_line_node_key& right_site(const site_type &site) {
             right_site_ = site;
+ return *this;
         }
     private:
         site_type left_site_;
@@ -391,16 +402,18 @@
             return circle_event_;
         }
 
- void circle_event(Circle *circle_event) {
+ beach_line_node_data& circle_event(Circle *circle_event) {
             circle_event_ = circle_event;
+ return *this;
         }
 
         Edge *edge() {
             return edge_;
         }
 
- void edge(Edge *new_edge) {
+ beach_line_node_data& edge(Edge *new_edge) {
             edge_ = new_edge;
+ return *this;
         }
     private:
         Circle *circle_event_;

Modified: sandbox/gtl/boost/polygon/voronoi_builder.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/voronoi_builder.hpp (original)
+++ sandbox/gtl/boost/polygon/voronoi_builder.hpp 2011-10-30 17:01:27 EDT (Sun, 30 Oct 2011)
@@ -79,7 +79,7 @@
             for (PointIterator it = first_point; it != last_point; ++it) {
                 site_events_.push_back(detail::site_event<coordinate_type>(
                     static_cast<coordinate_type>(it->x()),
- static_cast<coordinate_type>(it->y()), 0));
+ static_cast<coordinate_type>(it->y())));
             }
         }
 
@@ -97,12 +97,12 @@
                 coordinate_type y2 = static_cast<coordinate_type>(it->high().y());
                 point_type p1(x1, y1);
                 point_type p2(x2, y2);
- site_events_.push_back(detail::site_event<coordinate_type>(p1, 0));
- site_events_.push_back(detail::site_event<coordinate_type>(p2, 0));
+ site_events_.push_back(detail::site_event<coordinate_type>(p1));
+ site_events_.push_back(detail::site_event<coordinate_type>(p2));
                 if (point_comparison(p1, p2)) {
- site_events_.push_back(detail::site_event<coordinate_type>(p1, p2, 0));
+ site_events_.push_back(detail::site_event<coordinate_type>(p1, p2));
                 } else {
- site_events_.push_back(detail::site_event<coordinate_type>(p2, p1, 0));
+ site_events_.push_back(detail::site_event<coordinate_type>(p2, p1));
                 }
             }
         }
@@ -163,16 +163,19 @@
         typedef typename std::vector<site_event_type>::const_iterator
             site_event_iterator_type;
         typedef detail::circle_event<coordinate_type> circle_event_type;
- typedef typename CKT::point_comparison_predicate<point_type>
+ typedef typename CKT::template point_comparison_predicate<point_type>
             point_comparison_predicate;
- typedef typename CKT::event_comparison_predicate<site_event_type, circle_event_type>
+ typedef typename CKT::
+ template event_comparison_predicate<site_event_type, circle_event_type>
             event_comparison_predicate;
- typedef typename CKT::circle_formation_predicate<site_event_type, circle_event_type>
+ typedef typename CKT::
+ template circle_formation_predicate<site_event_type, circle_event_type>
             circle_formation_predicate_type;
         typedef typename output_type::voronoi_edge_type edge_type;
         typedef detail::beach_line_node_key<site_event_type> key_type;
         typedef detail::beach_line_node_data<edge_type, circle_event_type> value_type;
- typedef typename CKT::node_comparison_predicate<key_type> node_comparer_type;
+ typedef typename CKT::
+ template node_comparison_predicate<key_type> node_comparer_type;
         typedef std::map< key_type, value_type, node_comparer_type > beach_line_type;
         typedef typename beach_line_type::iterator beach_line_iterator;
         typedef std::pair<circle_event_type, beach_line_iterator> event_type;
@@ -508,12 +511,10 @@
             }
         }
     private:
- class end_point_comparison {
- public:
+ struct end_point_comparison {
             bool operator() (const end_point_type &end1, const end_point_type &end2) const {
                 return point_comparison(end2.first, end1.first);
             }
- private:
             point_comparison_predicate point_comparison;
         };
 

Modified: sandbox/gtl/libs/polygon/test/voronoi_calc_kernel_test.cpp
==============================================================================
--- sandbox/gtl/libs/polygon/test/voronoi_calc_kernel_test.cpp (original)
+++ sandbox/gtl/libs/polygon/test/voronoi_calc_kernel_test.cpp 2011-10-30 17:01:27 EDT (Sun, 30 Oct 2011)
@@ -87,30 +87,30 @@
 }
 
 BOOST_AUTO_TEST_CASE(event_comparison_test1) {
- site_type site(1, 2, 0);
- CHECK_EVENT_COMPARISON(site, site_type(0, 2, 1), false, true);
- CHECK_EVENT_COMPARISON(site, site_type(1, 3, 2), true, false);
- CHECK_EVENT_COMPARISON(site, site_type(1, 2, 3), false, false);
+ site_type site(1, 2);
+ CHECK_EVENT_COMPARISON(site, site_type(0, 2), false, true);
+ CHECK_EVENT_COMPARISON(site, site_type(1, 3), true, false);
+ CHECK_EVENT_COMPARISON(site, site_type(1, 2), false, false);
 }
 
 BOOST_AUTO_TEST_CASE(event_comparison_test2) {
- site_type site(0, 0, 0, 2, 0);
- CHECK_EVENT_COMPARISON(site, site_type(0, 2, 1), true, false);
- CHECK_EVENT_COMPARISON(site, site_type(0, 0, 2), false, true);
- CHECK_EVENT_COMPARISON(site, site_type(0, -2, 0, -1, 3), false, true);
- CHECK_EVENT_COMPARISON(site, site_type(0, -2, 1, 1, 4), true, false);
- CHECK_EVENT_COMPARISON(site, site_type(0, 0, 1, 1, 5), true, false);
+ site_type site(0, 0, 0, 2);
+ CHECK_EVENT_COMPARISON(site, site_type(0, 2), true, false);
+ CHECK_EVENT_COMPARISON(site, site_type(0, 0), false, true);
+ CHECK_EVENT_COMPARISON(site, site_type(0, -2, 0, -1), false, true);
+ CHECK_EVENT_COMPARISON(site, site_type(0, -2, 1, 1), true, false);
+ CHECK_EVENT_COMPARISON(site, site_type(0, 0, 1, 1), true, false);
 }
 
 BOOST_AUTO_TEST_CASE(event_comparison_test3) {
- site_type site(0, 0, 10, 10, 0);
- CHECK_EVENT_COMPARISON(site, site_type(0, 0, 1), false, true);
- CHECK_EVENT_COMPARISON(site, site_type(0, -1, 2), false, true);
- CHECK_EVENT_COMPARISON(site, site_type(0, 1, 3), false, true);
- CHECK_EVENT_COMPARISON(site, site_type(0, 1, 0, 10, 4), false, true);
- CHECK_EVENT_COMPARISON(site, site_type(0, -10, 0, -1, 5), false, true);
- CHECK_EVENT_COMPARISON(site, site_type(0, 0, 10, 9, 6), true, false);
- CHECK_EVENT_COMPARISON(site, site_type(0, 0, 9, 10, 7), false, true);
+ site_type site(0, 0, 10, 10);
+ CHECK_EVENT_COMPARISON(site, site_type(0, 0), false, true);
+ CHECK_EVENT_COMPARISON(site, site_type(0, -1), false, true);
+ CHECK_EVENT_COMPARISON(site, site_type(0, 1), false, true);
+ CHECK_EVENT_COMPARISON(site, site_type(0, 1, 0, 10), false, true);
+ CHECK_EVENT_COMPARISON(site, site_type(0, -10, 0, -1), false, true);
+ CHECK_EVENT_COMPARISON(site, site_type(0, 0, 10, 9), true, false);
+ CHECK_EVENT_COMPARISON(site, site_type(0, 0, 9, 10), false, true);
 }
 
 BOOST_AUTO_TEST_CASE(event_comparison_test4) {
@@ -124,111 +124,111 @@
 
 BOOST_AUTO_TEST_CASE(event_comparison_test5) {
     circle_type circle(1, 2, 3);
- CHECK_EVENT_COMPARISON(circle, site_type(0, 100, 1), false, true);
- CHECK_EVENT_COMPARISON(circle, site_type(3, 0, 2), false, true);
- CHECK_EVENT_COMPARISON(circle, site_type(3, 2, 3), false, false);
- CHECK_EVENT_COMPARISON(circle, site_type(3, 3, 4), true, false);
- CHECK_EVENT_COMPARISON(circle, site_type(4, 2, 5), true, false);
+ CHECK_EVENT_COMPARISON(circle, site_type(0, 100), false, true);
+ CHECK_EVENT_COMPARISON(circle, site_type(3, 0), false, true);
+ CHECK_EVENT_COMPARISON(circle, site_type(3, 2), false, false);
+ CHECK_EVENT_COMPARISON(circle, site_type(3, 3), true, false);
+ CHECK_EVENT_COMPARISON(circle, site_type(4, 2), true, false);
 }
 
 BOOST_AUTO_TEST_CASE(distance_predicate_test1) {
- site_type site1(-5, 0, 0);
- site_type site2(-8, 9, 1);
- site_type site3(-2, 1, 2);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 5, 3), false);
- CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, 5, 3), false);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 4, 3), false);
- CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, 4, 3), false);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 6, 3), true);
- CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, 6, 3), true);
+ site_type site1(-5, 0);
+ site_type site2(-8, 9);
+ site_type site3(-2, 1);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 5), false);
+ CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, 5), false);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 4), false);
+ CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, 4), false);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 6), true);
+ CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, 6), true);
 }
 
 BOOST_AUTO_TEST_CASE(distance_predicate_test2) {
- site_type site1(-4, 0, -4, 20, 0);
- site_type site2(-2, 10, 1);
- CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, 11, 2), false);
- CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, 9, 2), false);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 11, 2), true);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 9, 2), true);
+ site_type site1(-4, 0, -4, 20);
+ site_type site2(-2, 10);
+ CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, 11), false);
+ CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, 9), false);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 11), true);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 9), true);
 }
 
 BOOST_AUTO_TEST_CASE(disntace_predicate_test3) {
- site_type site1(-5, 5, 2, -2, 0);
+ site_type site1(-5, 5, 2, -2);
     site1.inverse();
- site_type site2(-2, 4, 1);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, -1, 2), false);
- CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, -1, 2), false);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 1, 2), false);
- CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, 1, 2), false);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 4, 2), true);
- CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, 4, 2), false);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 5, 2), true);
- CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, 5, 2), false);
+ site_type site2(-2, 4);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, -1), false);
+ CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, -1), false);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 1), false);
+ CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, 1), false);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 4), true);
+ CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, 4), false);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 5), true);
+ CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, 5), false);
 }
 
 BOOST_AUTO_TEST_CASE(distance_predicate_test4) {
- site_type site1(-5, 5, 2, -2, 0);
- site_type site2(-2, -4, 1);
- site_type site3(-4, 1, 0);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 1, 3), true);
- CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, 1, 3), true);
- CHECK_DISTANCE_PREDICATE(site1, site3, site_type(0, 1, 3), true);
- CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, 1, 3), true);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, -2, 3), true);
- CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, -2, 3), false);
- CHECK_DISTANCE_PREDICATE(site1, site3, site_type(0, -2, 3), true);
- CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, -2, 3), false);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, -8, 3), true);
- CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, -8, 3), false);
- CHECK_DISTANCE_PREDICATE(site1, site3, site_type(0, -8, 3), true);
- CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, -8, 3), false);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, -9, 3), true);
- CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, -9, 3), false);
- CHECK_DISTANCE_PREDICATE(site1, site3, site_type(0, -9, 3), true);
- CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, -9, 3), false);
+ site_type site1(-5, 5, 2, -2);
+ site_type site2(-2, -4);
+ site_type site3(-4, 1);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, 1), true);
+ CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, 1), true);
+ CHECK_DISTANCE_PREDICATE(site1, site3, site_type(0, 1), true);
+ CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, 1), true);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, -2), true);
+ CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, -2), false);
+ CHECK_DISTANCE_PREDICATE(site1, site3, site_type(0, -2), true);
+ CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, -2), false);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, -8), true);
+ CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, -8), false);
+ CHECK_DISTANCE_PREDICATE(site1, site3, site_type(0, -8), true);
+ CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, -8), false);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(0, -9), true);
+ CHECK_DISTANCE_PREDICATE(site2, site1, site_type(0, -9), false);
+ CHECK_DISTANCE_PREDICATE(site1, site3, site_type(0, -9), true);
+ CHECK_DISTANCE_PREDICATE(site3, site1, site_type(0, -9), false);
 }
 
 BOOST_AUTO_TEST_CASE(disntace_predicate_test5) {
- site_type site1(-5, 5, 2, -2, 0);
+ site_type site1(-5, 5, 2, -2);
     site_type site2 = site1;
     site2.inverse();
- site_type site3(-2, 4, 1);
- site_type site4(-2, -4, 1);
- site_type site5(-4, 1, 1);
- CHECK_DISTANCE_PREDICATE(site3, site2, site_type(0, 1, 2), false);
- CHECK_DISTANCE_PREDICATE(site3, site2, site_type(0, 4, 2), false);
- CHECK_DISTANCE_PREDICATE(site3, site2, site_type(0, 5, 2), false);
- CHECK_DISTANCE_PREDICATE(site3, site2, site_type(0, 7, 2), true);
- CHECK_DISTANCE_PREDICATE(site4, site1, site_type(0, -2, 2), false);
- CHECK_DISTANCE_PREDICATE(site5, site1, site_type(0, -2, 2), false);
- CHECK_DISTANCE_PREDICATE(site4, site1, site_type(0, -8, 2), false);
- CHECK_DISTANCE_PREDICATE(site5, site1, site_type(0, -8, 2), false);
- CHECK_DISTANCE_PREDICATE(site4, site1, site_type(0, -9, 2), false);
- CHECK_DISTANCE_PREDICATE(site5, site1, site_type(0, -9, 2), false);
- CHECK_DISTANCE_PREDICATE(site4, site1, site_type(0, -18, 2), false);
- CHECK_DISTANCE_PREDICATE(site5, site1, site_type(0, -18, 2), false);
- CHECK_DISTANCE_PREDICATE(site4, site1, site_type(0, -1, 2), true);
- CHECK_DISTANCE_PREDICATE(site5, site1, site_type(0, -1, 2), true);
+ site_type site3(-2, 4);
+ site_type site4(-2, -4);
+ site_type site5(-4, 1);
+ CHECK_DISTANCE_PREDICATE(site3, site2, site_type(0, 1), false);
+ CHECK_DISTANCE_PREDICATE(site3, site2, site_type(0, 4), false);
+ CHECK_DISTANCE_PREDICATE(site3, site2, site_type(0, 5), false);
+ CHECK_DISTANCE_PREDICATE(site3, site2, site_type(0, 7), true);
+ CHECK_DISTANCE_PREDICATE(site4, site1, site_type(0, -2), false);
+ CHECK_DISTANCE_PREDICATE(site5, site1, site_type(0, -2), false);
+ CHECK_DISTANCE_PREDICATE(site4, site1, site_type(0, -8), false);
+ CHECK_DISTANCE_PREDICATE(site5, site1, site_type(0, -8), false);
+ CHECK_DISTANCE_PREDICATE(site4, site1, site_type(0, -9), false);
+ CHECK_DISTANCE_PREDICATE(site5, site1, site_type(0, -9), false);
+ CHECK_DISTANCE_PREDICATE(site4, site1, site_type(0, -18), false);
+ CHECK_DISTANCE_PREDICATE(site5, site1, site_type(0, -18), false);
+ CHECK_DISTANCE_PREDICATE(site4, site1, site_type(0, -1), true);
+ CHECK_DISTANCE_PREDICATE(site5, site1, site_type(0, -1), true);
 }
 
 BOOST_AUTO_TEST_CASE(distance_predicate_test6) {
- site_type site1(-5, 0, 2, 7, 0);
+ site_type site1(-5, 0, 2, 7);
     site_type site2 = site1;
     site2.inverse();
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(2, 7, 1), false);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(1, 5, 1), false);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(-1, 5, 1), true);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(2, 7), false);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(1, 5), false);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(-1, 5), true);
 }
 
 BOOST_AUTO_TEST_CASE(distance_predicate_test7) {
- site_type site1(-5, 5, 2, -2, 0);
+ site_type site1(-5, 5, 2, -2);
     site1.inverse();
- site_type site2(-5, 5, 0, 6, 1);
- site_type site3(-2, 4, 0, 4, 2);
- site_type site4(0, 2, 3);
- site_type site5(0, 5, 4);
- site_type site6(0, 6, 5);
- site_type site7(0, 8, 6);
+ site_type site2(-5, 5, 0, 6);
+ site_type site3(-2, 4, 0, 4);
+ site_type site4(0, 2);
+ site_type site5(0, 5);
+ site_type site6(0, 6);
+ site_type site7(0, 8);
     CHECK_DISTANCE_PREDICATE(site1, site2, site4, false);
     CHECK_DISTANCE_PREDICATE(site1, site2, site5, true);
     CHECK_DISTANCE_PREDICATE(site1, site2, site6, true);
@@ -245,17 +245,20 @@
 }
 
 BOOST_AUTO_TEST_CASE(distatnce_predicate_test8) {
- site_type site1(-5, 3, -2, 2, 0);
+ site_type site1(-5, 3, -2, 2);
     site1.inverse();
- site_type site2(-5, 5, -2, 2, 1);
- CHECK_DISTANCE_PREDICATE(site1, site2, site_type(-4, 2, 2), false);
+ site_type site2(-5, 5, -2, 2);
+ CHECK_DISTANCE_PREDICATE(site1, site2, site_type(-4, 2), false);
 }
 
 BOOST_AUTO_TEST_CASE(node_comparison_test1) {
     beach_line_type beach_line;
- site_type site1(0, 0, 0);
- site_type site2(0, 2, 1);
- site_type site3(1, 0, 2);
+ site_type site1(0, 0);
+ site1.index(0);
+ site_type site2(0, 2);
+ site2.index(1);
+ site_type site3(1, 0);
+ site3.index(2);
     beach_line[key_type(site1, site2)] = 2;
     beach_line[key_type(site1, site3)] = 0;
     beach_line[key_type(site3, site1)] = 1;
@@ -268,9 +271,12 @@
 
 BOOST_AUTO_TEST_CASE(node_comparison_test2) {
     beach_line_type beach_line;
- site_type site1(0, 1, 0);
- site_type site2(2, 0, 1);
- site_type site3(2, 4, 2);
+ site_type site1(0, 1);
+ site1.index(0);
+ site_type site2(2, 0);
+ site2.index(1);
+ site_type site3(2, 4);
+ site3.index(2);
     beach_line[key_type(site1, site2)] = 0;
     beach_line[key_type(site2, site1)] = 1;
     beach_line[key_type(site1, site3)] = 2;
@@ -283,168 +289,168 @@
 }
 
 BOOST_AUTO_TEST_CASE(node_comparison_test3) {
- key_type node(site_type(1, 0, 0), site_type(0, 2, 1));
+ key_type node(site_type(1, 0).index(1), site_type(0, 2).index(0));
     key_type nodes[] = {
- key_type(site_type(2, -10, 2)),
- key_type(site_type(2, -1, 3)),
- key_type(site_type(2, 0, 4)),
- key_type(site_type(2, 1, 4)),
- key_type(site_type(2, 2, 4)),
- key_type(site_type(2, 3, 4)),
+ key_type(site_type(2, -10).index(2)),
+ key_type(site_type(2, -1).index(2)),
+ key_type(site_type(2, 0).index(2)),
+ key_type(site_type(2, 1).index(2)),
+ key_type(site_type(2, 2).index(2)),
+ key_type(site_type(2, 3).index(2)),
     };
     bool res[] = {false, false, false, false, true, true};
     CHECK_NODE_COMPARISON(node, nodes, res, 6);
 }
 
 BOOST_AUTO_TEST_CASE(node_comparison_test4) {
- key_type node(site_type(0, 1, 0), site_type(1, 0, 1));
+ key_type node(site_type(0, 1).index(0), site_type(1, 0).index(1));
     key_type nodes[] = {
- key_type(site_type(2, -3, 2)),
- key_type(site_type(2, -2, 2)),
- key_type(site_type(2, -1, 2)),
- key_type(site_type(2, 0, 2)),
- key_type(site_type(2, 1, 2)),
- key_type(site_type(2, 3, 2)),
+ key_type(site_type(2, -3).index(2)),
+ key_type(site_type(2, -2).index(2)),
+ key_type(site_type(2, -1).index(2)),
+ key_type(site_type(2, 0).index(2)),
+ key_type(site_type(2, 1).index(2)),
+ key_type(site_type(2, 3).index(2)),
     };
     bool res[] = {false, true, true, true, true, true};
     CHECK_NODE_COMPARISON(node, nodes, res, 6);
 }
 
 BOOST_AUTO_TEST_CASE(node_comparison_test5) {
- key_type node(site_type(0, 0, 0), site_type(1, 2, 1));
+ key_type node(site_type(0, 0).index(0), site_type(1, 2).index(1));
     key_type nodes[] = {
- key_type(site_type(2, -10, 2)),
- key_type(site_type(2, 0, 2)),
- key_type(site_type(2, 1, 2)),
- key_type(site_type(2, 2, 2)),
- key_type(site_type(2, 5, 2)),
- key_type(site_type(2, 20, 2)),
+ key_type(site_type(2, -10).index(2)),
+ key_type(site_type(2, 0).index(2)),
+ key_type(site_type(2, 1).index(2)),
+ key_type(site_type(2, 2).index(2)),
+ key_type(site_type(2, 5).index(2)),
+ key_type(site_type(2, 20).index(2)),
     };
     bool res[] = {false, false, true, true, true, true};
     CHECK_NODE_COMPARISON(node, nodes, res, 6);
 }
 
 BOOST_AUTO_TEST_CASE(node_comparison_test6) {
- key_type node(site_type(1, 1, 0), site_type(0, 0, 1));
+ key_type node(site_type(1, 1).index(1), site_type(0, 0).index(0));
     key_type nodes [] = {
- key_type(site_type(2, -3, 2)),
- key_type(site_type(2, -2, 2)),
- key_type(site_type(2, 0, 2)),
- key_type(site_type(2, 1, 2)),
- key_type(site_type(2, 2, 2)),
- key_type(site_type(2, 3, 2)),
- key_type(site_type(2, 5, 2)),
+ key_type(site_type(2, -3).index(2)),
+ key_type(site_type(2, -2).index(2)),
+ key_type(site_type(2, 0).index(2)),
+ key_type(site_type(2, 1).index(2)),
+ key_type(site_type(2, 2).index(2)),
+ key_type(site_type(2, 3).index(2)),
+ key_type(site_type(2, 5).index(2)),
     };
     bool res[] = {false, false, false, false, false, false, true};
     CHECK_NODE_COMPARISON(node, nodes, res, 7);
 }
 
 BOOST_AUTO_TEST_CASE(node_comparison_test7) {
- key_type node(site_type(0, 0, 0), site_type(0, 2, 1));
+ key_type node(site_type(0, 0).index(0), site_type(0, 2).index(1));
     key_type nodes[] = {
- key_type(site_type(1, 0, 2)),
- key_type(site_type(1, 1, 2)),
- key_type(site_type(1, 2, 2)),
+ key_type(site_type(1, 0).index(2)),
+ key_type(site_type(1, 1).index(2)),
+ key_type(site_type(1, 2).index(2)),
     };
     bool res[] = {false, false, true};
     CHECK_NODE_COMPARISON(node, nodes, res, 3);
 }
 
 BOOST_AUTO_TEST_CASE(node_comparison_test8) {
- key_type node(site_type(0, 0, 0), site_type(1, 1, 1));
+ key_type node(site_type(0, 0).index(0), site_type(1, 1).index(2));
     key_type nodes[] = {
- key_type(site_type(1, 0, 2)),
- key_type(site_type(1, 1, 2)),
- key_type(site_type(1, 2, 2)),
- key_type(site_type(1, 1, 1), site_type(0, 0, 0)),
+ key_type(site_type(1, 0).index(1)),
+ key_type(site_type(1, 1).index(2)),
+ key_type(site_type(1, 2).index(3)),
+ key_type(site_type(1, 1).index(2), site_type(0, 0).index(0)),
     };
     bool res[] = {false, true, true, true};
     CHECK_NODE_COMPARISON(node, nodes, res, 4);
 }
 
 BOOST_AUTO_TEST_CASE(circle_formation_predicate_test1) {
- site_type site1(0, 0, 0);
- site_type site2(-8, 0, 1);
- site_type site3(0, 6, 2);
+ site_type site1(0, 0);
+ site_type site2(-8, 0);
+ site_type site3(0, 6);
     CHECK_CIRCLE_FORMATION_PREDICATE(site1, site2, site3, -4.0, 3.0, 1.0);
 }
 
 BOOST_AUTO_TEST_CASE(circle_formation_predicate_test2) {
     int min_int = std::numeric_limits<int>::min();
     int max_int = std::numeric_limits<int>::max();
- site_type site1(min_int, min_int, 0);
- site_type site2(min_int, max_int, 1);
- site_type site3(max_int-1, max_int-1, 2);
- site_type site4(max_int, max_int, 3);
+ site_type site1(min_int, min_int);
+ site_type site2(min_int, max_int);
+ site_type site3(max_int-1, max_int-1);
+ site_type site4(max_int, max_int);
     CHECK_CIRCLE_EXISTENCE(site1, site2, site4, true);
     CHECK_CIRCLE_EXISTENCE(site1, site3, site4, false);
 }
 
 BOOST_AUTO_TEST_CASE(circle_formation_predicate_test3) {
- site_type site1(-4, 0, 0);
- site_type site2(0, 4, 1);
- site_type site3(site1.point0(), site2.point0(), 2);
+ site_type site1(-4, 0);
+ site_type site2(0, 4);
+ site_type site3(site1.point0(), site2.point0());
     CHECK_CIRCLE_EXISTENCE(site1, site3, site2, false);
- site_type site4(-2, 0, 3);
- site_type site5(0, 2, 4);
+ site_type site4(-2, 0);
+ site_type site5(0, 2);
     CHECK_CIRCLE_EXISTENCE(site3, site4, site5, false);
     CHECK_CIRCLE_EXISTENCE(site4, site5, site3, false);
 }
 
 BOOST_AUTO_TEST_CASE(circle_formation_predicate_test5) {
- site_type site1(-4, 0, -4, 20, 0);
- site_type site2(-2, 10, 1);
- site_type site3(4, 10, 0);
+ site_type site1(-4, 0, -4, 20);
+ site_type site2(-2, 10);
+ site_type site3(4, 10);
     CHECK_CIRCLE_FORMATION_PREDICATE(site1, site2, site3, 1.0, 6.0, 6.0);
     CHECK_CIRCLE_FORMATION_PREDICATE(site3, site2, site1, 1.0, 14.0, 6.0);
 }
 
 BOOST_AUTO_TEST_CASE(circle_formation_predicate_test6) {
- site_type site1(1, 0, 7, 0, 0);
+ site_type site1(1, 0, 7, 0);
     site1.inverse();
- site_type site2(-2, 4, 10, 4, 1);
- site_type site3(6, 2, 2);
- site_type site4(1, 0, 2);
+ site_type site2(-2, 4, 10, 4);
+ site_type site3(6, 2);
+ site_type site4(1, 0);
     CHECK_CIRCLE_FORMATION_PREDICATE(site3, site1, site2, 4.0, 2.0, 6.0);
     CHECK_CIRCLE_FORMATION_PREDICATE(site4, site2, site1, 1.0, 2.0, 3.0);
 }
 
 BOOST_AUTO_TEST_CASE(circle_formation_predicate_test7) {
- site_type site1(-1, 2, 8, -10, 0);
+ site_type site1(-1, 2, 8, -10);
     site1.inverse();
- site_type site2(-1, 0, 8, 12, 1);
- site_type site3(1, 1, 2);
+ site_type site2(-1, 0, 8, 12);
+ site_type site3(1, 1);
     CHECK_CIRCLE_FORMATION_PREDICATE(site3, site2, site1, 6.0, 1.0, 11.0);
 }
 
 BOOST_AUTO_TEST_CASE(circle_formation_predicate_test8) {
- site_type site1(1, 0, 6, 0, 0);
+ site_type site1(1, 0, 6, 0);
     site1.inverse();
- site_type site2(-6, 4, 0, 12, 1);
- site_type site3(1, 0, 2);
+ site_type site2(-6, 4, 0, 12);
+ site_type site3(1, 0);
     CHECK_CIRCLE_FORMATION_PREDICATE(site3, site2, site1, 1.0, 5.0, 6.0);
 }
 
 BOOST_AUTO_TEST_CASE(circle_formation_predicate_test9) {
- site_type site1(1, 0, 5, 0, 0);
+ site_type site1(1, 0, 5, 0);
     site1.inverse();
- site_type site2(0, 12, 8, 6, 1);
- site_type site3(1, 0, 2);
+ site_type site2(0, 12, 8, 6);
+ site_type site3(1, 0);
     CHECK_CIRCLE_FORMATION_PREDICATE(site3, site2, site1, 1.0, 5.0, 6.0);
 }
 
 BOOST_AUTO_TEST_CASE(circle_formation_predicate_test10) {
- site_type site1(0, 0, 4, 0, 0);
- site_type site2(0, 0, 0, 4, 1);
- site_type site3(0, 4, 4, 4, 2);
+ site_type site1(0, 0, 4, 0);
+ site_type site2(0, 0, 0, 4);
+ site_type site3(0, 4, 4, 4);
     site1.inverse();
     CHECK_CIRCLE_FORMATION_PREDICATE(site1, site2, site3, 2.0, 2.0, 4.0);
 }
 
 BOOST_AUTO_TEST_CASE(circle_formation_predicate_test11) {
- site_type site1(1, 0, 41, 30, 0);
- site_type site2(-39, 30, 1, 60, 1);
- site_type site3(1, 60, 41, 30, 2);
+ site_type site1(1, 0, 41, 30);
+ site_type site2(-39, 30, 1, 60);
+ site_type site3(1, 60, 41, 30);
     site1.inverse();
     CHECK_CIRCLE_FORMATION_PREDICATE(site1, site2, site3, 1.0, 30.0, 25.0);
 }

Modified: sandbox/gtl/libs/polygon/test/voronoi_structures_test.cpp
==============================================================================
--- sandbox/gtl/libs/polygon/test/voronoi_structures_test.cpp (original)
+++ sandbox/gtl/libs/polygon/test/voronoi_structures_test.cpp 2011-10-30 17:01:27 EDT (Sun, 30 Oct 2011)
@@ -31,7 +31,7 @@
 }
 
 BOOST_AUTO_TEST_CASE(site_event_test1) {
- site_type s(1, 2, 0);
+ site_type s(1, 2);
     BOOST_CHECK_EQUAL(s.x0() == s.x1() && s.x1() == 1, true);
     BOOST_CHECK_EQUAL(s.y0() == s.y1() && s.y1() == 2, true);
     BOOST_CHECK_EQUAL(s.index() == 0, true);
@@ -40,7 +40,7 @@
 }
 
 BOOST_AUTO_TEST_CASE(site_event_test2) {
- site_type s(1, 2, 3, 4, 0);
+ site_type s(1, 2, 3, 4);
     BOOST_CHECK_EQUAL(s.x0(true) == 1 && s.x0() == 1, true);
     BOOST_CHECK_EQUAL(s.y0(true) == 2 && s.y0() == 2, true);
     BOOST_CHECK_EQUAL(s.x1(true) == 3 && s.x1() == 3, true);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk