| 3011 | } |
| 3012 | |
| 3013 | void ClipperD::BuildPathsD(PathsD& solutionClosed, PathsD* solutionOpen) |
| 3014 | { |
| 3015 | solutionClosed.resize(0); |
| 3016 | solutionClosed.reserve(outrec_list_.size()); |
| 3017 | if (solutionOpen) |
| 3018 | { |
| 3019 | solutionOpen->resize(0); |
| 3020 | solutionOpen->reserve(outrec_list_.size()); |
| 3021 | } |
| 3022 | |
| 3023 | // outrec_list_.size() is not static here because |
| 3024 | // CleanCollinear below can indirectly add additional |
| 3025 | // OutRec (via FixOutRecPts) |
| 3026 | for (std::size_t i = 0; i < outrec_list_.size(); ++i) |
| 3027 | { |
| 3028 | OutRec* outrec = outrec_list_[i]; |
| 3029 | if (outrec->pts == nullptr) continue; |
| 3030 | |
| 3031 | PathD path; |
| 3032 | if (solutionOpen && outrec->is_open) |
| 3033 | { |
| 3034 | if (BuildPathD(outrec->pts, ReverseSolution, true, path, invScale_)) |
| 3035 | solutionOpen->emplace_back(std::move(path)); |
| 3036 | } |
| 3037 | else |
| 3038 | { |
| 3039 | CleanCollinear(outrec); |
| 3040 | //closed paths should always return a Positive orientation |
| 3041 | if (BuildPathD(outrec->pts, ReverseSolution, false, path, invScale_)) |
| 3042 | solutionClosed.emplace_back(std::move(path)); |
| 3043 | } |
| 3044 | } |
| 3045 | } |
| 3046 | |
| 3047 | void ClipperD::BuildTreeD(PolyPathD& polytree, PathsD& open_paths) |
| 3048 | { |
nothing calls this directly
no test coverage detected