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

Method BuildIntersectList

renderers/agg/src/clipper.cpp:1716–1758  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1714//------------------------------------------------------------------------------
1715
1716void Clipper::BuildIntersectList(const long64 topY)
1717{
1718 if ( !m_ActiveEdges ) return;
1719
1720 //prepare for sorting ...
1721 TEdge* e = m_ActiveEdges;
1722 e->tmpX = TopX( *e, topY );
1723 m_SortedEdges = e;
1724 m_SortedEdges->prevInSEL = 0;
1725 e = e->nextInAEL;
1726 while( e )
1727 {
1728 e->prevInSEL = e->prevInAEL;
1729 e->prevInSEL->nextInSEL = e;
1730 e->nextInSEL = 0;
1731 e->tmpX = TopX( *e, topY );
1732 e = e->nextInAEL;
1733 }
1734
1735 //bubblesort ...
1736 bool isModified = true;
1737 while( isModified && m_SortedEdges )
1738 {
1739 isModified = false;
1740 e = m_SortedEdges;
1741 while( e->nextInSEL )
1742 {
1743 TEdge *eNext = e->nextInSEL;
1744 IntPoint pt;
1745 if(e->tmpX > eNext->tmpX && IntersectPoint(*e, *eNext, pt))
1746 {
1747 AddIntersectNode( e, eNext, pt );
1748 SwapPositionsInSEL(e, eNext);
1749 isModified = true;
1750 }
1751 else
1752 e = eNext;
1753 }
1754 if( e->prevInSEL ) e->prevInSEL->nextInSEL = 0;
1755 else break;
1756 }
1757 m_SortedEdges = 0;
1758}
1759//------------------------------------------------------------------------------
1760
1761bool Process1Before2(IntersectNode &node1, IntersectNode &node2)

Callers

nothing calls this directly

Calls 2

TopXFunction · 0.85
IntersectPointFunction · 0.85

Tested by

no test coverage detected