#include #include #include namespace gtl = boost::polygon; using namespace boost::polygon::operators; //lets construct a 10x10 rectangle shaped polygon typedef gtl::polygon_data Polygon; typedef gtl::polygon_traits::point_type Point; typedef gtl::polygon_set_data PolygonSet; typedef std::vector 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 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; } }