y.geom
Class IntersectionAlgorithm

java.lang.Object
  |
  +--y.geom.IntersectionAlgorithm

public class IntersectionAlgorithm
extends Object

This class calculates the intersection of rectangles in the plane with the help of a sweep-line algorithm.
The complexity is O(n log n + s) where n is the number of rectangles and s the number of intersections.


Nested Class Summary
static interface IntersectionAlgorithm.IntersectionHandler
          An instance of this interface handles intersections found by the IntersectionAlgorithmr,
 
Constructor Summary
IntersectionAlgorithm()
           
 
Method Summary
protected static YList createXStruct(YList objects)
          Inits the sweepline datastrcutures form a set of objects.
static void intersect(YList objects, IntersectionAlgorithm.IntersectionHandler iHandler)
          Calculates the intersections of rectangles in the plane.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntersectionAlgorithm

public IntersectionAlgorithm()
Method Detail

intersect

public static void intersect(YList objects,
                             IntersectionAlgorithm.IntersectionHandler iHandler)
Calculates the intersections of rectangles in the plane. Every found intersection is reported to an IntersectionHandler.

Parameters:
objects - a list PlaneObject objects.
iHandler - intersections a reported to this class.

createXStruct

protected static YList createXStruct(YList objects)
Inits the sweepline datastrcutures form a set of objects.


© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003