Boost C++ Libraries: Ticket #11575: Boost::Polygon insert(item, true) of polygon_set_data wrong https://svn.boost.org/trac10/ticket/11575 <p> 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. </p> <p> oPrboundary : (0, 0) (1000, 0), (1000, 1000) (0, 1000) insert one polygon into pinGroup:(500, 500) (600, 500) (600, 600) (500, 600) </p> <p> #include &lt;iostream&gt; #include &lt;boost/polygon/polygon.hpp&gt; #include &lt;cassert&gt; namespace gtl = boost::polygon; using namespace boost::polygon::operators; </p> <p> <em>lets construct a 10x10 rectangle shaped polygon typedef gtl::polygon_data&lt;int&gt; Polygon; typedef gtl::polygon_traits&lt;Polygon&gt;::point_type Point; typedef gtl::polygon_set_data&lt;int&gt; <a class="missing wiki">PolygonSet</a>; typedef std::vector&lt;Polygon&gt; <a class="missing wiki">PolyDataSet</a>; void getOBS(Polygon &amp;oPrboundary, <a class="missing wiki">PolyDataSet</a> &amp;pinGroup) { </em></p> <blockquote> <p> <a class="missing wiki">PolygonSet</a> o_full_set; o_full_set.insert(oPrboundary, false); </p> </blockquote> <p> </p> <blockquote> <p> foreach (Polygon o_item, pinGroup) { </p> <blockquote> <p> <em>o_full_set.insert(o_item, true); </em> Insert As Hole, which works in 1_53 but not in 1_56 o_full_set -= o_item; <em> works in 1_53 and 1_56 </em></p> </blockquote> <p> } </p> </blockquote> <p> </p> <blockquote> <p> <a class="missing wiki">PolyDataSet</a> o_OBS_set; o_full_set.get(o_OBS_set); </p> </blockquote> <p> </p> <blockquote> <p> for (int i = 0; i &lt; o_OBS_set.size(); ++i) { </p> <blockquote> <p> Polygon o_poly = o_OBS_set.at(i); std::vector&lt;Point&gt; poly_points; poly_points.insert(poly_points.end(), o_poly.begin(), o_poly.end()); foreach(Point o_pos, poly_points) { </p> <blockquote> <p> std::cout &lt;&lt; "(" &lt;&lt; o_pos.x() &lt;&lt; ", " &lt;&lt; ") "; </p> </blockquote> <p> } std::cout &lt;&lt; std::endl; </p> </blockquote> <p> } </p> </blockquote> <p> } </p> <p> <a class="ext-link" href="http://www.cnblogs.com/dawnWind/p/boost_003.html"><span class="icon">​</span>http://www.cnblogs.com/dawnWind/p/boost_003.html</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11575 Trac 1.4.3 cybfly1@… Mon, 24 Aug 2015 16:51:21 GMT attachment set https://svn.boost.org/trac10/ticket/11575 https://svn.boost.org/trac10/ticket/11575 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">PolygonGet.cpp</span> </li> </ul> <p> Codes </p> Ticket