MCPcopy Create free account
hub / github.com/MapServer/MapServer / InsertLocalMinimaIntoAEL

Method InsertLocalMinimaIntoAEL

renderers/agg/src/clipper.cpp:1049–1123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1047//------------------------------------------------------------------------------
1048
1049void Clipper::InsertLocalMinimaIntoAEL( const long64 botY)
1050{
1051 while( m_CurrentLM && ( m_CurrentLM->Y == botY ) )
1052 {
1053 TEdge* lb = m_CurrentLM->leftBound;
1054 TEdge* rb = m_CurrentLM->rightBound;
1055
1056 InsertEdgeIntoAEL( lb );
1057 InsertScanbeam( lb->ytop );
1058 InsertEdgeIntoAEL( rb );
1059
1060 if ( IsNonZeroFillType( *lb) )
1061 rb->windDelta = -lb->windDelta;
1062 else
1063 {
1064 lb->windDelta = 1;
1065 rb->windDelta = 1;
1066 }
1067 SetWindingCount( *lb );
1068 rb->windCnt = lb->windCnt;
1069 rb->windCnt2 = lb->windCnt2;
1070
1071 if( rb->dx == horizontal )
1072 {
1073 //nb: only rightbounds can have a horizontal bottom edge
1074 AddEdgeToSEL( rb );
1075 InsertScanbeam( rb->nextInLML->ytop );
1076 }
1077 else
1078 InsertScanbeam( rb->ytop );
1079
1080 if( IsContributing(*lb) )
1081 AddLocalMinPoly( lb, rb, IntPoint(lb->xcurr, m_CurrentLM->Y) );
1082
1083 //if output polygons share an edge, they'll need joining later ...
1084 if (lb->outIdx >= 0 && lb->prevInAEL &&
1085 lb->prevInAEL->outIdx >= 0 && lb->prevInAEL->xcurr == lb->xbot &&
1086 SlopesEqual(*lb, *lb->prevInAEL))
1087 AddJoin(lb, lb->prevInAEL);
1088
1089 //if any output polygons share an edge, they'll need joining later ...
1090 if (rb->outIdx >= 0)
1091 {
1092 if (rb->dx == horizontal)
1093 {
1094 for (HorzJoinList::size_type i = 0; i < m_HorizJoins.size(); ++i)
1095 {
1096 IntPoint pt, pt2; //returned by GetOverlapSegment() but unused here.
1097 HorzJoinRec* hj = m_HorizJoins[i];
1098 //if horizontals rb and hj.edge overlap, flag for joining later ...
1099 if (GetOverlapSegment(IntPoint(hj->edge->xbot, hj->edge->ybot),
1100 IntPoint(hj->edge->xtop, hj->edge->ytop),
1101 IntPoint(rb->xbot, rb->ybot),
1102 IntPoint(rb->xtop, rb->ytop), pt, pt2))
1103 AddJoin(hj->edge, rb, hj->savedIdx);
1104 }
1105 }
1106 }

Callers

nothing calls this directly

Calls 5

IntPointClass · 0.85
SlopesEqualFunction · 0.85
GetOverlapSegmentFunction · 0.85
clipperExceptionClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected