mirror of
https://github.com/boostorg/polygon.git
synced 2026-02-02 21:12:13 +00:00
Merge branch 'master' into develop
This commit is contained in:
@@ -326,12 +326,11 @@ namespace boost { namespace polygon{
|
||||
} else if(elm1y == elm2y) {
|
||||
if(elm1 == elm2)
|
||||
return false;
|
||||
typedef typename coordinate_traits<Unit>::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<Unit>::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<std::pair<std::pair<Point, Point>, int>, active_tail_arbitrary*>& elm1,
|
||||
const std::pair<std::pair<std::pair<Point, Point>, int>, active_tail_arbitrary*>& elm2) const {
|
||||
typedef typename coordinate_traits<Unit>::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<Unit>::less_slope(dx1, dy1, dx2, dy2);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -46,7 +46,7 @@ class point_data {
|
||||
}
|
||||
|
||||
template <typename PointType>
|
||||
explicit point_data(const PointType& that) {
|
||||
point_data(const PointType& that) {
|
||||
*this = that;
|
||||
}
|
||||
|
||||
|
||||
@@ -1418,18 +1418,6 @@ namespace boost { namespace polygon{
|
||||
}
|
||||
*/
|
||||
|
||||
template <typename T1, typename T2>
|
||||
typename enable_if<
|
||||
typename gtl_and< typename is_mutable_point_concept<typename geometry_concept<T1>::type>::type,
|
||||
typename is_polygon_with_holes_type<T2>::type>::type,
|
||||
bool>::type
|
||||
center(T1& center_point, const T2& polygon) {
|
||||
typedef typename polygon_traits<T2>::coordinate_type coordinate_type;
|
||||
rectangle_data<coordinate_type> bbox;
|
||||
extents(bbox, polygon);
|
||||
return center(center_point, bbox);
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
typename enable_if<
|
||||
typename gtl_and< typename is_mutable_rectangle_concept<typename geometry_concept<T1>::type>::type,
|
||||
@@ -1451,6 +1439,18 @@ namespace boost { namespace polygon{
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
typename enable_if<
|
||||
typename gtl_and< typename is_mutable_point_concept<typename geometry_concept<T1>::type>::type,
|
||||
typename is_polygon_with_holes_type<T2>::type>::type,
|
||||
bool>::type
|
||||
center(T1& center_point, const T2& polygon) {
|
||||
typedef typename polygon_traits<T2>::coordinate_type coordinate_type;
|
||||
rectangle_data<coordinate_type> bbox;
|
||||
extents(bbox, polygon);
|
||||
return center(center_point, bbox);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
template <class T2>
|
||||
polygon_90_data<T>& polygon_90_data<T>::operator=(const T2& rvalue) {
|
||||
|
||||
Reference in New Issue
Block a user