MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / outerPolyNodeToPathObjects

Function outerPolyNodeToPathObjects

src/core/objects/boolean_tool.cpp:539–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537}
538
539void 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
564void pathObjectToPolygons(
565 const PathObject* object,

Callers 1

polyTreeToPathObjectsFunction · 0.85

Calls 4

polygonToPathPartFunction · 0.85
clearCoordinatesMethod · 0.80
duplicateMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected