MCPcopy Create free account
hub / github.com/axmolengine/axmol / BuildPaths64

Method BuildPaths64

3rdparty/clipper2/src/clipper.engine.cpp:2994–3027  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2992 }
2993
2994 void Clipper64::BuildPaths64(Paths64& solutionClosed, Paths64* solutionOpen)
2995 {
2996 solutionClosed.resize(0);
2997 solutionClosed.reserve(outrec_list_.size());
2998 if (solutionOpen)
2999 {
3000 solutionOpen->resize(0);
3001 solutionOpen->reserve(outrec_list_.size());
3002 }
3003
3004 // nb: outrec_list_.size() may change in the following
3005 // while loop because polygons may be split during
3006 // calls to CleanCollinear which calls FixSelfIntersects
3007 for (size_t i = 0; i < outrec_list_.size(); ++i)
3008 {
3009 OutRec* outrec = outrec_list_[i];
3010 if (outrec->pts == nullptr) continue;
3011
3012 Path64 path;
3013 if (solutionOpen && outrec->is_open)
3014 {
3015 if (BuildPath64(outrec->pts, reverse_solution_, true, path))
3016 solutionOpen->emplace_back(std::move(path));
3017 }
3018 else
3019 {
3020 // nb: CleanCollinear can add to outrec_list_
3021 CleanCollinear(outrec);
3022 //closed paths should always return a Positive orientation
3023 if (BuildPath64(outrec->pts, reverse_solution_, false, path))
3024 solutionClosed.emplace_back(std::move(path));
3025 }
3026 }
3027 }
3028
3029 void Clipper64::BuildTree64(PolyPath64& polytree, Paths64& open_paths)
3030 {

Callers

nothing calls this directly

Calls 5

BuildPath64Function · 0.85
resizeMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected