| 3274 | #ifndef SVGFILL_MAIN |
| 3275 | |
| 3276 | bool svgfill::arrange_polygons(arrange_polygon_settings settings, const std::vector<svgfill::polygon_2>& polygons, std::vector<svgfill::polygon_2>& arranged) { |
| 3277 | std::vector<Polygon_2> cgal_polygons, cgal_polygons_out; |
| 3278 | std::transform(polygons.begin(), polygons.end(), std::back_inserter(cgal_polygons), [](auto& poly) { |
| 3279 | Polygon_2 result; |
| 3280 | std::transform(poly.boundary.begin(), poly.boundary.end(), std::back_inserter(result), [](auto& p) { |
| 3281 | return Point_2(p[0], p[1]); |
| 3282 | }); |
| 3283 | return result; |
| 3284 | }); |
| 3285 | arrange_cgal_polygons(settings, cgal_polygons, cgal_polygons_out); |
| 3286 | std::transform(cgal_polygons_out.begin(), cgal_polygons_out.end(), std::back_inserter(arranged), [](auto& poly) { |
| 3287 | svgfill::polygon_2 result; |
| 3288 | std::transform(poly.begin(), poly.end(), std::back_inserter(result.boundary), [](auto& pt) { |
| 3289 | return svgfill::point_2{ |
| 3290 | CGAL::to_double(pt.cartesian(0)), |
| 3291 | CGAL::to_double(pt.cartesian(1)), |
| 3292 | }; |
| 3293 | }); |
| 3294 | return result; |
| 3295 | }); |
| 3296 | return true; |
| 3297 | } |
| 3298 | |
| 3299 | #else |
| 3300 |
no test coverage detected