Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80436 - in trunk/boost/polygon: . detail
From: sydorchuk.andriy_at_[hidden]
Date: 2012-09-07 17:32:49


Author: asydorchuk
Date: 2012-09-07 17:32:48 EDT (Fri, 07 Sep 2012)
New Revision: 80436
URL: http://svn.boost.org/trac/boost/changeset/80436

Log:
Polygon: running new headers over c++lint checker.
Text files modified:
   trunk/boost/polygon/detail/voronoi_ctypes.hpp | 16
   trunk/boost/polygon/detail/voronoi_predicates.hpp | 269 +++++--
   trunk/boost/polygon/detail/voronoi_robust_fpt.hpp | 48
   trunk/boost/polygon/detail/voronoi_structures.hpp | 28
   trunk/boost/polygon/segment_concept.hpp | 1334 ++++++++++++++++++++-------------------
   trunk/boost/polygon/segment_data.hpp | 162 ++--
   trunk/boost/polygon/segment_traits.hpp | 9
   trunk/boost/polygon/voronoi.hpp | 3
   trunk/boost/polygon/voronoi_builder.hpp | 93 +-
   trunk/boost/polygon/voronoi_diagram.hpp | 27
   trunk/boost/polygon/voronoi_geometry_type.hpp | 3
   11 files changed, 1054 insertions(+), 938 deletions(-)

Modified: trunk/boost/polygon/detail/voronoi_ctypes.hpp
==============================================================================
--- trunk/boost/polygon/detail/voronoi_ctypes.hpp (original)
+++ trunk/boost/polygon/detail/voronoi_ctypes.hpp 2012-09-07 17:32:48 EDT (Fri, 07 Sep 2012)
@@ -10,10 +10,12 @@
 #ifndef BOOST_POLYGON_DETAIL_VORONOI_CTYPES
 #define BOOST_POLYGON_DETAIL_VORONOI_CTYPES
 
+#include <boost/cstdint.hpp>
+
 #include <cmath>
 #include <cstring>
-
-#include <boost/cstdint.hpp>
+#include <utility>
+#include <vector>
 
 namespace boost {
 namespace polygon {
@@ -70,7 +72,7 @@
 
 template <>
 class extened_exponent_fpt_traits<fpt64> {
-public:
+ public:
   typedef int exp_type;
   static const int kMaxSignificantExpDif;
 };
@@ -82,7 +84,7 @@
 // numbers or NaNs.
 template <typename _fpt, typename _traits = extened_exponent_fpt_traits<_fpt> >
 class extended_exponent_fpt {
-public:
+ public:
   typedef _fpt fpt_type;
   typedef typename _traits::exp_type exp_type;
 
@@ -193,7 +195,7 @@
     return std::ldexp(val_, exp_);
   }
 
-private:
+ private:
   fpt_type val_;
   exp_type exp_;
 };
@@ -223,7 +225,7 @@
 // Supports next set of arithmetic operations: +, -, *.
 template<std::size_t N>
 class extended_int {
-public:
+ public:
   static const uint64 kUInt64LowMask;
   static const uint64 kUInt64HighMask;
 
@@ -482,7 +484,7 @@
     return std::ldexp(p.first, p.second);
   }
 
-private:
+ private:
   void add(const uint32* c1, std::size_t sz1,
            const uint32* c2, std::size_t sz2) {
     if (sz1 < sz2) {

Modified: trunk/boost/polygon/detail/voronoi_predicates.hpp
==============================================================================
--- trunk/boost/polygon/detail/voronoi_predicates.hpp (original)
+++ trunk/boost/polygon/detail/voronoi_predicates.hpp 2012-09-07 17:32:48 EDT (Fri, 07 Sep 2012)
@@ -10,6 +10,8 @@
 #ifndef BOOST_POLYGON_DETAIL_VORONOI_PREDICATES
 #define BOOST_POLYGON_DETAIL_VORONOI_PREDICATES
 
+#include <utility>
+
 #include "voronoi_robust_fpt.hpp"
 
 namespace boost {
@@ -20,7 +22,7 @@
 // be converted to the 32-bit signed integer without precision loss.
 template <typename CTYPE_TRAITS>
 class voronoi_predicates {
-public:
+ public:
   typedef typename CTYPE_TRAITS::int_type int_type;
   typedef typename CTYPE_TRAITS::int_x2_type int_x2_type;
   typedef typename CTYPE_TRAITS::uint_x2_type uint_x2_type;
@@ -76,7 +78,7 @@
   }
 
   typedef struct orientation_test {
- public:
+ public:
     // Represents orientation test result.
     enum Orientation {
       RIGHT = -1,
@@ -117,7 +119,7 @@
 
   template <typename Point>
   class point_comparison_predicate {
- public:
+ public:
     typedef Point point_type;
 
     bool operator()(const point_type& lhs, const point_type& rhs) const {
@@ -129,7 +131,7 @@
 
   template <typename Site, typename Circle>
   class event_comparison_predicate {
- public:
+ public:
     typedef Site site_type;
     typedef Circle circle_type;
 
@@ -144,7 +146,7 @@
         return true;
       } else {
         if (is_vertical(rhs)) {
- if(is_vertical(lhs))
+ if (is_vertical(lhs))
             return lhs.y0() < rhs.y0();
           return false;
         }
@@ -186,14 +188,14 @@
       return yCmp == ulp_cmp_type::LESS;
     }
 
- private:
+ private:
     ulp_cmp_type ulp_cmp;
     to_fpt_converter to_fpt;
   };
 
   template <typename Site>
   class distance_predicate {
- public:
+ public:
     typedef Site site_type;
 
     // Returns true if a horizontal line going through a new site intersects
@@ -217,7 +219,7 @@
       }
     }
 
- private:
+ private:
     // Represents the result of the epsilon robust predicate. If the
     // result is undefined some further processing is usually required.
     enum kPredicateResult {
@@ -319,10 +321,14 @@
         }
         // The relative error is at most 7EPS.
         return k * robust_cross_product(
- static_cast<int_x2_type>(segment1.x()) - static_cast<int_x2_type>(segment0.x()),
- static_cast<int_x2_type>(segment1.y()) - static_cast<int_x2_type>(segment0.y()),
- static_cast<int_x2_type>(point.x()) - static_cast<int_x2_type>(segment0.x()),
- static_cast<int_x2_type>(point.y()) - static_cast<int_x2_type>(segment0.y()));
+ static_cast<int_x2_type>(segment1.x()) -
+ static_cast<int_x2_type>(segment0.x()),
+ static_cast<int_x2_type>(segment1.y()) -
+ static_cast<int_x2_type>(segment0.y()),
+ static_cast<int_x2_type>(point.x()) -
+ static_cast<int_x2_type>(segment0.x()),
+ static_cast<int_x2_type>(point.y()) -
+ static_cast<int_x2_type>(segment0.y()));
       }
     }
 
@@ -350,10 +356,14 @@
         return UNDEFINED;
       } else {
         typename ot::Orientation orientation = ot::eval(
- static_cast<int_x2_type>(segment_end.x()) - static_cast<int_x2_type>(segment_start.x()),
- static_cast<int_x2_type>(segment_end.y()) - static_cast<int_x2_type>(segment_start.y()),
- static_cast<int_x2_type>(new_point.x()) - static_cast<int_x2_type>(site_point.x()),
- static_cast<int_x2_type>(new_point.y()) - static_cast<int_x2_type>(site_point.y()));
+ static_cast<int_x2_type>(segment_end.x()) -
+ static_cast<int_x2_type>(segment_start.x()),
+ static_cast<int_x2_type>(segment_end.y()) -
+ static_cast<int_x2_type>(segment_start.y()),
+ static_cast<int_x2_type>(new_point.x()) -
+ static_cast<int_x2_type>(site_point.x()),
+ static_cast<int_x2_type>(new_point.y()) -
+ static_cast<int_x2_type>(site_point.y()));
         if (orientation == ot::LEFT) {
           if (!right_site.is_inverse())
             return reverse_order ? LESS : UNDEFINED;
@@ -373,14 +383,14 @@
       return UNDEFINED;
     }
 
- private:
+ private:
     ulp_cmp_type ulp_cmp;
     to_fpt_converter to_fpt;
   };
 
   template <typename Node>
   class node_comparison_predicate {
- public:
+ public:
     typedef Node node_type;
     typedef typename Node::site_type site_type;
     typedef typename site_type::coordinate_type coordinate_type;
@@ -423,7 +433,7 @@
       }
     }
 
- private:
+ private:
     // Get the newer site.
     const site_type& get_comparison_site(const node_type& node) const {
       if (node.left_site().sorted_index() > node.right_site().sorted_index()) {
@@ -455,7 +465,7 @@
 
   template <typename Site>
   class circle_existence_predicate {
- public:
+ public:
     typedef typename Site::point_type point_type;
     typedef Site site_type;
 
@@ -525,7 +535,7 @@
 
   template <typename Site, typename Circle>
   class mp_circle_formation_functor {
- public:
+ public:
     typedef typename Site::point_type point_type;
     typedef Site site_type;
     typedef Circle circle_type;
@@ -910,7 +920,7 @@
       }
     }
 
- private:
+ private:
     // Evaluates A[3] + A[0] * sqrt(B[0]) + A[1] * sqrt(B[1]) +
     // A[2] * sqrt(B[3] * (sqrt(B[0] * B[1]) + B[2])).
     template <typename _int, typename _fpt>
@@ -983,7 +993,7 @@
 
   template <typename Site, typename Circle>
   class lazy_circle_formation_functor {
- public:
+ public:
     typedef robust_fpt<fpt_type> robust_fpt_type;
     typedef robust_dif<robust_fpt_type> robust_dif_type;
     typedef typename Site::point_type point_type;
@@ -1001,10 +1011,14 @@
       fpt_type dif_y1 = to_fpt(site1.y()) - to_fpt(site2.y());
       fpt_type dif_y2 = to_fpt(site2.y()) - to_fpt(site3.y());
       fpt_type orientation = robust_cross_product(
- static_cast<int_x2_type>(site1.x()) - static_cast<int_x2_type>(site2.x()),
- static_cast<int_x2_type>(site2.x()) - static_cast<int_x2_type>(site3.x()),
- static_cast<int_x2_type>(site1.y()) - static_cast<int_x2_type>(site2.y()),
- static_cast<int_x2_type>(site2.y()) - static_cast<int_x2_type>(site3.y()));
+ static_cast<int_x2_type>(site1.x()) -
+ static_cast<int_x2_type>(site2.x()),
+ static_cast<int_x2_type>(site2.x()) -
+ static_cast<int_x2_type>(site3.x()),
+ static_cast<int_x2_type>(site1.y()) -
+ static_cast<int_x2_type>(site2.y()),
+ static_cast<int_x2_type>(site2.y()) -
+ static_cast<int_x2_type>(site3.y()));
       robust_fpt_type inv_orientation(to_fpt(0.5) / orientation, to_fpt(2.0));
       fpt_type sum_x1 = to_fpt(site1.x()) + to_fpt(site2.x());
       fpt_type sum_x2 = to_fpt(site2.x()) + to_fpt(site3.x());
@@ -1052,25 +1066,41 @@
       fpt_type vec_x = to_fpt(site2.y()) - to_fpt(site1.y());
       fpt_type vec_y = to_fpt(site1.x()) - to_fpt(site2.x());
       robust_fpt_type teta(robust_cross_product(
- static_cast<int_x2_type>(site3.point1(true).y()) - static_cast<int_x2_type>(site3.point0(true).y()),
- static_cast<int_x2_type>(site3.point0(true).x()) - static_cast<int_x2_type>(site3.point1(true).x()),
- static_cast<int_x2_type>(site2.x()) - static_cast<int_x2_type>(site1.x()),
- static_cast<int_x2_type>(site2.y()) - static_cast<int_x2_type>(site1.y())), to_fpt(1.0));
+ static_cast<int_x2_type>(site3.point1(true).y()) -
+ static_cast<int_x2_type>(site3.point0(true).y()),
+ static_cast<int_x2_type>(site3.point0(true).x()) -
+ static_cast<int_x2_type>(site3.point1(true).x()),
+ static_cast<int_x2_type>(site2.x()) -
+ static_cast<int_x2_type>(site1.x()),
+ static_cast<int_x2_type>(site2.y()) -
+ static_cast<int_x2_type>(site1.y())), to_fpt(1.0));
       robust_fpt_type A(robust_cross_product(
- static_cast<int_x2_type>(site3.point1(true).y()) - static_cast<int_x2_type>(site3.point0(true).y()),
- static_cast<int_x2_type>(site3.point0(true).x()) - static_cast<int_x2_type>(site3.point1(true).x()),
- static_cast<int_x2_type>(site3.point1().y()) - static_cast<int_x2_type>(site1.y()),
- static_cast<int_x2_type>(site1.x()) - static_cast<int_x2_type>(site3.point1().x())), to_fpt(1.0));
+ static_cast<int_x2_type>(site3.point1(true).y()) -
+ static_cast<int_x2_type>(site3.point0(true).y()),
+ static_cast<int_x2_type>(site3.point0(true).x()) -
+ static_cast<int_x2_type>(site3.point1(true).x()),
+ static_cast<int_x2_type>(site3.point1().y()) -
+ static_cast<int_x2_type>(site1.y()),
+ static_cast<int_x2_type>(site1.x()) -
+ static_cast<int_x2_type>(site3.point1().x())), to_fpt(1.0));
       robust_fpt_type B(robust_cross_product(
- static_cast<int_x2_type>(site3.point1(true).y()) - static_cast<int_x2_type>(site3.point0(true).y()),
- static_cast<int_x2_type>(site3.point0(true).x()) - static_cast<int_x2_type>(site3.point1(true).x()),
- static_cast<int_x2_type>(site3.point1().y()) - static_cast<int_x2_type>(site2.y()),
- static_cast<int_x2_type>(site2.x()) - static_cast<int_x2_type>(site3.point1().x())), to_fpt(1.0));
+ static_cast<int_x2_type>(site3.point1(true).y()) -
+ static_cast<int_x2_type>(site3.point0(true).y()),
+ static_cast<int_x2_type>(site3.point0(true).x()) -
+ static_cast<int_x2_type>(site3.point1(true).x()),
+ static_cast<int_x2_type>(site3.point1().y()) -
+ static_cast<int_x2_type>(site2.y()),
+ static_cast<int_x2_type>(site2.x()) -
+ static_cast<int_x2_type>(site3.point1().x())), to_fpt(1.0));
       robust_fpt_type denom(robust_cross_product(
- static_cast<int_x2_type>(site2.y()) - static_cast<int_x2_type>(site1.y()),
- static_cast<int_x2_type>(site1.x()) - static_cast<int_x2_type>(site2.x()),
- static_cast<int_x2_type>(site3.point1(true).y()) - static_cast<int_x2_type>(site3.point0(true).y()),
- static_cast<int_x2_type>(site3.point0(true).x()) - static_cast<int_x2_type>(site3.point1(true).x())), to_fpt(1.0));
+ static_cast<int_x2_type>(site2.y()) -
+ static_cast<int_x2_type>(site1.y()),
+ static_cast<int_x2_type>(site1.x()) -
+ static_cast<int_x2_type>(site2.x()),
+ static_cast<int_x2_type>(site3.point1(true).y()) -
+ static_cast<int_x2_type>(site3.point0(true).y()),
+ static_cast<int_x2_type>(site3.point0(true).x()) -
+ static_cast<int_x2_type>(site3.point1(true).x())), to_fpt(1.0));
       robust_fpt_type inv_segm_len(to_fpt(1.0) /
           get_sqrt(line_a * line_a + line_b * line_b), to_fpt(3.0));
       robust_dif_type t;
@@ -1128,28 +1158,44 @@
       fpt_type b2 = to_fpt(segm_end2.y()) - to_fpt(segm_start2.y());
       bool recompute_c_x, recompute_c_y, recompute_lower_x;
       robust_fpt_type orientation(robust_cross_product(
- static_cast<int_x2_type>(segm_end1.y()) - static_cast<int_x2_type>(segm_start1.y()),
- static_cast<int_x2_type>(segm_end1.x()) - static_cast<int_x2_type>(segm_start1.x()),
- static_cast<int_x2_type>(segm_end2.y()) - static_cast<int_x2_type>(segm_start2.y()),
- static_cast<int_x2_type>(segm_end2.x()) - static_cast<int_x2_type>(segm_start2.x())), to_fpt(1.0));
+ static_cast<int_x2_type>(segm_end1.y()) -
+ static_cast<int_x2_type>(segm_start1.y()),
+ static_cast<int_x2_type>(segm_end1.x()) -
+ static_cast<int_x2_type>(segm_start1.x()),
+ static_cast<int_x2_type>(segm_end2.y()) -
+ static_cast<int_x2_type>(segm_start2.y()),
+ static_cast<int_x2_type>(segm_end2.x()) -
+ static_cast<int_x2_type>(segm_start2.x())), to_fpt(1.0));
       if (ot::eval(orientation) == ot::COLLINEAR) {
         robust_fpt_type a(a1 * a1 + b1 * b1, to_fpt(2.0));
         robust_fpt_type c(robust_cross_product(
- static_cast<int_x2_type>(segm_end1.y()) - static_cast<int_x2_type>(segm_start1.y()),
- static_cast<int_x2_type>(segm_end1.x()) - static_cast<int_x2_type>(segm_start1.x()),
- static_cast<int_x2_type>(segm_start2.y()) - static_cast<int_x2_type>(segm_start1.y()),
- static_cast<int_x2_type>(segm_start2.x()) - static_cast<int_x2_type>(segm_start1.x())), to_fpt(1.0));
+ static_cast<int_x2_type>(segm_end1.y()) -
+ static_cast<int_x2_type>(segm_start1.y()),
+ static_cast<int_x2_type>(segm_end1.x()) -
+ static_cast<int_x2_type>(segm_start1.x()),
+ static_cast<int_x2_type>(segm_start2.y()) -
+ static_cast<int_x2_type>(segm_start1.y()),
+ static_cast<int_x2_type>(segm_start2.x()) -
+ static_cast<int_x2_type>(segm_start1.x())), to_fpt(1.0));
         robust_fpt_type det(
             robust_cross_product(
- static_cast<int_x2_type>(segm_end1.x()) - static_cast<int_x2_type>(segm_start1.x()),
- static_cast<int_x2_type>(segm_end1.y()) - static_cast<int_x2_type>(segm_start1.y()),
- static_cast<int_x2_type>(site1.x()) - static_cast<int_x2_type>(segm_start1.x()),
- static_cast<int_x2_type>(site1.y()) - static_cast<int_x2_type>(segm_start1.y())) *
+ static_cast<int_x2_type>(segm_end1.x()) -
+ static_cast<int_x2_type>(segm_start1.x()),
+ static_cast<int_x2_type>(segm_end1.y()) -
+ static_cast<int_x2_type>(segm_start1.y()),
+ static_cast<int_x2_type>(site1.x()) -
+ static_cast<int_x2_type>(segm_start1.x()),
+ static_cast<int_x2_type>(site1.y()) -
+ static_cast<int_x2_type>(segm_start1.y())) *
             robust_cross_product(
- static_cast<int_x2_type>(segm_end1.y()) - static_cast<int_x2_type>(segm_start1.y()),
- static_cast<int_x2_type>(segm_end1.x()) - static_cast<int_x2_type>(segm_start1.x()),
- static_cast<int_x2_type>(site1.y()) - static_cast<int_x2_type>(segm_start2.y()),
- static_cast<int_x2_type>(site1.x()) - static_cast<int_x2_type>(segm_start2.x())),
+ static_cast<int_x2_type>(segm_end1.y()) -
+ static_cast<int_x2_type>(segm_start1.y()),
+ static_cast<int_x2_type>(segm_end1.x()) -
+ static_cast<int_x2_type>(segm_start1.x()),
+ static_cast<int_x2_type>(site1.y()) -
+ static_cast<int_x2_type>(segm_start2.y()),
+ static_cast<int_x2_type>(site1.x()) -
+ static_cast<int_x2_type>(segm_start2.x())),
             to_fpt(3.0));
         robust_dif_type t;
         t -= robust_fpt_type(a1) * robust_fpt_type((
@@ -1186,37 +1232,54 @@
         robust_fpt_type sqr_sum1(get_sqrt(a1 * a1 + b1 * b1), to_fpt(2.0));
         robust_fpt_type sqr_sum2(get_sqrt(a2 * a2 + b2 * b2), to_fpt(2.0));
         robust_fpt_type a(robust_cross_product(
- static_cast<int_x2_type>(segm_end1.x()) - static_cast<int_x2_type>(segm_start1.x()),
- static_cast<int_x2_type>(segm_end1.y()) - static_cast<int_x2_type>(segm_start1.y()),
- static_cast<int_x2_type>(segm_start2.y()) - static_cast<int_x2_type>(segm_end2.y()),
- static_cast<int_x2_type>(segm_end2.x()) - static_cast<int_x2_type>(segm_start2.x())), to_fpt(1.0));
+ static_cast<int_x2_type>(segm_end1.x()) -
+ static_cast<int_x2_type>(segm_start1.x()),
+ static_cast<int_x2_type>(segm_end1.y()) -
+ static_cast<int_x2_type>(segm_start1.y()),
+ static_cast<int_x2_type>(segm_start2.y()) -
+ static_cast<int_x2_type>(segm_end2.y()),
+ static_cast<int_x2_type>(segm_end2.x()) -
+ static_cast<int_x2_type>(segm_start2.x())), to_fpt(1.0));
         if (!is_neg(a)) {
           a += sqr_sum1 * sqr_sum2;
         } else {
           a = (orientation * orientation) / (sqr_sum1 * sqr_sum2 - a);
         }
         robust_fpt_type or1(robust_cross_product(
- static_cast<int_x2_type>(segm_end1.y()) - static_cast<int_x2_type>(segm_start1.y()),
- static_cast<int_x2_type>(segm_end1.x()) - static_cast<int_x2_type>(segm_start1.x()),
- static_cast<int_x2_type>(segm_end1.y()) - static_cast<int_x2_type>(site1.y()),
- static_cast<int_x2_type>(segm_end1.x()) - static_cast<int_x2_type>(site1.x())), to_fpt(1.0));
+ static_cast<int_x2_type>(segm_end1.y()) -
+ static_cast<int_x2_type>(segm_start1.y()),
+ static_cast<int_x2_type>(segm_end1.x()) -
+ static_cast<int_x2_type>(segm_start1.x()),
+ static_cast<int_x2_type>(segm_end1.y()) -
+ static_cast<int_x2_type>(site1.y()),
+ static_cast<int_x2_type>(segm_end1.x()) -
+ static_cast<int_x2_type>(site1.x())), to_fpt(1.0));
         robust_fpt_type or2(robust_cross_product(
- static_cast<int_x2_type>(segm_end2.x()) - static_cast<int_x2_type>(segm_start2.x()),
- static_cast<int_x2_type>(segm_end2.y()) - static_cast<int_x2_type>(segm_start2.y()),
- static_cast<int_x2_type>(segm_end2.x()) - static_cast<int_x2_type>(site1.x()),
- static_cast<int_x2_type>(segm_end2.y()) - static_cast<int_x2_type>(site1.y())), to_fpt(1.0));
+ static_cast<int_x2_type>(segm_end2.x()) -
+ static_cast<int_x2_type>(segm_start2.x()),
+ static_cast<int_x2_type>(segm_end2.y()) -
+ static_cast<int_x2_type>(segm_start2.y()),
+ static_cast<int_x2_type>(segm_end2.x()) -
+ static_cast<int_x2_type>(site1.x()),
+ static_cast<int_x2_type>(segm_end2.y()) -
+ static_cast<int_x2_type>(site1.y())), to_fpt(1.0));
         robust_fpt_type det = robust_fpt_type(to_fpt(2.0)) * a * or1 * or2;
         robust_fpt_type c1(robust_cross_product(
- static_cast<int_x2_type>(segm_end1.y()) - static_cast<int_x2_type>(segm_start1.y()),
- static_cast<int_x2_type>(segm_end1.x()) - static_cast<int_x2_type>(segm_start1.x()),
+ static_cast<int_x2_type>(segm_end1.y()) -
+ static_cast<int_x2_type>(segm_start1.y()),
+ static_cast<int_x2_type>(segm_end1.x()) -
+ static_cast<int_x2_type>(segm_start1.x()),
             static_cast<int_x2_type>(segm_end1.y()),
             static_cast<int_x2_type>(segm_end1.x())), to_fpt(1.0));
         robust_fpt_type c2(robust_cross_product(
- static_cast<int_x2_type>(segm_end2.x()) - static_cast<int_x2_type>(segm_start2.x()),
- static_cast<int_x2_type>(segm_end2.y()) - static_cast<int_x2_type>(segm_start2.y()),
+ static_cast<int_x2_type>(segm_end2.x()) -
+ static_cast<int_x2_type>(segm_start2.x()),
+ static_cast<int_x2_type>(segm_end2.y()) -
+ static_cast<int_x2_type>(segm_start2.y()),
             static_cast<int_x2_type>(segm_end2.x()),
             static_cast<int_x2_type>(segm_end2.y())), to_fpt(1.0));
- robust_fpt_type inv_orientation = robust_fpt_type(to_fpt(1.0)) / orientation;
+ robust_fpt_type inv_orientation =
+ robust_fpt_type(to_fpt(1.0)) / orientation;
         robust_dif_type t, b, ix, iy;
         ix += robust_fpt_type(a2) * c1 * inv_orientation;
         ix += robust_fpt_type(a1) * c2 * inv_orientation;
@@ -1228,13 +1291,17 @@
         b += iy * (robust_fpt_type(b1) * sqr_sum2);
         b += iy * (robust_fpt_type(b2) * sqr_sum1);
         b -= sqr_sum1 * robust_fpt_type(robust_cross_product(
- static_cast<int_x2_type>(segm_end2.x()) - static_cast<int_x2_type>(segm_start2.x()),
- static_cast<int_x2_type>(segm_end2.y()) - static_cast<int_x2_type>(segm_start2.y()),
+ static_cast<int_x2_type>(segm_end2.x()) -
+ static_cast<int_x2_type>(segm_start2.x()),
+ static_cast<int_x2_type>(segm_end2.y()) -
+ static_cast<int_x2_type>(segm_start2.y()),
             static_cast<int_x2_type>(-site1.y()),
             static_cast<int_x2_type>(site1.x())), to_fpt(1.0));
         b -= sqr_sum2 * robust_fpt_type(robust_cross_product(
- static_cast<int_x2_type>(segm_end1.x()) - static_cast<int_x2_type>(segm_start1.x()),
- static_cast<int_x2_type>(segm_end1.y()) - static_cast<int_x2_type>(segm_start1.y()),
+ static_cast<int_x2_type>(segm_end1.x()) -
+ static_cast<int_x2_type>(segm_start1.x()),
+ static_cast<int_x2_type>(segm_end1.y()) -
+ static_cast<int_x2_type>(segm_start1.y()),
             static_cast<int_x2_type>(-site1.y()),
             static_cast<int_x2_type>(site1.x())), to_fpt(1.0));
         t -= b;
@@ -1297,20 +1364,32 @@
       robust_fpt_type len2 = (a2 * a2 + b2 * b2).sqrt();
       robust_fpt_type len3 = (a3 * a3 + b3 * b3).sqrt();
       robust_fpt_type cross_12(robust_cross_product(
- static_cast<int_x2_type>(site1.x1(true)) - static_cast<int_x2_type>(site1.x0(true)),
- static_cast<int_x2_type>(site1.y1(true)) - static_cast<int_x2_type>(site1.y0(true)),
- static_cast<int_x2_type>(site2.x1(true)) - static_cast<int_x2_type>(site2.x0(true)),
- static_cast<int_x2_type>(site2.y1(true)) - static_cast<int_x2_type>(site2.y0(true))), to_fpt(1.0));
+ static_cast<int_x2_type>(site1.x1(true)) -
+ static_cast<int_x2_type>(site1.x0(true)),
+ static_cast<int_x2_type>(site1.y1(true)) -
+ static_cast<int_x2_type>(site1.y0(true)),
+ static_cast<int_x2_type>(site2.x1(true)) -
+ static_cast<int_x2_type>(site2.x0(true)),
+ static_cast<int_x2_type>(site2.y1(true)) -
+ static_cast<int_x2_type>(site2.y0(true))), to_fpt(1.0));
       robust_fpt_type cross_23(robust_cross_product(
- static_cast<int_x2_type>(site2.x1(true)) - static_cast<int_x2_type>(site2.x0(true)),
- static_cast<int_x2_type>(site2.y1(true)) - static_cast<int_x2_type>(site2.y0(true)),
- static_cast<int_x2_type>(site3.x1(true)) - static_cast<int_x2_type>(site3.x0(true)),
- static_cast<int_x2_type>(site3.y1(true)) - static_cast<int_x2_type>(site3.y0(true))), to_fpt(1.0));
+ static_cast<int_x2_type>(site2.x1(true)) -
+ static_cast<int_x2_type>(site2.x0(true)),
+ static_cast<int_x2_type>(site2.y1(true)) -
+ static_cast<int_x2_type>(site2.y0(true)),
+ static_cast<int_x2_type>(site3.x1(true)) -
+ static_cast<int_x2_type>(site3.x0(true)),
+ static_cast<int_x2_type>(site3.y1(true)) -
+ static_cast<int_x2_type>(site3.y0(true))), to_fpt(1.0));
       robust_fpt_type cross_31(robust_cross_product(
- static_cast<int_x2_type>(site3.x1(true)) - static_cast<int_x2_type>(site3.x0(true)),
- static_cast<int_x2_type>(site3.y1(true)) - static_cast<int_x2_type>(site3.y0(true)),
- static_cast<int_x2_type>(site1.x1(true)) - static_cast<int_x2_type>(site1.x0(true)),
- static_cast<int_x2_type>(site1.y1(true)) - static_cast<int_x2_type>(site1.y0(true))), to_fpt(1.0));
+ static_cast<int_x2_type>(site3.x1(true)) -
+ static_cast<int_x2_type>(site3.x0(true)),
+ static_cast<int_x2_type>(site3.y1(true)) -
+ static_cast<int_x2_type>(site3.y0(true)),
+ static_cast<int_x2_type>(site1.x1(true)) -
+ static_cast<int_x2_type>(site1.x0(true)),
+ static_cast<int_x2_type>(site1.y1(true)) -
+ static_cast<int_x2_type>(site1.y0(true))), to_fpt(1.0));
       robust_dif_type denom, c_x, c_y, r;
 
       // denom = cross_12 * len3 + cross_23 * len1 + cross_31 * len2.
@@ -1352,7 +1431,7 @@
       }
     }
 
- private:
+ private:
     exact_circle_formation_functor_type exact_circle_formation_functor_;
     to_fpt_converter to_fpt;
   };
@@ -1362,7 +1441,7 @@
             typename CEP = circle_existence_predicate<Site>,
             typename CFF = lazy_circle_formation_functor<Site, Circle> >
   class circle_formation_predicate {
- public:
+ public:
     typedef Site site_type;
     typedef Circle circle_type;
     typedef CEP circle_existence_predicate_type;
@@ -1429,7 +1508,7 @@
       return true;
     }
 
- private:
+ private:
     circle_existence_predicate_type circle_existence_predicate_;
     circle_formation_functor_type circle_formation_functor_;
   };

Modified: trunk/boost/polygon/detail/voronoi_robust_fpt.hpp
==============================================================================
--- trunk/boost/polygon/detail/voronoi_robust_fpt.hpp (original)
+++ trunk/boost/polygon/detail/voronoi_robust_fpt.hpp 2012-09-07 17:32:48 EDT (Fri, 07 Sep 2012)
@@ -77,7 +77,7 @@
 
 template <typename _fpt>
 class robust_fpt {
-public:
+ public:
   typedef _fpt floating_point_type;
   typedef _fpt relative_error_type;
 
@@ -85,7 +85,7 @@
   static const relative_error_type ROUNDING_ERROR;
 
   robust_fpt() : fpv_(0.0), re_(0.0) {}
- robust_fpt(floating_point_type fpv) :
+ explicit robust_fpt(floating_point_type fpv) :
       fpv_(fpv), re_(0.0) {}
   robust_fpt(floating_point_type fpv, relative_error_type error) :
       fpv_(fpv), re_(error) {}
@@ -119,9 +119,9 @@
   robust_fpt& operator+=(const robust_fpt& that) {
     floating_point_type fpv = this->fpv_ + that.fpv_;
     if ((!is_neg(this->fpv_) && !is_neg(that.fpv_)) ||
- (!is_pos(this->fpv_) && !is_pos(that.fpv_)))
+ (!is_pos(this->fpv_) && !is_pos(that.fpv_))) {
       this->re_ = (std::max)(this->re_, that.re_) + ROUNDING_ERROR;
- else {
+ } else {
       floating_point_type temp =
         (this->fpv_ * this->re_ - that.fpv_ * that.re_) / fpv;
       if (is_neg(temp))
@@ -135,9 +135,9 @@
   robust_fpt& operator-=(const robust_fpt& that) {
     floating_point_type fpv = this->fpv_ - that.fpv_;
     if ((!is_neg(this->fpv_) && !is_pos(that.fpv_)) ||
- (!is_pos(this->fpv_) && !is_neg(that.fpv_)))
+ (!is_pos(this->fpv_) && !is_neg(that.fpv_))) {
        this->re_ = (std::max)(this->re_, that.re_) + ROUNDING_ERROR;
- else {
+ } else {
       floating_point_type temp =
         (this->fpv_ * this->re_ + that.fpv_ * that.re_) / fpv;
       if (is_neg(temp))
@@ -164,9 +164,9 @@
     floating_point_type fpv = this->fpv_ + that.fpv_;
     relative_error_type re;
     if ((!is_neg(this->fpv_) && !is_neg(that.fpv_)) ||
- (!is_pos(this->fpv_) && !is_pos(that.fpv_)))
+ (!is_pos(this->fpv_) && !is_pos(that.fpv_))) {
       re = (std::max)(this->re_, that.re_) + ROUNDING_ERROR;
- else {
+ } else {
       floating_point_type temp =
         (this->fpv_ * this->re_ - that.fpv_ * that.re_) / fpv;
       if (is_neg(temp))
@@ -180,9 +180,9 @@
     floating_point_type fpv = this->fpv_ - that.fpv_;
     relative_error_type re;
     if ((!is_neg(this->fpv_) && !is_pos(that.fpv_)) ||
- (!is_pos(this->fpv_) && !is_neg(that.fpv_)))
+ (!is_pos(this->fpv_) && !is_neg(that.fpv_))) {
       re = (std::max)(this->re_, that.re_) + ROUNDING_ERROR;
- else {
+ } else {
       floating_point_type temp =
         (this->fpv_ * this->re_ + that.fpv_ * that.re_) / fpv;
       if (is_neg(temp))
@@ -210,7 +210,7 @@
                       ROUNDING_ERROR);
   }
 
-private:
+ private:
   floating_point_type fpv_;
   relative_error_type re_;
 };
@@ -246,14 +246,14 @@
 // value1. The structure implicitly avoids difference computation.
 template <typename T>
 class robust_dif {
-public:
+ public:
   robust_dif() :
       positive_sum_(0),
       negative_sum_(0) {}
 
- robust_dif(const T& value) :
- positive_sum_((value>0)?value:0),
- negative_sum_((value<0)?-value:0) {}
+ explicit robust_dif(const T& value) :
+ positive_sum_((value > 0)?value:0),
+ negative_sum_((value < 0)?-value:0) {}
 
   robust_dif(const T& pos, const T& neg) :
       positive_sum_(pos),
@@ -337,7 +337,7 @@
     return *this;
   }
 
-private:
+ private:
   void swap() {
     (std::swap)(positive_sum_, negative_sum_);
   }
@@ -434,7 +434,7 @@
 // sum(i = 1 .. n)(A[i] * sqrt(B[i])), 1 <= n <= 4.
 template <typename _int, typename _fpt, typename _converter>
 class robust_sqrt_expr {
-public:
+ public:
   static const unsigned int EVAL1_MAX_RELATIVE_ERROR;
   static const unsigned int EVAL2_MAX_RELATIVE_ERROR;
   static const unsigned int EVAL3_MAX_RELATIVE_ERROR;
@@ -494,20 +494,24 @@
     return eval3(tA, tB) / (a - b);
   }
 
-private:
+ private:
   _int tA[5];
   _int tB[5];
   _converter convert;
 };
 
 template <typename _int, typename _fpt, typename _converter>
-const unsigned int robust_sqrt_expr<_int, _fpt, _converter>::EVAL1_MAX_RELATIVE_ERROR = 4;
+const unsigned int robust_sqrt_expr<_int, _fpt, _converter>::
+ EVAL1_MAX_RELATIVE_ERROR = 4;
 template <typename _int, typename _fpt, typename _converter>
-const unsigned int robust_sqrt_expr<_int, _fpt, _converter>::EVAL2_MAX_RELATIVE_ERROR = 7;
+const unsigned int robust_sqrt_expr<_int, _fpt, _converter>::
+ EVAL2_MAX_RELATIVE_ERROR = 7;
 template <typename _int, typename _fpt, typename _converter>
-const unsigned int robust_sqrt_expr<_int, _fpt, _converter>::EVAL3_MAX_RELATIVE_ERROR = 16;
+const unsigned int robust_sqrt_expr<_int, _fpt, _converter>::
+ EVAL3_MAX_RELATIVE_ERROR = 16;
 template <typename _int, typename _fpt, typename _converter>
-const unsigned int robust_sqrt_expr<_int, _fpt, _converter>::EVAL4_MAX_RELATIVE_ERROR = 25;
+const unsigned int robust_sqrt_expr<_int, _fpt, _converter>::
+ EVAL4_MAX_RELATIVE_ERROR = 25;
 } // detail
 } // polygon
 } // boost

Modified: trunk/boost/polygon/detail/voronoi_structures.hpp
==============================================================================
--- trunk/boost/polygon/detail/voronoi_structures.hpp (original)
+++ trunk/boost/polygon/detail/voronoi_structures.hpp 2012-09-07 17:32:48 EDT (Fri, 07 Sep 2012)
@@ -22,7 +22,7 @@
 // Cartesian 2D point data structure.
 template <typename T>
 class point_2d {
-public:
+ public:
   typedef T coordinate_type;
 
   point_2d() {}
@@ -57,7 +57,7 @@
     return *this;
   }
 
-private:
+ private:
   coordinate_type x_;
   coordinate_type y_;
 };
@@ -85,7 +85,7 @@
 // Note: for all sites is_inverse_ flag is equal to false by default.
 template <typename T>
 class site_event {
-public:
+ public:
   typedef T coordinate_type;
   typedef point_2d<T> point_type;
 
@@ -101,7 +101,7 @@
       sorted_index_(0),
       flags_(0) {}
 
- site_event(const point_type& point) :
+ explicit site_event(const point_type& point) :
       point0_(point),
       point1_(point),
       sorted_index_(0),
@@ -218,7 +218,7 @@
     return (point0_.x() != point1_.x()) || (point0_.y() != point1_.y());
   }
 
-private:
+ private:
   enum Bits {
     IS_INVERSE = 0x20 // 32
   };
@@ -244,7 +244,7 @@
 // NOTE: lower_y coordinate is always equal to center_y.
 template <typename T>
 class circle_event {
-public:
+ public:
   typedef T coordinate_type;
 
   circle_event() : is_active_(true) {}
@@ -297,7 +297,7 @@
     return *this;
   }
 
-private:
+ private:
   coordinate_type center_x_;
   coordinate_type center_y_;
   coordinate_type lower_x_;
@@ -313,7 +313,7 @@
 // events ordering.
 template <typename T, typename Predicate>
 class ordered_queue {
-public:
+ public:
   ordered_queue() {}
 
   bool empty() const {
@@ -342,7 +342,7 @@
     c_list_.clear();
   }
 
-private:
+ private:
   typedef typename std::list<T>::iterator list_iterator_type;
 
   struct comparison {
@@ -358,7 +358,7 @@
                        comparison > c_;
   std::list<T> c_list_;
 
- //Disallow copy constructor and operator=
+ // Disallow copy constructor and operator=
   ordered_queue(const ordered_queue&);
   void operator=(const ordered_queue&);
 };
@@ -374,7 +374,7 @@
 // processed by the algorithm later (has greater index).
 template <typename Site>
 class beach_line_node_key {
-public:
+ public:
   typedef Site site_type;
 
   // Constructs degenerate bisector, used to search an arc that is above
@@ -416,7 +416,7 @@
     return *this;
   }
 
-private:
+ private:
   site_type left_site_;
   site_type right_site_;
 };
@@ -427,7 +427,7 @@
 // queue if the edge corresponds to the right bisector of the circle event.
 template <typename Edge, typename Circle>
 class beach_line_node_data {
-public:
+ public:
   explicit beach_line_node_data(Edge* new_edge) :
       circle_event_(NULL),
       edge_(new_edge) {}
@@ -450,7 +450,7 @@
     return *this;
   }
 
-private:
+ private:
   Circle* circle_event_;
   Edge* edge_;
 };

Modified: trunk/boost/polygon/segment_concept.hpp
==============================================================================
--- trunk/boost/polygon/segment_concept.hpp (original)
+++ trunk/boost/polygon/segment_concept.hpp 2012-09-07 17:32:48 EDT (Fri, 07 Sep 2012)
@@ -13,722 +13,742 @@
 #include "segment_traits.hpp"
 #include "rectangle_concept.hpp"
 
-namespace boost { namespace polygon{
- struct segment_concept {};
+namespace boost {
+namespace polygon {
+struct segment_concept {};
+
+template <typename Segment>
+struct is_segment_concept {
+ typedef gtl_no type;
+};
+
+template <>
+struct is_segment_concept<segment_concept> {
+ typedef gtl_yes type;
+};
+
+template <typename Segment>
+struct is_mutable_segment_concept {
+ typedef gtl_no type;
+};
+
+template <>
+struct is_mutable_segment_concept<segment_concept> {
+ typedef gtl_yes type;
+};
+
+template <typename Segment, typename CT>
+struct segment_distance_type_by_concept {
+ typedef void type;
+};
+
+template <typename Segment>
+struct segment_distance_type_by_concept<Segment, gtl_yes> {
+ typedef typename coordinate_traits<
+ typename segment_traits<Segment>::coordinate_type
+ >::coordinate_distance type;
+};
+
+template <typename Segment>
+struct segment_distance_type {
+ typedef typename segment_distance_type_by_concept<
+ Segment,
+ typename is_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type
+ >::type type;
+};
+
+template <typename Segment, typename CT>
+struct segment_point_type_by_concept {
+ typedef void type;
+};
+
+template <typename Segment>
+struct segment_point_type_by_concept<Segment, gtl_yes> {
+ typedef typename segment_traits<Segment>::point_type type;
+};
+
+template <typename Segment>
+struct segment_point_type {
+ typedef typename segment_point_type_by_concept<
+ Segment,
+ typename is_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type
+ >::type type;
+};
+
+template <typename Segment, typename CT>
+struct segment_coordinate_type_by_concept {
+ typedef void type;
+};
+
+template <typename Segment>
+struct segment_coordinate_type_by_concept<Segment, gtl_yes> {
+ typedef typename segment_traits<Segment>::coordinate_type type;
+};
+
+template <typename Segment>
+struct segment_coordinate_type {
+ typedef typename segment_coordinate_type_by_concept<
+ Segment,
+ typename is_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type
+ >::type type;
+};
+
+struct y_s_get : gtl_yes {};
+
+template <typename Segment>
+typename enable_if<
+ typename gtl_and<
+ y_s_get,
+ typename is_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type
+ >::type,
+ typename segment_point_type<Segment>::type
+>::type
+get(const Segment& segment, direction_1d dir) {
+ return segment_traits<Segment>::get(segment, dir);
+}
 
- template <typename Segment>
- struct is_segment_concept { typedef gtl_no type; };
+struct y_s_set : gtl_yes {};
 
- template <>
- struct is_segment_concept<segment_concept> {
- typedef gtl_yes type;
- };
-
- template <typename Segment>
- struct is_mutable_segment_concept { typedef gtl_no type; };
-
- template <>
- struct is_mutable_segment_concept<segment_concept> {
- typedef gtl_yes type;
- };
-
- template <typename Segment, typename CT>
- struct segment_distance_type_by_concept {
- typedef void type;
- };
-
- template <typename Segment>
- struct segment_distance_type_by_concept<Segment, gtl_yes> {
- typedef typename coordinate_traits<
- typename segment_traits<Segment>::coordinate_type
- >::coordinate_distance type;
- };
-
- template <typename Segment>
- struct segment_distance_type {
- typedef typename segment_distance_type_by_concept<
- Segment,
- typename is_segment_concept<
- typename geometry_concept<Segment>::type
- >::type
- >::type type;
- };
-
- template <typename Segment, typename CT>
- struct segment_point_type_by_concept { typedef void type; };
-
- template <typename Segment>
- struct segment_point_type_by_concept<Segment, gtl_yes> {
- typedef typename segment_traits<Segment>::point_type type;
- };
-
- template <typename Segment>
- struct segment_point_type {
- typedef typename segment_point_type_by_concept<
- Segment,
- typename is_segment_concept<
- typename geometry_concept<Segment>::type
- >::type
- >::type type;
- };
-
- template <typename Segment, typename CT>
- struct segment_coordinate_type_by_concept {
- typedef void type;
- };
-
- template <typename Segment>
- struct segment_coordinate_type_by_concept<Segment, gtl_yes> {
- typedef typename segment_traits<Segment>::coordinate_type type;
- };
-
- template <typename Segment>
- struct segment_coordinate_type {
- typedef typename segment_coordinate_type_by_concept<
- Segment,
- typename is_segment_concept<
- typename geometry_concept<Segment>::type
- >::type
- >::type type;
- };
-
- struct y_s_get : gtl_yes {};
-
- template <typename Segment>
- typename enable_if<
- typename gtl_and<
- y_s_get,
- typename is_segment_concept<
- typename geometry_concept<Segment>::type
- >::type
- >::type,
- typename segment_point_type<Segment>::type
- >::type
- get(const Segment& segment, direction_1d dir) {
- return segment_traits<Segment>::get(segment, dir);
- }
+template <typename Segment, typename Point>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_set,
+ typename is_mutable_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
+ >::type
+ >::type,
+ void
+>::type
+set(Segment& segment, direction_1d dir, const Point& point) {
+ segment_mutable_traits<Segment>::set(segment, dir, point);
+}
 
- struct y_s_set : gtl_yes {};
+struct y_s_construct : gtl_yes {};
 
- template <typename Segment, typename Point>
- typename enable_if<
- typename gtl_and_3<
- y_s_set,
- typename is_mutable_segment_concept<
- typename geometry_concept<Segment>::type
- >::type,
- typename is_point_concept<
- typename geometry_concept<Point>::type
- >::type
- >::type,
- void
- >::type
- set(Segment& segment, direction_1d dir, const Point& point) {
- segment_mutable_traits<Segment>::set(segment, dir, point);
- }
+template <typename Segment, typename Point1, typename Point2>
+typename enable_if<
+ typename gtl_and_4<
+ y_s_construct,
+ typename is_mutable_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point1>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point2>::type
+ >::type
+ >::type,
+ Segment
+>::type
+construct(const Point1& low, const Point2& high) {
+ return segment_mutable_traits<Segment>::construct(low, high);
+}
 
- struct y_s_construct : gtl_yes {};
+struct y_s_copy_construct : gtl_yes {};
 
- template <typename Segment, typename Point1, typename Point2>
- typename enable_if<
- typename gtl_and_4<
- y_s_construct,
- typename is_mutable_segment_concept<
- typename geometry_concept<Segment>::type
- >::type,
- typename is_point_concept<
- typename geometry_concept<Point1>::type
- >::type,
- typename is_point_concept<
- typename geometry_concept<Point2>::type
- >::type
- >::type,
- Segment
- >::type
- construct(const Point1& low, const Point2& high) {
- return segment_mutable_traits<Segment>::construct(low, high);
- }
+template <typename Segment1, typename Segment2>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_copy_construct,
+ typename is_mutable_segment_concept<
+ typename geometry_concept<Segment1>::type
+ >::type,
+ typename is_segment_concept<
+ typename geometry_concept<Segment2>::type
+ >::type
+ >::type,
+ Segment1
+>::type
+copy_construct(const Segment2& segment) {
+ return construct<Segment1>(get(segment, LOW), get(segment, HIGH));
+}
 
- struct y_s_copy_construct : gtl_yes {};
+struct y_s_assign : gtl_yes {};
 
- template <typename Segment1, typename Segment2>
- typename enable_if<
- typename gtl_and_3<
- y_s_copy_construct,
- typename is_mutable_segment_concept<
- typename geometry_concept<Segment1>::type
- >::type,
- typename is_segment_concept<
- typename geometry_concept<Segment2>::type
- >::type
- >::type,
- Segment1
- >::type
- copy_construct(const Segment2& segment) {
- return construct<Segment1>(get(segment, LOW), get(segment, HIGH));
- }
+template <typename Segment1, typename Segment2>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_assign,
+ typename is_mutable_segment_concept<
+ typename geometry_concept<Segment1>::type
+ >::type,
+ typename is_segment_concept<
+ typename geometry_concept<Segment2>::type
+ >::type
+ >::type,
+ Segment1
+>::type &
+assign(Segment1& segment1, const Segment2& segment2) {
+ return segment1 = copy_construct<Segment1>(segment2);
+}
 
- struct y_s_assign : gtl_yes {};
+struct y_s_equivalence : gtl_yes {};
 
- template <typename Segment1, typename Segment2>
- typename enable_if<
- typename gtl_and_3<
- y_s_assign,
- typename is_mutable_segment_concept<
- typename geometry_concept<Segment1>::type
- >::type,
- typename is_segment_concept<
- typename geometry_concept<Segment2>::type
- >::type
- >::type,
- Segment1
- >::type &
- assign(Segment1& segment1, const Segment2& segment2) {
- return segment1 = copy_construct<Segment1>(segment2);
- }
+template <typename Segment1, typename Segment2>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_equivalence,
+ typename is_segment_concept<
+ typename geometry_concept<Segment1>::type
+ >::type,
+ typename is_segment_concept<
+ typename geometry_concept<Segment2>::type
+ >::type
+ >::type,
+ bool
+>::type
+equivalence(const Segment1& segment1, const Segment2& segment2) {
+ return get(segment1, LOW) == get(segment2, LOW) &&
+ get(segment1, HIGH) == get(segment2, HIGH);
+}
 
- struct y_s_equivalence : gtl_yes {};
+struct y_s_low : gtl_yes {};
 
- template <typename Segment1, typename Segment2>
- typename enable_if<
- typename gtl_and_3<
- y_s_equivalence,
- typename is_segment_concept<
- typename geometry_concept<Segment1>::type
- >::type,
- typename is_segment_concept<
- typename geometry_concept<Segment2>::type
- >::type
- >::type,
- bool
- >::type
- equivalence(const Segment1& segment1, const Segment2& segment2) {
- return get(segment1, LOW) == get(segment2, LOW) &&
- get(segment1, HIGH) == get(segment2, HIGH);
- }
+template <typename Segment>
+typename enable_if<
+ typename gtl_and<
+ y_s_low,
+ typename is_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type
+ >::type,
+ typename segment_point_type<Segment>::type
+>::type
+low(const Segment& segment) {
+ return get(segment, LOW);
+}
 
- struct y_s_low : gtl_yes {};
+struct y_s_high : gtl_yes {};
 
- template <typename Segment>
- typename enable_if<
- typename gtl_and<
- y_s_low,
- typename is_segment_concept<
- typename geometry_concept<Segment>::type
- >::type
- >::type,
- typename segment_point_type<Segment>::type
- >::type
- low(const Segment& segment) {
- return get(segment, LOW);
- }
+template <typename Segment>
+typename enable_if<
+ typename gtl_and<
+ y_s_high,
+ typename is_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type
+ >::type,
+ typename segment_point_type<Segment>::type
+>::type
+high(const Segment& segment) {
+ return get(segment, HIGH);
+}
 
- struct y_s_high : gtl_yes {};
+struct y_s_center : gtl_yes {};
 
- template <typename Segment>
- typename enable_if<
- typename gtl_and<
- y_s_high,
- typename is_segment_concept<
- typename geometry_concept<Segment>::type
- >::type
- >::type,
- typename segment_point_type<Segment>::type
- >::type
- high(const Segment& segment) {
- return get(segment, HIGH);
- }
+template <typename Segment>
+typename enable_if<
+ typename gtl_and<
+ y_s_center,
+ typename is_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type
+ >::type,
+ typename segment_point_type<Segment>::type
+>::type
+center(const Segment& segment) {
+ return construct<typename segment_point_type<Segment>::type>(
+ (x(high(segment)) + x(low(segment)))/2,
+ (y(high(segment)) + y(low(segment)))/2);
+}
 
- struct y_s_center : gtl_yes {};
+struct y_s_low2 : gtl_yes {};
 
- template <typename Segment>
- typename enable_if<
- typename gtl_and<
- y_s_center,
- typename is_segment_concept<
- typename geometry_concept<Segment>::type
- >::type
- >::type,
- typename segment_point_type<Segment>::type
- >::type
- center(const Segment& segment) {
- return construct<typename segment_point_type<Segment>::type>(
- (x(high(segment)) + x(low(segment)))/2,
- (y(high(segment)) + y(low(segment)))/2);
- }
+template <typename Segment, typename Point>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_low2,
+ typename is_mutable_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
+ >::type
+ >::type,
+ void
+>::type
+low(Segment& segment, const Point& point) {
+ set(segment, LOW, point);
+}
 
- struct y_s_low2 : gtl_yes {};
+struct y_s_high2 : gtl_yes {};
 
- template <typename Segment, typename Point>
- typename enable_if<
- typename gtl_and_3<
- y_s_low2,
- typename is_mutable_segment_concept<
- typename geometry_concept<Segment>::type
- >::type,
- typename is_point_concept<
- typename geometry_concept<Point>::type
- >::type
- >::type,
- void
- >::type
- low(Segment& segment, const Point& point) {
- set(segment, LOW, point);
- }
+template <typename Segment, typename Point>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_high2,
+ typename is_mutable_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
+ >::type
+ >::type,
+ void
+>::type
+high(Segment& segment, const Point& point) {
+ set(segment, HIGH, point);
+}
 
- struct y_s_high2 : gtl_yes {};
+struct y_s_orientation1 : gtl_yes {};
 
- template <typename Segment, typename Point>
- typename enable_if<
- typename gtl_and_3<
- y_s_high2,
- typename is_mutable_segment_concept<
- typename geometry_concept<Segment>::type
- >::type,
- typename is_point_concept<
- typename geometry_concept<Point>::type
- >::type
- >::type,
- void
- >::type
- high(Segment& segment, const Point& point) {
- set(segment, HIGH, point);
- }
+// -1 for CW, 0 for collinear and 1 for CCW.
+template <typename Segment1, typename Segment2>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_orientation1,
+ typename is_segment_concept<
+ typename geometry_concept<Segment1>::type
+ >::type,
+ typename is_segment_concept<
+ typename geometry_concept<Segment2>::type
+ >::type
+ >::type,
+ int
+>::type
+orientation(const Segment1& segment1, const Segment2& segment2) {
+ typedef typename coordinate_traits<
+ typename segment_traits<Segment1>::coordinate_type
+ >::manhattan_area_type int_x2;
+ typedef typename coordinate_traits<
+ typename segment_traits<Segment1>::coordinate_type
+ >::unsigned_area_type uint_x2;
+ int_x2 a1 = (int_x2)x(high(segment1)) - (int_x2)x(low(segment1));
+ int_x2 b1 = (int_x2)y(high(segment1)) - (int_x2)y(low(segment1));
+ int_x2 a2 = (int_x2)x(high(segment2)) - (int_x2)x(low(segment2));
+ int_x2 b2 = (int_x2)y(high(segment2)) - (int_x2)y(low(segment2));
+
+ int sign1 = 0;
+ int sign2 = 0;
+ if (a1 && b2)
+ sign1 = ((a1 > 0) ^ (b2 > 0)) ? -1 : 1;
+ if (a2 && b1)
+ sign2 = ((a2 > 0) ^ (b1 > 0)) ? -1 : 1;
+
+ if (sign1 != sign2)
+ return (sign1 < sign2) ? -1 : 1;
+ uint_x2 a3 = (uint_x2)(a1 < 0 ? -a1 : a1) * (uint_x2)(b2 < 0 ? -b2 : b2);
+ uint_x2 b3 = (uint_x2)(b1 < 0 ? -b1 : b1) * (uint_x2)(a2 < 0 ? -a2 : a2);
+ if (a3 == b3)
+ return 0;
+ return ((a3 < b3) ^ (sign1 == 1)) ? 1 : -1;
+}
 
- struct y_s_orientation1 : gtl_yes {};
+struct y_s_orientation2 : gtl_yes {};
 
- // -1 for CW, 0 for collinear and 1 for CCW.
- template <typename Segment1, typename Segment2>
- typename enable_if<
- typename gtl_and_3<
- y_s_orientation1,
- typename is_segment_concept<
- typename geometry_concept<Segment1>::type
- >::type,
- typename is_segment_concept<
- typename geometry_concept<Segment2>::type
- >::type
- >::type,
- int
- >::type
- orientation(const Segment1& segment1, const Segment2& segment2) {
- typedef typename coordinate_traits<
- typename segment_traits<Segment1>::coordinate_type
- >::manhattan_area_type int_x2;
- typedef typename coordinate_traits<
- typename segment_traits<Segment1>::coordinate_type
- >::unsigned_area_type uint_x2;
- int_x2 a1 = (int_x2)x(high(segment1)) - (int_x2)x(low(segment1));
- int_x2 b1 = (int_x2)y(high(segment1)) - (int_x2)y(low(segment1));
- int_x2 a2 = (int_x2)x(high(segment2)) - (int_x2)x(low(segment2));
- int_x2 b2 = (int_x2)y(high(segment2)) - (int_x2)y(low(segment2));
-
- int sign1 = 0;
- int sign2 = 0;
- if (a1 && b2)
- sign1 = ((a1 > 0) ^ (b2 > 0)) ? -1 : 1;
- if (a2 && b1)
- sign2 = ((a2 > 0) ^ (b1 > 0)) ? -1 : 1;
-
- if (sign1 != sign2)
- return (sign1 < sign2) ? -1 : 1;
- uint_x2 a3 = (uint_x2)(a1 < 0 ? -a1 : a1) * (uint_x2)(b2 < 0 ? -b2 : b2);
- uint_x2 b3 = (uint_x2)(b1 < 0 ? -b1 : b1) * (uint_x2)(a2 < 0 ? -a2 : a2);
- if (a3 == b3)
- return 0;
- return ((a3 < b3) ^ (sign1 == 1)) ? 1 : -1;
- }
+// -1 for right, 0 for collinear and 1 for left.
+template <typename Segment, typename Point>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_orientation2,
+ typename is_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
+ >::type
+ >::type,
+ int
+>::type
+orientation(const Segment& segment, const Point& point) {
+ Segment segment2 = construct<Segment>(high(segment), point);
+ return orientation(segment, segment2);
+}
 
- struct y_s_orientation2 : gtl_yes {};
+struct y_s_contains : gtl_yes {};
 
- // -1 for right, 0 for collinear and 1 for left.
- template <typename Segment, typename Point>
- typename enable_if<
- typename gtl_and_3<
- y_s_orientation2,
- typename is_segment_concept<
- typename geometry_concept<Segment>::type
- >::type,
- typename is_point_concept<
- typename geometry_concept<Point>::type
- >::type
- >::type,
- int
- >::type
- orientation(const Segment& segment, const Point& point) {
- Segment segment2 = construct<Segment>(high(segment), point);
- return orientation(segment, segment2);
- }
+template <typename Segment, typename Point>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_contains,
+ typename is_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
+ >::type
+ >::type,
+ bool
+>::type
+contains(const Segment& segment,
+ const Point& point,
+ bool consider_touch = true ) {
+ if (orientation(segment, point))
+ return false;
+ rectangle_data<typename segment_coordinate_type<Segment>::type> rect;
+ set_points(rect, low(segment), high(segment));
+ if (!contains(rect, point, true))
+ return false;
+ if (!consider_touch &&
+ (equivalence(low(segment), point) ||
+ equivalence(high(segment), point)))
+ return false;
+ return true;
+}
 
- struct y_s_contains : gtl_yes {};
+struct y_s_contains2 : gtl_yes {};
 
- template <typename Segment, typename Point>
- typename enable_if<
- typename gtl_and_3<
- y_s_contains,
- typename is_segment_concept<
- typename geometry_concept<Segment>::type
- >::type,
- typename is_point_concept<
- typename geometry_concept<Point>::type
- >::type
- >::type,
- bool
- >::type
- contains(const Segment& segment, const Point& point, bool consider_touch = true ) {
- if (orientation(segment, point))
- return false;
- rectangle_data<typename segment_coordinate_type<Segment>::type> rect;
- set_points(rect, low(segment), high(segment));
- if (!contains(rect, point, true))
- return false;
- if (!consider_touch && (equivalence(low(segment), point) || equivalence(high(segment), point)))
- return false;
- return true;
- }
+template <typename Segment1, typename Segment2>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_contains2,
+ typename is_segment_concept<
+ typename geometry_concept<Segment1>::type
+ >::type,
+ typename is_segment_concept<
+ typename geometry_concept<Segment2>::type
+ >::type
+ >::type,
+ bool
+>::type
+contains(const Segment1& segment1,
+ const Segment2& segment2,
+ bool consider_touch = true) {
+ return contains(segment1, get(segment2, LOW), consider_touch) &&
+ contains(segment1, get(segment2, HIGH), consider_touch);
+}
 
- struct y_s_contains2 : gtl_yes {};
+struct y_s_length : gtl_yes {};
 
- template <typename Segment1, typename Segment2>
- typename enable_if<
- typename gtl_and_3<
- y_s_contains2,
- typename is_segment_concept<
- typename geometry_concept<Segment1>::type
- >::type,
- typename is_segment_concept<
- typename geometry_concept<Segment2>::type
- >::type
- >::type,
- bool
- >::type
- contains(const Segment1& segment1, const Segment2& segment2, bool consider_touch = true) {
- return contains(segment1, get(segment2, LOW), consider_touch) &&
- contains(segment1, get(segment2, HIGH), consider_touch);
- }
+template <typename Segment>
+typename enable_if<
+ typename gtl_and<
+ y_s_length,
+ typename is_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type
+ >::type,
+ typename segment_distance_type<Segment>::type
+>::type
+length(const Segment& segment) {
+ return euclidean_distance(low(segment), high(segment));
+}
 
- struct y_s_length : gtl_yes {};
+struct y_s_scale_up : gtl_yes {};
 
- template <typename Segment>
- typename enable_if<
- typename gtl_and<
- y_s_length,
- typename is_segment_concept<
- typename geometry_concept<Segment>::type
- >::type
- >::type,
- typename segment_distance_type<Segment>::type
- >::type
- length(const Segment& segment) {
- return euclidean_distance(low(segment), high(segment));
- }
+template <typename Segment>
+typename enable_if<
+ typename gtl_and<
+ y_s_scale_up,
+ typename is_mutable_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type
+ >::type,
+ Segment
+>::type &
+scale_up(Segment& segment,
+ typename coordinate_traits<
+ typename segment_coordinate_type<Segment>::type
+ >::unsigned_area_type factor) {
+ typename segment_point_type<Segment>::type l = low(segment);
+ typename segment_point_type<Segment>::type h = high(segment);
+ low(segment, scale_up(l, factor));
+ high(segment, scale_up(h, factor));
+ return segment;
+}
 
- struct y_s_scale_up : gtl_yes {};
+struct y_s_scale_down : gtl_yes {};
 
- template <typename Segment>
- typename enable_if<
- typename gtl_and<
- y_s_scale_up,
- typename is_mutable_segment_concept<
- typename geometry_concept<Segment>::type
- >::type
- >::type,
- Segment
- >::type &
- scale_up(Segment& segment,
+template <typename Segment>
+typename enable_if<
+ typename gtl_and<
+ y_s_scale_down,
+ typename is_mutable_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type
+ >::type,
+ Segment
+>::type &
+scale_down(Segment& segment,
            typename coordinate_traits<
              typename segment_coordinate_type<Segment>::type
>::unsigned_area_type factor) {
- typename segment_point_type<Segment>::type l = low(segment), h = high(segment);
- low(segment, scale_up(l, factor));
- high(segment, scale_up(h, factor));
- return segment;
- }
-
- struct y_s_scale_down : gtl_yes {};
-
- template <typename Segment>
- typename enable_if<
- typename gtl_and<
- y_s_scale_down,
- typename is_mutable_segment_concept<
- typename geometry_concept<Segment>::type
- >::type
- >::type,
- Segment
- >::type &
- scale_down(Segment& segment,
- typename coordinate_traits<
- typename segment_coordinate_type<Segment>::type
- >::unsigned_area_type factor) {
- typename segment_point_type<Segment>::type l = low(segment), h = high(segment);
- low(segment, scale_down(l, factor));
- high(segment, scale_down(h, factor));
- return segment;
- }
+ typename segment_point_type<Segment>::type l = low(segment);
+ typename segment_point_type<Segment>::type h = high(segment);
+ low(segment, scale_down(l, factor));
+ high(segment, scale_down(h, factor));
+ return segment;
+}
 
- struct y_s_scale : gtl_yes {};
+struct y_s_scale : gtl_yes {};
 
- template <typename Segment, typename Scale>
- typename enable_if<
- typename gtl_and<
- y_s_scale,
- typename is_mutable_segment_concept<
- typename geometry_concept<Segment>::type
- >::type
- >::type,
- Segment
- >::type &
- scale(Segment& segment, const Scale& sc) {
- typename segment_point_type<Segment>::type l = low(segment), h = high(segment);
- low(segment, scale(l, sc));
- high(segment, scale(h, sc));
- return segment;
- }
+template <typename Segment, typename Scale>
+typename enable_if<
+ typename gtl_and<
+ y_s_scale,
+ typename is_mutable_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type
+ >::type,
+ Segment
+>::type &
+scale(Segment& segment, const Scale& sc) {
+ typename segment_point_type<Segment>::type l = low(segment);
+ typename segment_point_type<Segment>::type h = high(segment);
+ low(segment, scale(l, sc));
+ high(segment, scale(h, sc));
+ return segment;
+}
 
- struct y_s_transform : gtl_yes {};
+struct y_s_transform : gtl_yes {};
 
- template <typename Segment, typename Transform>
- typename enable_if<
- typename gtl_and<
- y_s_transform,
- typename is_mutable_segment_concept<
- typename geometry_concept<Segment>::type
- >::type
- >::type,
- Segment
- >::type &
- transform(Segment& segment, const Transform& tr) {
- typename segment_point_type<Segment>::type l = low(segment), h = high(segment);
- low(segment, transform(l, tr));
- high(segment, transform(h, tr));
- return segment;
- }
+template <typename Segment, typename Transform>
+typename enable_if<
+ typename gtl_and<
+ y_s_transform,
+ typename is_mutable_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type
+ >::type,
+ Segment
+>::type &
+transform(Segment& segment, const Transform& tr) {
+ typename segment_point_type<Segment>::type l = low(segment);
+ typename segment_point_type<Segment>::type h = high(segment);
+ low(segment, transform(l, tr));
+ high(segment, transform(h, tr));
+ return segment;
+}
 
- struct y_s_move : gtl_yes {};
+struct y_s_move : gtl_yes {};
 
- template <typename Segment>
- typename enable_if<
- typename gtl_and<
- y_s_move,
- typename is_mutable_segment_concept<
- typename geometry_concept<Segment>::type
- >::type
- >::type,
- Segment
- >::type &
- move(Segment& segment, orientation_2d orient,
- typename segment_coordinate_type<Segment>::type displacement) {
- typename segment_point_type<Segment>::type l = low(segment), h = high(segment);
- low(segment, move(l, orient, displacement));
- high(segment, move(h, orient, displacement));
- return segment;
- }
+template <typename Segment>
+typename enable_if<
+ typename gtl_and<
+ y_s_move,
+ typename is_mutable_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type
+ >::type,
+ Segment
+>::type &
+move(Segment& segment, orientation_2d orient,
+ typename segment_coordinate_type<Segment>::type displacement) {
+ typename segment_point_type<Segment>::type l = low(segment);
+ typename segment_point_type<Segment>::type h = high(segment);
+ low(segment, move(l, orient, displacement));
+ high(segment, move(h, orient, displacement));
+ return segment;
+}
 
- struct y_s_convolve : gtl_yes {};
+struct y_s_convolve : gtl_yes {};
 
- template <typename Segment, typename Point>
- typename enable_if<
- typename gtl_and_3<
- y_s_convolve,
- typename is_mutable_segment_concept<
- typename geometry_concept<Segment>::type
- >::type,
- typename is_point_concept<
- typename geometry_concept<Point>::type
- >::type
- >::type,
- Segment
- >::type &
- convolve(Segment& segment, const Point& point) {
- typename segment_point_type<Segment>::type l = low(segment), h = high(segment);
- low(segment, convolve(l, point));
- high(segment, convolve(h, point));
- return segment;
- }
+template <typename Segment, typename Point>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_convolve,
+ typename is_mutable_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
+ >::type
+ >::type,
+ Segment
+>::type &
+convolve(Segment& segment, const Point& point) {
+ typename segment_point_type<Segment>::type l = low(segment);
+ typename segment_point_type<Segment>::type h = high(segment);
+ low(segment, convolve(l, point));
+ high(segment, convolve(h, point));
+ return segment;
+}
 
- struct y_s_deconvolve : gtl_yes {};
+struct y_s_deconvolve : gtl_yes {};
 
- template <typename Segment, typename Point>
- typename enable_if<
- typename gtl_and_3<
- y_s_deconvolve,
- typename is_mutable_segment_concept<
- typename geometry_concept<Segment>::type
- >::type,
- typename is_point_concept<
- typename geometry_concept<Point>::type
- >::type
- >::type,
- Segment
- >::type &
- deconvolve(Segment& segment, const Point& point) {
- typename segment_point_type<Segment>::type l = low(segment), h = high(segment);
- low(segment, deconvolve(l, point));
- high(segment, deconvolve(h, point));
- return segment;
- }
+template <typename Segment, typename Point>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_deconvolve,
+ typename is_mutable_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
+ >::type
+ >::type,
+ Segment
+>::type &
+deconvolve(Segment& segment, const Point& point) {
+ typename segment_point_type<Segment>::type l = low(segment);
+ typename segment_point_type<Segment>::type h = high(segment);
+ low(segment, deconvolve(l, point));
+ high(segment, deconvolve(h, point));
+ return segment;
+}
 
- struct y_s_abuts1 : gtl_yes {};
+struct y_s_abuts1 : gtl_yes {};
 
- template <typename Segment1, typename Segment2>
- typename enable_if<
- typename gtl_and_3<
- y_s_abuts1,
- typename is_segment_concept<
- typename geometry_concept<Segment1>::type
- >::type,
- typename is_segment_concept<
- typename geometry_concept<Segment2>::type
- >::type
- >::type,
- bool
- >::type
- abuts(const Segment1& segment1, const Segment2& segment2, direction_1d dir) {
- return dir.to_int() ? equivalence(low(segment2) , high(segment1)) :
- equivalence(low(segment1) , high(segment2));
- }
+template <typename Segment1, typename Segment2>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_abuts1,
+ typename is_segment_concept<
+ typename geometry_concept<Segment1>::type
+ >::type,
+ typename is_segment_concept<
+ typename geometry_concept<Segment2>::type
+ >::type
+ >::type,
+ bool
+>::type
+abuts(const Segment1& segment1, const Segment2& segment2, direction_1d dir) {
+ return dir.to_int() ? equivalence(low(segment2) , high(segment1)) :
+ equivalence(low(segment1) , high(segment2));
+}
 
- struct y_s_abuts2 : gtl_yes {};
+struct y_s_abuts2 : gtl_yes {};
 
- template <typename Segment1, typename Segment2>
- typename enable_if<
- typename gtl_and_3<
- y_s_abuts2,
- typename is_segment_concept<
- typename geometry_concept<Segment1>::type
- >::type,
- typename is_segment_concept<
- typename geometry_concept<Segment2>::type
- >::type
- >::type,
- bool
- >::type
- abuts(const Segment1& segment1, const Segment2& segment2) {
- return abuts(segment1, segment2, HIGH) || abuts(segment1, segment2, LOW);
- }
+template <typename Segment1, typename Segment2>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_abuts2,
+ typename is_segment_concept<
+ typename geometry_concept<Segment1>::type
+ >::type,
+ typename is_segment_concept<
+ typename geometry_concept<Segment2>::type
+ >::type
+ >::type,
+ bool
+>::type
+abuts(const Segment1& segment1, const Segment2& segment2) {
+ return abuts(segment1, segment2, HIGH) || abuts(segment1, segment2, LOW);
+}
 
- struct y_s_e_intersects : gtl_yes {};
+struct y_s_e_intersects : gtl_yes {};
 
- template <typename Segment1, typename Segment2>
- typename enable_if<
- typename gtl_and_3<
- y_s_e_intersects,
- typename is_segment_concept<
- typename geometry_concept<Segment1>::type
- >::type,
- typename is_segment_concept<
- typename geometry_concept<Segment2>::type
- >::type
- >::type,
- bool
- >::type
- intersects(const Segment1& segment1, const Segment2& segment2,
- bool consider_touch = true) {
- rectangle_data<typename segment_coordinate_type<Segment1>::type> rect1, rect2;
- set_points(rect1, low(segment1), high(segment1));
- set_points(rect2, low(segment2), high(segment2));
- // Check if axis-parallel rectangles containing segments intersect.
- if (!intersects(rect1, rect2, true))
- return false;
- int or1_1 = orientation(segment1, low(segment2));
- int or1_2 = orientation(segment1, high(segment2));
- if (or1_1 * or1_2 > 0)
- return false;
- int or2_1 = orientation(segment2, low(segment1));
- int or2_2 = orientation(segment2, high(segment1));
- if (or2_1 * or2_2 > 0)
- return false;
- if (consider_touch || (or1_1 && or1_2) || (or2_1 && or2_2))
- return true;
- if (or1_1 || or1_2)
- return false;
- return intersects(vertical(rect1), vertical(rect2), false) ||
- intersects(horizontal(rect1), horizontal(rect2), false);
- }
+template <typename Segment1, typename Segment2>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_e_intersects,
+ typename is_segment_concept<
+ typename geometry_concept<Segment1>::type
+ >::type,
+ typename is_segment_concept<
+ typename geometry_concept<Segment2>::type
+ >::type
+ >::type,
+ bool
+>::type
+intersects(const Segment1& segment1, const Segment2& segment2,
+ bool consider_touch = true) {
+ rectangle_data<typename segment_coordinate_type<Segment1>::type> rect1, rect2;
+ set_points(rect1, low(segment1), high(segment1));
+ set_points(rect2, low(segment2), high(segment2));
+ // Check if axis-parallel rectangles containing segments intersect.
+ if (!intersects(rect1, rect2, true))
+ return false;
+ int or1_1 = orientation(segment1, low(segment2));
+ int or1_2 = orientation(segment1, high(segment2));
+ if (or1_1 * or1_2 > 0)
+ return false;
+ int or2_1 = orientation(segment2, low(segment1));
+ int or2_2 = orientation(segment2, high(segment1));
+ if (or2_1 * or2_2 > 0)
+ return false;
+ if (consider_touch || (or1_1 && or1_2) || (or2_1 && or2_2))
+ return true;
+ if (or1_1 || or1_2)
+ return false;
+ return intersects(vertical(rect1), vertical(rect2), false) ||
+ intersects(horizontal(rect1), horizontal(rect2), false);
+}
 
- struct y_s_e_dist : gtl_yes {};
+struct y_s_e_dist : gtl_yes {};
 
- template <typename Segment, typename Point>
- typename enable_if<
- typename gtl_and_3<
- y_s_e_dist,
- typename is_segment_concept<
- typename geometry_concept<Segment>::type
- >::type,
- typename is_point_concept<
- typename geometry_concept<Point>::type
- >::type
- >::type,
- typename segment_distance_type<Segment>::type
- >::type
- euclidean_distance(const Segment& segment, const Point& point) {
- typedef typename segment_distance_type<Segment>::type Unit;
- Unit x1 = x(low(segment));
- Unit y1 = y(low(segment));
- Unit x2 = x(high(segment));
- Unit y2 = y(high(segment));
- Unit X = x(point);
- Unit Y = y(point);
- Unit A = X - x1;
- Unit B = Y - y1;
- Unit C = x2 - x1;
- Unit D = y2 - y1;
- Unit param = (A * C + B * D);
- Unit length_sq = C * C + D * D;
- if (param > length_sq) {
- return euclidean_distance(high(segment), point);
- } else if (param < 0.0) {
- return euclidean_distance(low(segment), point);
- }
- if (length_sq == 0.0)
- return 0.0;
- Unit denom = std::sqrt(length_sq);
- Unit result = (A * D - C * B) / denom;
- return (result < 0.0) ? -result : result;
- }
+template <typename Segment, typename Point>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_e_dist,
+ typename is_segment_concept<
+ typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
+ >::type
+ >::type,
+ typename segment_distance_type<Segment>::type
+>::type
+euclidean_distance(const Segment& segment, const Point& point) {
+ typedef typename segment_distance_type<Segment>::type Unit;
+ Unit x1 = x(low(segment));
+ Unit y1 = y(low(segment));
+ Unit x2 = x(high(segment));
+ Unit y2 = y(high(segment));
+ Unit X = x(point);
+ Unit Y = y(point);
+ Unit A = X - x1;
+ Unit B = Y - y1;
+ Unit C = x2 - x1;
+ Unit D = y2 - y1;
+ Unit param = (A * C + B * D);
+ Unit length_sq = C * C + D * D;
+ if (param > length_sq) {
+ return euclidean_distance(high(segment), point);
+ } else if (param < 0.0) {
+ return euclidean_distance(low(segment), point);
+ }
+ if (length_sq == 0.0)
+ return 0.0;
+ Unit denom = std::sqrt(length_sq);
+ Unit result = (A * D - C * B) / denom;
+ return (result < 0.0) ? -result : result;
+}
 
- struct y_s_e_dist2 : gtl_yes {};
+struct y_s_e_dist2 : gtl_yes {};
 
- template <typename Segment1, typename Segment2>
- typename enable_if<
- typename gtl_and_3<
- y_s_e_dist2,
- typename is_segment_concept<
- typename geometry_concept<Segment1>::type
- >::type,
- typename is_segment_concept<
- typename geometry_concept<Segment2>::type
- >::type
- >::type,
- typename segment_distance_type<Segment1>::type
- >::type
- euclidean_distance(const Segment1& segment1, const Segment2& segment2) {
- if (intersects(segment1, segment2))
- return 0.0;
- typename segment_distance_type<Segment1>::type
- result1 = euclidean_distance(segment1, low(segment2)),
- result2 = euclidean_distance(segment1, high(segment2)),
- result3 = euclidean_distance(segment2, low(segment1)),
- result4 = euclidean_distance(segment2, high(segment1));
- if (result2 < result1)
- result1 = result2;
- if (result4 < result3)
- result3 = result4;
- return (result1 < result3) ? result1 : result3;
- }
+template <typename Segment1, typename Segment2>
+typename enable_if<
+ typename gtl_and_3<
+ y_s_e_dist2,
+ typename is_segment_concept<
+ typename geometry_concept<Segment1>::type
+ >::type,
+ typename is_segment_concept<
+ typename geometry_concept<Segment2>::type
+ >::type
+ >::type,
+ typename segment_distance_type<Segment1>::type
+>::type
+euclidean_distance(const Segment1& segment1, const Segment2& segment2) {
+ if (intersects(segment1, segment2))
+ return 0.0;
+ typename segment_distance_type<Segment1>::type
+ result1 = euclidean_distance(segment1, low(segment2)),
+ result2 = euclidean_distance(segment1, high(segment2)),
+ result3 = euclidean_distance(segment2, low(segment1)),
+ result4 = euclidean_distance(segment2, high(segment1));
+ if (result2 < result1)
+ result1 = result2;
+ if (result4 < result3)
+ result3 = result4;
+ return (result1 < result3) ? result1 : result3;
+}
 
- template <class T>
- template <class Segment>
- segment_data<T>& segment_data<T>::operator=(const Segment& rvalue) {
- assign(*this, rvalue);
- return *this;
- }
+template <class T>
+template <class Segment>
+segment_data<T>& segment_data<T>::operator=(const Segment& rvalue) {
+ assign(*this, rvalue);
+ return *this;
+}
 
- template <typename T>
- struct geometry_concept<segment_data<T> > {
- typedef segment_concept type;
- };
+template <typename T>
+struct geometry_concept<segment_data<T> > {
+ typedef segment_concept type;
+};
 }
 }
 #endif

Modified: trunk/boost/polygon/segment_data.hpp
==============================================================================
--- trunk/boost/polygon/segment_data.hpp (original)
+++ trunk/boost/polygon/segment_data.hpp 2012-09-07 17:32:48 EDT (Fri, 07 Sep 2012)
@@ -10,96 +10,98 @@
 
 #include "isotropy.hpp"
 
-namespace boost { namespace polygon{
- template <typename T>
- class segment_data {
- public:
- typedef T coordinate_type;
- typedef point_data<T> point_type;
+namespace boost {
+namespace polygon {
+template <typename T>
+class segment_data {
+ public:
+ typedef T coordinate_type;
+ typedef point_data<T> point_type;
 
- inline segment_data()
+ inline segment_data()
 #ifndef BOOST_POLYGON_MSVC
- :points_()
+ :points_()
 #endif
- {}
+ {}
 
- inline segment_data(const point_type& low, const point_type& high)
+ inline segment_data(const point_type& low, const point_type& high)
 #ifndef BOOST_POLYGON_MSVC
- :points_()
+ :points_()
 #endif
- {
- points_[LOW] = low; points_[HIGH] = high;
- }
+ {
+ points_[LOW] = low;
+ points_[HIGH] = high;
+ }
 
- inline segment_data(const segment_data& that)
+ inline segment_data(const segment_data& that)
 #ifndef BOOST_POLYGON_MSVC
- :points_()
+ :points_()
 #endif
- {
- (*this) = that;
- }
-
- inline segment_data& operator=(const segment_data& that) {
- points_[0] = that.points_[0];
- points_[1] = that.points_[1];
- return *this;
- }
-
- template <typename Segment>
- inline segment_data& operator=(const Segment& that);
-
- inline point_type get(direction_1d dir) const {
- return points_[dir.to_int()];
- }
-
- inline void set(direction_1d dir, const point_type& point) {
- points_[dir.to_int()] = point;
- }
-
- inline point_type low() const { return points_[0]; }
-
- inline segment_data& low(const point_type& point) {
- points_[0] = point;
- return *this;
- }
-
- inline point_type high() const {return points_[1]; }
-
- inline segment_data& high(const point_type& point) {
- points_[1] = point;
- return *this;
- }
-
- inline bool operator==(const segment_data& that) const {
- return low() == that.low() && high() == that.high();
- }
-
- inline bool operator!=(const segment_data& that) const {
- return low() != that.low() || high() != that.high();
- }
-
- inline bool operator<(const segment_data& that) const {
- if (points_[0] < that.points_[0])
- return true;
- if (points_[0] > that.points_[0])
- return false;
- return points_[1] < that.points_[1];
- }
-
- inline bool operator<=(const segment_data& that) const {
- return !(that < *this);
- }
-
- inline bool operator>(const segment_data& that) const {
- return that < *this;
- }
-
- inline bool operator>=(const segment_data& that) const {
- return !((*this) < that);
- }
+ {
+ (*this) = that;
+ }
+
+ inline segment_data& operator=(const segment_data& that) {
+ points_[0] = that.points_[0];
+ points_[1] = that.points_[1];
+ return *this;
+ }
+
+ template <typename Segment>
+ inline segment_data& operator=(const Segment& that);
+
+ inline point_type get(direction_1d dir) const {
+ return points_[dir.to_int()];
+ }
+
+ inline void set(direction_1d dir, const point_type& point) {
+ points_[dir.to_int()] = point;
+ }
+
+ inline point_type low() const { return points_[0]; }
+
+ inline segment_data& low(const point_type& point) {
+ points_[0] = point;
+ return *this;
+ }
+
+ inline point_type high() const {return points_[1]; }
+
+ inline segment_data& high(const point_type& point) {
+ points_[1] = point;
+ return *this;
+ }
+
+ inline bool operator==(const segment_data& that) const {
+ return low() == that.low() && high() == that.high();
+ }
+
+ inline bool operator!=(const segment_data& that) const {
+ return low() != that.low() || high() != that.high();
+ }
+
+ inline bool operator<(const segment_data& that) const {
+ if (points_[0] < that.points_[0])
+ return true;
+ if (points_[0] > that.points_[0])
+ return false;
+ return points_[1] < that.points_[1];
+ }
+
+ inline bool operator<=(const segment_data& that) const {
+ return !(that < *this);
+ }
+
+ inline bool operator>(const segment_data& that) const {
+ return that < *this;
+ }
+
+ inline bool operator>=(const segment_data& that) const {
+ return !((*this) < that);
+ }
 
- private:
- point_type points_[2];
+ private:
+ point_type points_[2];
 };
 }
 }

Modified: trunk/boost/polygon/segment_traits.hpp
==============================================================================
--- trunk/boost/polygon/segment_traits.hpp (original)
+++ trunk/boost/polygon/segment_traits.hpp 2012-09-07 17:32:48 EDT (Fri, 07 Sep 2012)
@@ -7,7 +7,8 @@
 */
 #ifndef BOOST_POLYGON_SEGMENT_TRAITS_HPP
 #define BOOST_POLYGON_SEGMENT_TRAITS_HPP
-namespace boost { namespace polygon{
+namespace boost {
+namespace polygon {
   template <typename Segment>
   struct segment_traits {
     typedef typename Segment::coordinate_type coordinate_type;
@@ -22,11 +23,13 @@
   struct segment_mutable_traits {
     typedef typename segment_traits<Segment>::point_type point_type;
 
- static inline void set(Segment& segment, direction_1d dir, const point_type& point) {
+ static inline void set(
+ Segment& segment, direction_1d dir, const point_type& point) {
       segment.set(dir, point);
     }
 
- static inline Segment construct(const point_type& low, const point_type& high) {
+ static inline Segment construct(
+ const point_type& low, const point_type& high) {
       return Segment(low, high);
     }
   };

Modified: trunk/boost/polygon/voronoi.hpp
==============================================================================
--- trunk/boost/polygon/voronoi.hpp (original)
+++ trunk/boost/polygon/voronoi.hpp 2012-09-07 17:32:48 EDT (Fri, 07 Sep 2012)
@@ -72,7 +72,8 @@
   void
>::type
 insert(const Segment& segment, VB* vb) {
- vb->insert_segment(x(low(segment)), y(low(segment)), x(high(segment)), y(high(segment)));
+ vb->insert_segment(x(low(segment)), y(low(segment)),
+ x(high(segment)), y(high(segment)));
 }
 
 template <typename SegmentIterator, typename VB>

Modified: trunk/boost/polygon/voronoi_builder.hpp
==============================================================================
--- trunk/boost/polygon/voronoi_builder.hpp (original)
+++ trunk/boost/polygon/voronoi_builder.hpp 2012-09-07 17:32:48 EDT (Fri, 07 Sep 2012)
@@ -12,6 +12,8 @@
 
 #include <algorithm>
 #include <map>
+#include <queue>
+#include <utility>
 #include <vector>
 
 #include "detail/voronoi_ctypes.hpp"
@@ -43,7 +45,7 @@
           typename CTT = detail::voronoi_ctype_traits<T>,
           typename VP = detail::voronoi_predicates<CTT> >
 class voronoi_builder {
-public:
+ public:
   typedef typename CTT::int_type int_type;
   typedef typename CTT::fpt_type fpt_type;
 
@@ -90,7 +92,7 @@
 
   // Run sweepline algorithm and fill output data structure.
   template <typename OUTPUT>
- void construct(OUTPUT *output) {
+ void construct(OUTPUT* output) {
     // Init structures.
     output->_reserve(site_events_.size());
     init_sites_queue();
@@ -128,7 +130,7 @@
     site_events_.clear();
   }
 
-private:
+ private:
   typedef detail::point_2d<int_type> point_type;
   typedef detail::site_event<int_type> site_event_type;
   typedef typename std::vector<site_event_type>::const_iterator
@@ -152,7 +154,7 @@
   typedef typename beach_line_type::iterator beach_line_iterator;
   typedef std::pair<circle_event_type, beach_line_iterator> event_type;
   typedef struct {
- bool operator()(const event_type &lhs, const event_type &rhs) const {
+ bool operator()(const event_type& lhs, const event_type& rhs) const {
       return predicate(rhs.first, lhs.first);
     }
     event_comparison_predicate predicate;
@@ -180,7 +182,7 @@
   }
 
   template <typename OUTPUT>
- void init_beach_line(OUTPUT *output) {
+ void init_beach_line(OUTPUT* output) {
     if (site_events_.empty())
       return;
     if (site_events_.size() == 1) {
@@ -190,10 +192,10 @@
     } else {
       int skip = 0;
 
- while(site_event_iterator_ != site_events_.end() &&
- VP::is_vertical(site_event_iterator_->point0(),
- site_events_.begin()->point0()) &&
- VP::is_vertical(*site_event_iterator_)) {
+ while (site_event_iterator_ != site_events_.end() &&
+ VP::is_vertical(site_event_iterator_->point0(),
+ site_events_.begin()->point0()) &&
+ VP::is_vertical(*site_event_iterator_)) {
         ++site_event_iterator_;
         ++skip;
       }
@@ -211,7 +213,7 @@
   // Init beach line with the two first sites.
   // The first site is always a point.
   template <typename OUTPUT>
- void init_beach_line_default(OUTPUT *output) {
+ void init_beach_line_default(OUTPUT* output) {
     // Get the first and the second site event.
     site_event_iterator_type it_first = site_events_.begin();
     site_event_iterator_type it_second = site_events_.begin();
@@ -224,7 +226,7 @@
 
   // Init beach line with collinear sites.
   template <typename OUTPUT>
- void init_beach_line_collinear_sites(OUTPUT *output) {
+ void init_beach_line_collinear_sites(OUTPUT* output) {
     site_event_iterator_type it_first = site_events_.begin();
     site_event_iterator_type it_second = site_events_.begin();
     ++it_second;
@@ -233,8 +235,7 @@
       key_type new_node(*it_first, *it_second);
 
       // Update the output.
- edge_type *edge =
- output->_insert_new_edge(*it_first, *it_second).first;
+ edge_type* edge = output->_insert_new_edge(*it_first, *it_second).first;
 
       // Insert a new bisector into the beach line.
       beach_line_.insert(beach_line_.end(),
@@ -246,15 +247,15 @@
     }
   }
 
- void deactivate_circle_event(value_type &value) {
- if (value.circle_event()) {
- value.circle_event()->deactivate();
- value.circle_event(NULL);
+ void deactivate_circle_event(value_type* value) {
+ if (value->circle_event()) {
+ value->circle_event()->deactivate();
+ value->circle_event(NULL);
     }
   }
 
   template <typename OUTPUT>
- void process_site_event(OUTPUT *output) {
+ void process_site_event(OUTPUT* output) {
     // Get next site event to process.
     site_event_type site_event = *site_event_iterator_;
 
@@ -294,7 +295,7 @@
         --left_it;
 
         // Get the second site of the last node
- const site_event_type &site_arc = left_it->first.right_site();
+ const site_event_type& site_arc = left_it->first.right_site();
 
         // Insert new nodes into the beach line. Update the output.
         right_it = insert_new_arc(
@@ -308,7 +309,7 @@
                               site_event, right_it);
       } else if (right_it == beach_line_.begin()) {
         // The above arc corresponds to the first site of the first node.
- const site_event_type &site_arc = right_it->first.left_site();
+ const site_event_type& site_arc = right_it->first.left_site();
 
         // Insert new nodes into the beach line. Update the output.
         left_it = insert_new_arc(
@@ -328,14 +329,14 @@
       } else {
         // The above arc corresponds neither to the first,
         // nor to the last site in the beach line.
- const site_event_type &site_arc2 = right_it->first.left_site();
- const site_event_type &site3 = right_it->first.right_site();
+ const site_event_type& site_arc2 = right_it->first.left_site();
+ const site_event_type& site3 = right_it->first.right_site();
 
         // Remove the candidate circle from the event queue.
- deactivate_circle_event(right_it->second);
+ deactivate_circle_event(&right_it->second);
         --left_it;
- const site_event_type &site_arc1 = left_it->first.right_site();
- const site_event_type &site1 = left_it->first.left_site();
+ const site_event_type& site_arc1 = left_it->first.right_site();
+ const site_event_type& site1 = left_it->first.left_site();
 
         // Insert new nodes into the beach line. Update the output.
         beach_line_iterator new_node_it =
@@ -366,10 +367,10 @@
   // why we use const_cast there and take all the responsibility that
   // map data structure keeps correct ordering.
   template <typename OUTPUT>
- void process_circle_event(OUTPUT *output) {
+ void process_circle_event(OUTPUT* output) {
     // Get the topmost circle event.
- const event_type &e = circle_events_.top();
- const circle_event_type &circle_event = e.first;
+ const event_type& e = circle_events_.top();
+ const circle_event_type& circle_event = e.first;
     beach_line_iterator it_first = e.second;
     beach_line_iterator it_last = it_first;
 
@@ -377,11 +378,11 @@
     site_event_type site3 = it_first->first.right_site();
 
     // Get the half-edge corresponding to the second bisector - (B, C).
- edge_type *bisector2 = it_first->second.edge();
+ edge_type* bisector2 = it_first->second.edge();
 
     // Get the half-edge corresponding to the first bisector - (A, B).
     --it_first;
- edge_type *bisector1 = it_first->second.edge();
+ edge_type* bisector1 = it_first->second.edge();
 
     // Get the A site.
     site_event_type site1 = it_first->first.left_site();
@@ -392,7 +393,7 @@
     }
 
     // Change the (A, B) bisector node to the (A, C) bisector node.
- const_cast<key_type &>(it_first->first).right_site(site3);
+ const_cast<key_type&>(it_first->first).right_site(site3);
 
     // Insert the new bisector into the beach line.
     it_first->second.edge(output->_insert_new_edge(
@@ -408,9 +409,9 @@
     // Check new triplets formed by the neighboring arcs
     // to the left for potential circle events.
     if (it_first != beach_line_.begin()) {
- deactivate_circle_event(it_first->second);
+ deactivate_circle_event(&it_first->second);
       --it_first;
- const site_event_type &site_l1 = it_first->first.left_site();
+ const site_event_type& site_l1 = it_first->first.left_site();
       activate_circle_event(site_l1, site1, site3, it_last);
     }
 
@@ -418,8 +419,8 @@
     // to the right for potential circle events.
     ++it_last;
     if (it_last != beach_line_.end()) {
- deactivate_circle_event(it_last->second);
- const site_event_type &site_r1 = it_last->first.right_site();
+ deactivate_circle_event(&it_last->second);
+ const site_event_type& site_r1 = it_last->first.right_site();
       activate_circle_event(site1, site3, site_r1, it_last);
     }
   }
@@ -427,9 +428,9 @@
   // Insert new nodes into the beach line. Update the output.
   template <typename OUTPUT>
   beach_line_iterator insert_new_arc(
- const site_event_type &site_arc1, const site_event_type &site_arc2,
- const site_event_type &site_event, beach_line_iterator position,
- OUTPUT *output) {
+ const site_event_type& site_arc1, const site_event_type &site_arc2,
+ const site_event_type& site_event, beach_line_iterator position,
+ OUTPUT* output) {
     // Create two new bisectors with opposite directions.
     key_type new_left_node(site_arc1, site_event);
     key_type new_right_node(site_event, site_arc2);
@@ -468,9 +469,9 @@
 
   // Add a new circle event to the event queue.
   // bisector_node corresponds to the (site2, site3) bisector.
- void activate_circle_event(const site_event_type &site1,
- const site_event_type &site2,
- const site_event_type &site3,
+ void activate_circle_event(const site_event_type& site1,
+ const site_event_type& site2,
+ const site_event_type& site3,
                              beach_line_iterator bisector_node) {
     circle_event_type c_event;
     // Check if the three input sites create a circle event.
@@ -478,18 +479,18 @@
       // Add the new circle event to the circle events queue.
       // Update bisector's circle event iterator to point to the
       // new circle event in the circle event queue.
- event_type &e = circle_events_.push(
+ event_type& e = circle_events_.push(
           std::pair<circle_event_type, beach_line_iterator>(
               c_event, bisector_node));
       bisector_node->second.circle_event(&e.first);
     }
   }
 
-private:
+ private:
   point_comparison_predicate point_comparison_;
   struct end_point_comparison {
- bool operator() (const end_point_type &end1,
- const end_point_type &end2) const {
+ bool operator() (const end_point_type& end1,
+ const end_point_type& end2) const {
       return point_comparison(end2.first, end1.first);
     }
     point_comparison_predicate point_comparison;
@@ -504,7 +505,7 @@
   circle_formation_predicate_type circle_formation_predicate_;
   std::size_t index_;
 
- //Disallow copy constructor and operator=
+ // Disallow copy constructor and operator=
   voronoi_builder(const voronoi_builder&);
   void operator=(const voronoi_builder&);
 };

Modified: trunk/boost/polygon/voronoi_diagram.hpp
==============================================================================
--- trunk/boost/polygon/voronoi_diagram.hpp (original)
+++ trunk/boost/polygon/voronoi_diagram.hpp 2012-09-07 17:32:48 EDT (Fri, 07 Sep 2012)
@@ -11,6 +11,7 @@
 #define BOOST_POLYGON_VORONOI_DIAGRAM
 
 #include <vector>
+#include <utility>
 
 #include "detail/voronoi_ctypes.hpp"
 #include "detail/voronoi_structures.hpp"
@@ -32,7 +33,7 @@
 // Cell may contain point or segment site inside.
 template <typename T>
 class voronoi_cell {
-public:
+ public:
   typedef T coordinate_type;
   typedef std::size_t color_type;
   typedef voronoi_edge<coordinate_type> voronoi_edge_type;
@@ -79,7 +80,7 @@
     color_ |= color << BITS_SHIFT;
   }
 
-private:
+ private:
   // 5 color bits are reserved.
   enum Bits {
     BITS_SHIFT = 0x5,
@@ -98,7 +99,7 @@
 // 3) mutable color member
 template <typename T>
 class voronoi_vertex {
-public:
+ public:
   typedef T coordinate_type;
   typedef std::size_t color_type;
   typedef voronoi_edge<coordinate_type> voronoi_edge_type;
@@ -126,7 +127,7 @@
     color_ |= color << BITS_SHIFT;
   }
 
-private:
+ private:
   // 5 color bits are reserved.
   enum Bits {
     BITS_SHIFT = 0x5,
@@ -150,7 +151,7 @@
 // 6) mutable color member
 template <typename T>
 class voronoi_edge {
-public:
+ public:
   typedef T coordinate_type;
   typedef voronoi_cell<coordinate_type> voronoi_cell_type;
   typedef voronoi_vertex<coordinate_type> voronoi_vertex_type;
@@ -250,7 +251,7 @@
     color_ |= color << BITS_SHIFT;
   }
 
-private:
+ private:
   // 5 color bits are reserved.
   enum Bits {
     BIT_IS_LINEAR = 0x1, // linear is opposite to curved
@@ -275,7 +276,7 @@
   typedef voronoi_vertex<coordinate_type> vertex_type;
   typedef voronoi_edge<coordinate_type> edge_type;
   typedef class {
- public:
+ public:
     enum { ULPS = 128 };
     bool operator()(const vertex_type& v1, const vertex_type& v2) const {
       return (ulp_cmp(v1.x(), v2.x(), ULPS) ==
@@ -283,7 +284,7 @@
              (ulp_cmp(v1.y(), v2.y(), ULPS) ==
               detail::ulp_comparison<T>::EQUAL);
     }
- private:
+ private:
     typename detail::ulp_comparison<T> ulp_cmp;
   } vertex_equality_predicate_type;
 };
@@ -292,7 +293,7 @@
 // CCW ordering is used on the faces perimeter and around the vertices.
 template <typename T, typename TRAITS = voronoi_diagram_traits<T> >
 class voronoi_diagram {
-public:
+ public:
   typedef typename TRAITS::coordinate_type coordinate_type;
   typedef typename TRAITS::cell_type cell_type;
   typedef typename TRAITS::vertex_type vertex_type;
@@ -411,8 +412,10 @@
   // new Voronoi vertex point. Returns a pair of pointers to a new half-edges.
   template <typename CT1, typename CT2>
   std::pair<void*, void*> _insert_new_edge(
- const detail::site_event<CT1>& site1, const detail::site_event<CT1>& site3,
- const detail::circle_event<CT2>& circle, void* data12, void* data23) {
+ const detail::site_event<CT1>& site1,
+ const detail::site_event<CT1>& site3,
+ const detail::circle_event<CT2>& circle,
+ void* data12, void* data23) {
     edge_type* edge12 = static_cast<edge_type*>(data12);
     edge_type* edge23 = static_cast<edge_type*>(data23);
 
@@ -566,7 +569,7 @@
     }
   }
 
-private:
+ private:
   typedef typename TRAITS::vertex_equality_predicate_type
     vertex_equality_predicate_type;
 

Modified: trunk/boost/polygon/voronoi_geometry_type.hpp
==============================================================================
--- trunk/boost/polygon/voronoi_geometry_type.hpp (original)
+++ trunk/boost/polygon/voronoi_geometry_type.hpp 2012-09-07 17:32:48 EDT (Fri, 07 Sep 2012)
@@ -37,7 +37,8 @@
     const SourceCategory& source_category,
     const GeometryCategory& geometry_category) {
   return (static_cast<std::size_t>(source_category) >>
- SOURCE_CATEGORY_GEOMETRY_SHIFT) == static_cast<std::size_t>(geometry_category);
+ SOURCE_CATEGORY_GEOMETRY_SHIFT) ==
+ static_cast<std::size_t>(geometry_category);
 }
 } // polygon
 } // boost


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