MCPcopy Create free account
hub / github.com/axmolengine/axmol / DoMaxima

Method DoMaxima

3rdparty/clipper2/src/clipper.engine.cpp:2740–2794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2738
2739
2740 Active* ClipperBase::DoMaxima(Active& e)
2741 {
2742 Active* next_e, * prev_e, * max_pair;
2743 prev_e = e.prev_in_ael;
2744 next_e = e.next_in_ael;
2745 if (IsOpenEnd(e))
2746 {
2747 if (IsHotEdge(e)) AddOutPt(e, e.top);
2748 if (!IsHorizontal(e))
2749 {
2750 if (IsHotEdge(e))
2751 {
2752 if (IsFront(e))
2753 e.outrec->front_edge = nullptr;
2754 else
2755 e.outrec->back_edge = nullptr;
2756 e.outrec = nullptr;
2757 }
2758 DeleteFromAEL(e);
2759 }
2760 return next_e;
2761 }
2762
2763 max_pair = GetMaximaPair(e);
2764 if (!max_pair) return next_e; // eMaxPair is horizontal
2765
2766 if (IsJoined(e)) Split(e, e.top);
2767 if (IsJoined(*max_pair)) Split(*max_pair, max_pair->top);
2768
2769 //only non-horizontal maxima here.
2770 //process any edges between maxima pair ...
2771 while (next_e != max_pair)
2772 {
2773 IntersectEdges(e, *next_e, e.top);
2774 SwapPositionsInAEL(e, *next_e);
2775 next_e = e.next_in_ael;
2776 }
2777
2778 if (IsOpen(e))
2779 {
2780 if (IsHotEdge(e))
2781 AddLocalMaxPoly(e, *max_pair, e.top);
2782 DeleteFromAEL(*max_pair);
2783 DeleteFromAEL(e);
2784 return (prev_e ? prev_e->next_in_ael : actives_);
2785 }
2786
2787 // e.next_in_ael== max_pair ...
2788 if (IsHotEdge(e))
2789 AddLocalMaxPoly(e, *max_pair, e.top);
2790
2791 DeleteFromAEL(e);
2792 DeleteFromAEL(*max_pair);
2793 return (prev_e ? prev_e->next_in_ael : actives_);
2794 }
2795
2796 void ClipperBase::Split(Active& e, const Point64& pt)
2797 {

Callers

nothing calls this directly

Calls 7

IsOpenEndFunction · 0.85
IsHotEdgeFunction · 0.85
IsFrontFunction · 0.85
GetMaximaPairFunction · 0.85
IsJoinedFunction · 0.85
IsOpenFunction · 0.85
IsHorizontalFunction · 0.70

Tested by

no test coverage detected