|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r86775 - in trunk/boost/polygon: . detail
From: sydorchuk.andriy_at_[hidden]
Date: 2013-11-19 18:07:09
Author: asydorchuk
Date: 2013-11-19 18:07:09 EST (Tue, 19 Nov 2013)
New Revision: 86775
URL: http://svn.boost.org/trac/boost/changeset/86775
Log:
Polygon: fixing issue #8575.
Text files modified:
trunk/boost/polygon/detail/polygon_45_touch.hpp | 4 ++--
trunk/boost/polygon/detail/polygon_arbitrary_formation.hpp | 31 +++++++++++++++++--------------
trunk/boost/polygon/transform.hpp | 2 +-
3 files changed, 20 insertions(+), 17 deletions(-)
Modified: trunk/boost/polygon/detail/polygon_45_touch.hpp
==============================================================================
--- trunk/boost/polygon/detail/polygon_45_touch.hpp Tue Nov 19 17:09:40 2013 (r86774)
+++ trunk/boost/polygon/detail/polygon_45_touch.hpp 2013-11-19 18:07:09 EST (Tue, 19 Nov 2013) (r86775)
@@ -65,8 +65,8 @@
inline CountTouch& operator=(const CountTouch& count) { counts = count.counts; return *this; }
inline int& operator[](int index) {
std::vector<std::pair<int, int> >::iterator itr =
- std::lower_bound(counts.begin(), counts.end(),
- std::make_pair(index, int(0)));
+ std::lower_bound(counts.begin(), counts.end(),
+ std::make_pair(index, int(0)));
if(itr != counts.end() && itr->first == index) {
return itr->second;
}
Modified: trunk/boost/polygon/detail/polygon_arbitrary_formation.hpp
==============================================================================
--- trunk/boost/polygon/detail/polygon_arbitrary_formation.hpp Tue Nov 19 17:09:40 2013 (r86774)
+++ trunk/boost/polygon/detail/polygon_arbitrary_formation.hpp 2013-11-19 18:07:09 EST (Tue, 19 Nov 2013) (r86775)
@@ -326,11 +326,12 @@
} else if(elm1y == elm2y) {
if(elm1 == elm2)
return false;
- 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;
+ 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);
}
}
return retval;
@@ -826,11 +827,12 @@
} else if(elm1y == elm2y) {
if(elm1.pt == elm2.pt && elm1.other_pt == elm2.other_pt)
return false;
- 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;
+ 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);
}
}
return retval;
@@ -1233,10 +1235,11 @@
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 {
- 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);
+ 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));
return scanline_base<Unit>::less_slope(dx1, dy1, dx2, dy2);
}
};
Modified: trunk/boost/polygon/transform.hpp
==============================================================================
--- trunk/boost/polygon/transform.hpp Tue Nov 19 17:09:40 2013 (r86774)
+++ trunk/boost/polygon/transform.hpp 2013-11-19 18:07:09 EST (Tue, 19 Nov 2013) (r86775)
@@ -1,4 +1,4 @@
-// Boost.Polygon library point_data.hpp header file
+// Boost.Polygon library transform.hpp header file
// Copyright (c) Intel Corporation 2008.
// Copyright (c) 2008-2012 Simonson Lucanus.
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