gishur.x
Class PolygonIntersectionSweep

java.lang.Object
  |
  +--gishur.core.Sweep
        |
        +--gishur.x.PolygonIntersectionSweep
All Implemented Interfaces:
java.util.EventListener, SweepListener

public class PolygonIntersectionSweep
extends Sweep

PolygonIntersectionSweep realisiert den Schnitt von zwei einfachen Polygonen mittels eines Plane-Sweeps in O(n*log(n)) Zeit, wobei n die Summe der Eckpunkte der beiden Polygon bezeichnet. Um den Algorithmus auszuführen, muß ledeglich polygonIntersection aufgerufen werden.

Version:
1.0
Author:
Thomas Wolf

Constructor Summary
PolygonIntersectionSweep()
           
 
Method Summary
 SimpleList polygonIntersection(XPolygon pol1, XPolygon pol2)
          Berechnet den Schnitt der Polygone pol1 und pol2 in O(n*log(n)) Zeit, wobei n die Summe der Anzahl der Randpunkte von pol1 und pol2 bezeichnet.
 void processEvent(SweepEvent e)
          Verarbeitet das SweepEvent e.
 
Methods inherited from class gishur.core.Sweep
createEventStructure, createEventStructure, createSSS, createSSS, execute, insertEvent, setSweepListener, sss
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolygonIntersectionSweep

public PolygonIntersectionSweep()
Method Detail

polygonIntersection

public SimpleList polygonIntersection(XPolygon pol1,
                                      XPolygon pol2)
Berechnet den Schnitt der Polygone pol1 und pol2 in O(n*log(n)) Zeit, wobei n die Summe der Anzahl der Randpunkte von pol1 und pol2 bezeichnet. Vorbedingung: Die Polygone müssen beide einfach sein.
Parameters:
pol1,pol2 - die zu schneidenden Polygon
Returns:
Liste mit allen Schnittpolygonen

processEvent

public void processEvent(SweepEvent e)
Verarbeitet das SweepEvent e.
Overrides:
processEvent in class Sweep
Parameters:
e - SweepEvent