[Boost-bugs] [Boost C++ Libraries] #11575: Boost::Polygon insert(item, true) of polygon_set_data wrong

Subject: [Boost-bugs] [Boost C++ Libraries] #11575: Boost::Polygon insert(item, true) of polygon_set_data wrong
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-08-24 16:50:22


#11575: Boost::Polygon insert(item, true) of polygon_set_data wrong
------------------------------+----------------------
 Reporter: cybfly1@… | Owner: ljsimons
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: polygon
  Version: Boost 1.56.0 | Severity: Problem
 Keywords: boost::polygon |
------------------------------+----------------------
 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;
         }
 }



 http://www.cnblogs.com/dawnWind/p/boost_003.html

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11575>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC