| 2658 | |
| 2659 | |
| 2660 | Active* ClipperBase::DoMaxima(Active& e) |
| 2661 | { |
| 2662 | Active* next_e, * prev_e, * max_pair; |
| 2663 | prev_e = e.prev_in_ael; |
| 2664 | next_e = e.next_in_ael; |
| 2665 | if (IsOpenEnd(e)) |
| 2666 | { |
| 2667 | if (IsHotEdge(e)) AddOutPt(e, e.top); |
| 2668 | if (!IsHorizontal(e)) |
| 2669 | { |
| 2670 | if (IsHotEdge(e)) |
| 2671 | { |
| 2672 | if (IsFront(e)) |
| 2673 | e.outrec->front_edge = nullptr; |
| 2674 | else |
| 2675 | e.outrec->back_edge = nullptr; |
| 2676 | e.outrec = nullptr; |
| 2677 | } |
| 2678 | DeleteFromAEL(e); |
| 2679 | } |
| 2680 | return next_e; |
| 2681 | } |
| 2682 | |
| 2683 | max_pair = GetMaximaPair(e); |
| 2684 | if (!max_pair) return next_e; // eMaxPair is horizontal |
| 2685 | |
| 2686 | if (IsJoined(e)) Split(e, e.top); |
| 2687 | if (IsJoined(*max_pair)) Split(*max_pair, max_pair->top); |
| 2688 | |
| 2689 | //only non-horizontal maxima here. |
| 2690 | //process any edges between maxima pair ... |
| 2691 | while (next_e != max_pair) |
| 2692 | { |
| 2693 | IntersectEdges(e, *next_e, e.top); |
| 2694 | SwapPositionsInAEL(e, *next_e); |
| 2695 | next_e = e.next_in_ael; |
| 2696 | } |
| 2697 | |
| 2698 | if (IsOpen(e)) |
| 2699 | { |
| 2700 | if (IsHotEdge(e)) |
| 2701 | AddLocalMaxPoly(e, *max_pair, e.top); |
| 2702 | DeleteFromAEL(*max_pair); |
| 2703 | DeleteFromAEL(e); |
| 2704 | return (prev_e ? prev_e->next_in_ael : actives_); |
| 2705 | } |
| 2706 | |
| 2707 | // e.next_in_ael== max_pair ... |
| 2708 | if (IsHotEdge(e)) |
| 2709 | AddLocalMaxPoly(e, *max_pair, e.top); |
| 2710 | |
| 2711 | DeleteFromAEL(e); |
| 2712 | DeleteFromAEL(*max_pair); |
| 2713 | return (prev_e ? prev_e->next_in_ael : actives_); |
| 2714 | } |
| 2715 | |
| 2716 | void ClipperBase::Split(Active& e, const Point64& pt) |
| 2717 | { |
nothing calls this directly
no test coverage detected