| 1714 | //------------------------------------------------------------------------------ |
| 1715 | |
| 1716 | void 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 | |
| 1761 | bool Process1Before2(IntersectNode &node1, IntersectNode &node2) |
nothing calls this directly
no test coverage detected