| 537 | } |
| 538 | |
| 539 | void outerPolyNodeToPathObjects(const ClipperLib::PolyNode& node, PathObjects& out_objects, const PathObject* proto, const PolyMap& polymap) |
| 540 | { |
| 541 | auto object = std::unique_ptr<PathObject>{ proto->duplicate() }; |
| 542 | object->clearCoordinates(); |
| 543 | |
| 544 | try |
| 545 | { |
| 546 | polygonToPathPart(node.Contour, polymap, object.get()); |
| 547 | for (int i = 0, i_count = node.ChildCount(); i < i_count; ++i) |
| 548 | { |
| 549 | polygonToPathPart(node.Childs[i]->Contour, polymap, object.get()); |
| 550 | |
| 551 | // Add outer polygons contained by (nested within) holes ... |
| 552 | for (int j = 0, j_count = node.Childs[i]->ChildCount(); j < j_count; ++j) |
| 553 | outerPolyNodeToPathObjects(*node.Childs[i]->Childs[j], out_objects, proto, polymap); |
| 554 | } |
| 555 | |
| 556 | out_objects.push_back(object.release()); |
| 557 | } |
| 558 | catch (std::range_error&) |
| 559 | { |
| 560 | // Do nothing |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | void pathObjectToPolygons( |
| 565 | const PathObject* object, |
no test coverage detected