Packagecom.yworks.yfiles.geom
Classpublic class IntersectionAlgorithm
InheritanceIntersectionAlgorithm Inheritance YObject Inheritance 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.



Public Methods
 MethodDefined By
  
IntersectionAlgorithm(init:Boolean = true)
IntersectionAlgorithm
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
IntersectionAlgorithm
 Inherited
hashCode():int
YObject
  
[static] Calculates the intersections of rectangles in the plane.
IntersectionAlgorithm
  
[static]
IntersectionAlgorithm
Protected Methods
 MethodDefined By
  
[static] Initializes the sweep line data structures from a set of objects.
IntersectionAlgorithm
  
IntersectionAlgorithm
Constructor Detail
IntersectionAlgorithm()Constructor
public function IntersectionAlgorithm(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
createXStruct()method
protected static function createXStruct(objects:YList):YList

Initializes the sweep line data structures from a set of objects.

Parameters

objects:YList

Returns
YList
getClass()method 
override public function getClass():Class

Returns
Class
initIntersectionAlgorithm()method 
protected final function initIntersectionAlgorithm():void

intersect()method 
public static function intersect(objects:YList, iHandler:IntersectionAlgorithm_IntersectionHandler):void

Calculates the intersections of rectangles in the plane. Every found intersection is reported to an IntersectionHandler. Rectangles with negative size are completely ignored by this implementation (i.e. never generate intersections)

Parameters

objects:YList — a list of PlaneObject objects.
 
iHandler:IntersectionAlgorithm_IntersectionHandler — intersections are reported to this class.

newIntersectionAlgorithm()method 
public static function newIntersectionAlgorithm():IntersectionAlgorithm

Returns
IntersectionAlgorithm