| 3101 | } |
| 3102 | |
| 3103 | void ClipperD::BuildPathsD(PathsD& solutionClosed, PathsD* solutionOpen) |
| 3104 | { |
| 3105 | solutionClosed.resize(0); |
| 3106 | solutionClosed.reserve(outrec_list_.size()); |
| 3107 | if (solutionOpen) |
| 3108 | { |
| 3109 | solutionOpen->resize(0); |
| 3110 | solutionOpen->reserve(outrec_list_.size()); |
| 3111 | } |
| 3112 | |
| 3113 | // outrec_list_.size() is not static here because |
| 3114 | // CleanCollinear below can indirectly add additional |
| 3115 | // OutRec (via FixOutRecPts) |
| 3116 | for (std::size_t i = 0; i < outrec_list_.size(); ++i) |
| 3117 | { |
| 3118 | OutRec* outrec = outrec_list_[i]; |
| 3119 | if (outrec->pts == nullptr) continue; |
| 3120 | |
| 3121 | PathD path; |
| 3122 | if (solutionOpen && outrec->is_open) |
| 3123 | { |
| 3124 | if (BuildPathD(outrec->pts, reverse_solution_, true, path, invScale_)) |
| 3125 | solutionOpen->emplace_back(std::move(path)); |
| 3126 | } |
| 3127 | else |
| 3128 | { |
| 3129 | CleanCollinear(outrec); |
| 3130 | //closed paths should always return a Positive orientation |
| 3131 | if (BuildPathD(outrec->pts, reverse_solution_, false, path, invScale_)) |
| 3132 | solutionClosed.emplace_back(std::move(path)); |
| 3133 | } |
| 3134 | } |
| 3135 | } |
| 3136 | |
| 3137 | void ClipperD::BuildTreeD(PolyPathD& polytree, PathsD& open_paths) |
| 3138 | { |
nothing calls this directly
no test coverage detected