diff --git a/include/boost/polygon/detail/polygon_arbitrary_formation.hpp b/include/boost/polygon/detail/polygon_arbitrary_formation.hpp index 1cdb706..e1acdbb 100644 --- a/include/boost/polygon/detail/polygon_arbitrary_formation.hpp +++ b/include/boost/polygon/detail/polygon_arbitrary_formation.hpp @@ -326,12 +326,11 @@ namespace boost { namespace polygon{ } else if(elm1y == elm2y) { if(elm1 == elm2) return false; - typedef typename coordinate_traits::manhattan_area_type at; - at dx1 = at(elm1.second.get(HORIZONTAL)) - at(elm1.first.get(HORIZONTAL)); - at dy1 = at(elm1.second.get(VERTICAL)) - at(elm1.first.get(VERTICAL)); - at dx2 = at(elm2.second.get(HORIZONTAL)) - at(elm2.first.get(HORIZONTAL)); - at dy2 = at(elm2.second.get(VERTICAL)) - at(elm2.first.get(VERTICAL)); - retval = ((*justBefore_) != 0) ^ less_slope(dx1, dy1, dx2, dy2); + retval = less_slope(elm1.second.get(HORIZONTAL) - elm1.first.get(HORIZONTAL), + elm1.second.get(VERTICAL) - elm1.first.get(VERTICAL), + elm2.second.get(HORIZONTAL) - elm2.first.get(HORIZONTAL), + elm2.second.get(VERTICAL) - elm2.first.get(VERTICAL)); + retval = ((*justBefore_) != 0) ^ retval; } } return retval; @@ -827,12 +826,11 @@ namespace boost { namespace polygon{ } else if(elm1y == elm2y) { if(elm1.pt == elm2.pt && elm1.other_pt == elm2.other_pt) return false; - typedef typename coordinate_traits::manhattan_area_type at; - at dx1 = at(elm1.other_pt.get(HORIZONTAL)) - at(elm1.pt.get(HORIZONTAL)); - at dy1 = at(elm1.other_pt.get(VERTICAL)) - at(elm1.pt.get(VERTICAL)); - at dx2 = at(elm2.other_pt.get(HORIZONTAL)) - at(elm2.pt.get(HORIZONTAL)); - at dy2 = at(elm2.other_pt.get(VERTICAL)) - at(elm2.pt.get(VERTICAL)); - retval = ((*justBefore_) != 0) ^ less_slope(dx1, dy1, dx2, dy2); + retval = less_slope(elm1.other_pt.get(HORIZONTAL) - elm1.pt.get(HORIZONTAL), + elm1.other_pt.get(VERTICAL) - elm1.pt.get(VERTICAL), + elm2.other_pt.get(HORIZONTAL) - elm2.pt.get(HORIZONTAL), + elm2.other_pt.get(VERTICAL) - elm2.pt.get(VERTICAL)); + retval = ((*justBefore_) != 0) ^ retval; } } return retval; @@ -1235,11 +1233,10 @@ namespace boost { namespace polygon{ inline less_incoming_count(Point point) : pt_(point) {} inline bool operator () (const std::pair, int>, active_tail_arbitrary*>& elm1, const std::pair, int>, active_tail_arbitrary*>& elm2) const { - typedef typename coordinate_traits::manhattan_area_type at; - at dx1 = at(elm1.first.first.first.get(HORIZONTAL)) - at(elm1.first.first.second.get(HORIZONTAL)); - at dx2 = at(elm2.first.first.first.get(HORIZONTAL)) - at(elm2.first.first.second.get(HORIZONTAL)); - at dy1 = at(elm1.first.first.first.get(VERTICAL)) - at(elm1.first.first.second.get(VERTICAL)); - at dy2 = at(elm2.first.first.first.get(VERTICAL)) - at(elm2.first.first.second.get(VERTICAL)); + Unit dx1 = elm1.first.first.first.get(HORIZONTAL) - elm1.first.first.second.get(HORIZONTAL); + Unit dx2 = elm2.first.first.first.get(HORIZONTAL) - elm2.first.first.second.get(HORIZONTAL); + Unit dy1 = elm1.first.first.first.get(VERTICAL) - elm1.first.first.second.get(VERTICAL); + Unit dy2 = elm2.first.first.first.get(VERTICAL) - elm2.first.first.second.get(VERTICAL); return scanline_base::less_slope(dx1, dy1, dx2, dy2); } }; diff --git a/include/boost/polygon/point_data.hpp b/include/boost/polygon/point_data.hpp index e37f82f..23c23ed 100644 --- a/include/boost/polygon/point_data.hpp +++ b/include/boost/polygon/point_data.hpp @@ -46,7 +46,7 @@ class point_data { } template - explicit point_data(const PointType& that) { + point_data(const PointType& that) { *this = that; } diff --git a/include/boost/polygon/polygon_traits.hpp b/include/boost/polygon/polygon_traits.hpp index b4d0e9d..6055bc7 100644 --- a/include/boost/polygon/polygon_traits.hpp +++ b/include/boost/polygon/polygon_traits.hpp @@ -1418,18 +1418,6 @@ namespace boost { namespace polygon{ } */ - template - typename enable_if< - typename gtl_and< typename is_mutable_point_concept::type>::type, - typename is_polygon_with_holes_type::type>::type, - bool>::type - center(T1& center_point, const T2& polygon) { - typedef typename polygon_traits::coordinate_type coordinate_type; - rectangle_data bbox; - extents(bbox, polygon); - return center(center_point, bbox); - } - template typename enable_if< typename gtl_and< typename is_mutable_rectangle_concept::type>::type, @@ -1451,6 +1439,18 @@ namespace boost { namespace polygon{ return true; } + template + typename enable_if< + typename gtl_and< typename is_mutable_point_concept::type>::type, + typename is_polygon_with_holes_type::type>::type, + bool>::type + center(T1& center_point, const T2& polygon) { + typedef typename polygon_traits::coordinate_type coordinate_type; + rectangle_data bbox; + extents(bbox, polygon); + return center(center_point, bbox); + } + template template polygon_90_data& polygon_90_data::operator=(const T2& rvalue) {