| 2939 | } |
| 2940 | |
| 2941 | bool ClipperBase::CheckSplitOwner(OutRec* outrec, OutRecList* splits) |
| 2942 | { |
| 2943 | // nb: use indexing (not an iterator) in case 'splits' is modified inside this loop (#1029) |
| 2944 | for (size_t idx = 0; idx < splits->size(); ++idx) |
| 2945 | { |
| 2946 | OutRec* split = (*splits)[idx]; |
| 2947 | if (!split->pts && split->splits && |
| 2948 | CheckSplitOwner(outrec, split->splits)) return true; //#942 |
| 2949 | split = GetRealOutRec(split); |
| 2950 | if (!split || split == outrec || split->recursive_split == outrec) continue; |
| 2951 | split->recursive_split = outrec; // prevent infinite loops |
| 2952 | |
| 2953 | if (split->splits && CheckSplitOwner(outrec, split->splits)) |
| 2954 | return true; |
| 2955 | |
| 2956 | if (!CheckBounds(split) || !split->bounds.Contains(outrec->bounds) || |
| 2957 | !Path2ContainsPath1(outrec->pts, split->pts)) continue; |
| 2958 | |
| 2959 | if (!IsValidOwner(outrec, split)) // split is owned by outrec! (#957) |
| 2960 | split->owner = outrec->owner; |
| 2961 | |
| 2962 | outrec->owner = split; |
| 2963 | return true; |
| 2964 | |
| 2965 | } |
| 2966 | return false; |
| 2967 | } |
| 2968 | |
| 2969 | void ClipperBase::RecursiveCheckOwners(OutRec* outrec, PolyPath* polypath) |
| 2970 | { |
nothing calls this directly
no test coverage detected