| 2854 | //------------------------------------------------------------------------------ |
| 2855 | |
| 2856 | void Clipper::BuildIntersectList(const cInt topY) |
| 2857 | { |
| 2858 | if ( !m_ActiveEdges ) return; |
| 2859 | |
| 2860 | //prepare for sorting ... |
| 2861 | TEdge* e = m_ActiveEdges; |
| 2862 | m_SortedEdges = e; |
| 2863 | while( e ) |
| 2864 | { |
| 2865 | e->PrevInSEL = e->PrevInAEL; |
| 2866 | e->NextInSEL = e->NextInAEL; |
| 2867 | e->Curr.X = TopX( *e, topY ); |
| 2868 | e = e->NextInAEL; |
| 2869 | } |
| 2870 | |
| 2871 | //bubblesort ... |
| 2872 | bool isModified; |
| 2873 | do |
| 2874 | { |
| 2875 | isModified = false; |
| 2876 | e = m_SortedEdges; |
| 2877 | while( e->NextInSEL ) |
| 2878 | { |
| 2879 | TEdge *eNext = e->NextInSEL; |
| 2880 | IntPoint Pt; |
| 2881 | if(e->Curr.X > eNext->Curr.X) |
| 2882 | { |
| 2883 | IntersectPoint(*e, *eNext, Pt); |
| 2884 | if (Pt.Y < topY) Pt = IntPoint(TopX(*e, topY), topY); |
| 2885 | IntersectNode * newNode = new IntersectNode; |
| 2886 | newNode->Edge1 = e; |
| 2887 | newNode->Edge2 = eNext; |
| 2888 | newNode->Pt = Pt; |
| 2889 | m_IntersectList.push_back(newNode); |
| 2890 | |
| 2891 | SwapPositionsInSEL(e, eNext); |
| 2892 | isModified = true; |
| 2893 | } |
| 2894 | else |
| 2895 | e = eNext; |
| 2896 | } |
| 2897 | if( e->PrevInSEL ) e->PrevInSEL->NextInSEL = 0; |
| 2898 | else break; |
| 2899 | } |
| 2900 | while ( isModified ); |
| 2901 | m_SortedEdges = 0; //important |
| 2902 | } |
| 2903 | //------------------------------------------------------------------------------ |
| 2904 | |
| 2905 |
nothing calls this directly
no test coverage detected