 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
Load PQ with
segment-start and segment-end events;
|
|
|
loop
|
|
|
|
Get next event
from PQ;
|
|
|
|
if (intersection)
then Report it;
|
|
|
|
Update sweepline;
|
|
|
|
Check for new
adjacencies;
|
|
|
|
If two segments
are newly adjacent and they intersect then
|
|
|
Insert their
intersection-event into the PQ;
|
|
|
end loop;
|
|