| 2903 | } |
| 2904 | |
| 2905 | void Clipper64::BuildPaths64(Paths64& solutionClosed, Paths64* solutionOpen) |
| 2906 | { |
| 2907 | solutionClosed.resize(0); |
| 2908 | solutionClosed.reserve(outrec_list_.size()); |
| 2909 | if (solutionOpen) |
| 2910 | { |
| 2911 | solutionOpen->resize(0); |
| 2912 | solutionOpen->reserve(outrec_list_.size()); |
| 2913 | } |
| 2914 | |
| 2915 | // nb: outrec_list_.size() may change in the following |
| 2916 | // while loop because polygons may be split during |
| 2917 | // calls to CleanCollinear which calls FixSelfIntersects |
| 2918 | for (size_t i = 0; i < outrec_list_.size(); ++i) |
| 2919 | { |
| 2920 | OutRec* outrec = outrec_list_[i]; |
| 2921 | if (outrec->pts == nullptr) continue; |
| 2922 | |
| 2923 | Path64 path; |
| 2924 | if (solutionOpen && outrec->is_open) |
| 2925 | { |
| 2926 | if (BuildPath64(outrec->pts, ReverseSolution, true, path)) |
| 2927 | solutionOpen->emplace_back(std::move(path)); |
| 2928 | } |
| 2929 | else |
| 2930 | { |
| 2931 | // nb: CleanCollinear can add to outrec_list_ |
| 2932 | CleanCollinear(outrec); |
| 2933 | //closed paths should always return a Positive orientation |
| 2934 | if (BuildPath64(outrec->pts, ReverseSolution, false, path)) |
| 2935 | solutionClosed.emplace_back(std::move(path)); |
| 2936 | } |
| 2937 | } |
| 2938 | } |
| 2939 | |
| 2940 | void Clipper64::BuildTree64(PolyPath64& polytree, Paths64& open_paths) |
| 2941 | { |
nothing calls this directly
no test coverage detected