| 3045 | } |
| 3046 | |
| 3047 | void ClipperD::BuildTreeD(PolyPathD& polytree, PathsD& open_paths) |
| 3048 | { |
| 3049 | polytree.Clear(); |
| 3050 | open_paths.resize(0); |
| 3051 | if (has_open_paths_) |
| 3052 | open_paths.reserve(outrec_list_.size()); |
| 3053 | |
| 3054 | // outrec_list_.size() is not static here because |
| 3055 | // BuildPathD below can indirectly add additional OutRec //#607 |
| 3056 | for (size_t i = 0; i < outrec_list_.size(); ++i) |
| 3057 | { |
| 3058 | OutRec* outrec = outrec_list_[i]; |
| 3059 | if (!outrec || !outrec->pts) continue; |
| 3060 | if (outrec->is_open) |
| 3061 | { |
| 3062 | PathD path; |
| 3063 | if (BuildPathD(outrec->pts, ReverseSolution, true, path, invScale_)) |
| 3064 | open_paths.push_back(path); |
| 3065 | continue; |
| 3066 | } |
| 3067 | |
| 3068 | if (CheckBounds(outrec)) |
| 3069 | RecursiveCheckOwners(outrec, &polytree); |
| 3070 | } |
| 3071 | } |
| 3072 | |
| 3073 | } // namespace clipper2lib |