Opened 7 years ago
#11575 new Bugs
Boost::Polygon insert(item, true) of polygon_set_data wrong
Reported by: | Owned by: | Lucanus Simonson | |
---|---|---|---|
Milestone: | To Be Determined | Component: | polygon |
Version: | Boost 1.56.0 | Severity: | Problem |
Keywords: | boost::polygon | Cc: |
Description
Codes below shows the way "o_full_set.insert(o_item, true);" which works in 1_53 but the same codes not get the same result with the same input in 1_56. And if i use "o_full_set -= o_item;", then it works fine.
oPrboundary : (0, 0) (1000, 0), (1000, 1000) (0, 1000) insert one polygon into pinGroup:(500, 500) (600, 500) (600, 600) (500, 600)
#include <iostream> #include <boost/polygon/polygon.hpp> #include <cassert> namespace gtl = boost::polygon; using namespace boost::polygon::operators;
lets construct a 10x10 rectangle shaped polygon typedef gtl::polygon_data<int> Polygon; typedef gtl::polygon_traits<Polygon>::point_type Point; typedef gtl::polygon_set_data<int> PolygonSet; typedef std::vector<Polygon> PolyDataSet; void getOBS(Polygon &oPrboundary, PolyDataSet &pinGroup) {
PolygonSet o_full_set; o_full_set.insert(oPrboundary, false);
foreach (Polygon o_item, pinGroup) {
o_full_set.insert(o_item, true); Insert As Hole, which works in 1_53 but not in 1_56 o_full_set -= o_item; works in 1_53 and 1_56
}
PolyDataSet o_OBS_set; o_full_set.get(o_OBS_set);
for (int i = 0; i < o_OBS_set.size(); ++i) {
Polygon o_poly = o_OBS_set.at(i); std::vector<Point> poly_points; poly_points.insert(poly_points.end(), o_poly.begin(), o_poly.end()); foreach(Point o_pos, poly_points) {
std::cout << "(" << o_pos.x() << ", " << ") ";
} std::cout << std::endl;
}
}
Codes