MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / DoMaxima

Method DoMaxima

TheForceEngine/TFE_Polygon/clipper.cpp:2957–3006  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2955//------------------------------------------------------------------------------
2956
2957void Clipper::DoMaxima(TEdge *e)
2958{
2959 TEdge* eMaxPair = GetMaximaPairEx(e);
2960 if (!eMaxPair)
2961 {
2962 if (e->OutIdx >= 0)
2963 AddOutPt(e, e->Top);
2964 DeleteFromAEL(e);
2965 return;
2966 }
2967
2968 TEdge* eNext = e->NextInAEL;
2969 while(eNext && eNext != eMaxPair)
2970 {
2971 IntersectEdges(e, eNext, e->Top);
2972 SwapPositionsInAEL(e, eNext);
2973 eNext = e->NextInAEL;
2974 }
2975
2976 if(e->OutIdx == Unassigned && eMaxPair->OutIdx == Unassigned)
2977 {
2978 DeleteFromAEL(e);
2979 DeleteFromAEL(eMaxPair);
2980 }
2981 else if( e->OutIdx >= 0 && eMaxPair->OutIdx >= 0 )
2982 {
2983 if (e->OutIdx >= 0) AddLocalMaxPoly(e, eMaxPair, e->Top);
2984 DeleteFromAEL(e);
2985 DeleteFromAEL(eMaxPair);
2986 }
2987#ifdef use_lines
2988 else if (e->WindDelta == 0)
2989 {
2990 if (e->OutIdx >= 0)
2991 {
2992 AddOutPt(e, e->Top);
2993 e->OutIdx = Unassigned;
2994 }
2995 DeleteFromAEL(e);
2996
2997 if (eMaxPair->OutIdx >= 0)
2998 {
2999 AddOutPt(eMaxPair, e->Top);
3000 eMaxPair->OutIdx = Unassigned;
3001 }
3002 DeleteFromAEL(eMaxPair);
3003 }
3004#endif
3005 else throw clipperException("DoMaxima error");
3006}
3007//------------------------------------------------------------------------------
3008
3009void Clipper::ProcessEdgesAtTopOfScanbeam(const cInt topY)

Callers

nothing calls this directly

Calls 1

GetMaximaPairExFunction · 0.85

Tested by

no test coverage detected