This class calculates the intersection of rectangles in the plane with the help of a sweep-line algorithm.
Inheritance Hierarchy
IntersectionAlgorithm
Remarks
The complexity is
O(n log n + s)
where n
is the number of rectangles and s
the number of intersections.Type Details
- yfiles module
- algorithms
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.algorithms.IntersectionAlgorithm
Static Methods
findIntersections
(graph: LayoutGraph, intersectionItemType: IntersectionItemTypes, affectedItems: IEnumerable<Object>) : IList<IntersectionInfo>Returns a list of intersections between the graph items or a subset of graph items.
Remarks
Finds only intersections where one or more items of the list of affected items are involved. Intersections involving only other items are ignored. If the list of affected items is empty or the items are excluded due to the intersection item type, the result will not contain any intersections.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- intersectionItemType - IntersectionItemTypes
- the type(s) of graph items to consider
- affectedItems - IEnumerable<Object>
- the list of items that must be involved in each intersection or
null
if all items should be considered; can contain instances of type YNode, Edge, INodeLabelLayout, IEdgeLabelLayout and LabelLayoutData
Returns
- ↪IList<IntersectionInfo>
- a list of intersections (of type IntersectionInfo) between graph items
This method is not available unless the module layout-core is loaded. More information.
Calculates the intersections of rectangles in the plane.
Remarks
Every found intersection is reported to an
IntersectionHandler
. Rectangles with negative size are completely ignored by this implementation (i.e. never generate intersections)Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- objects - YList
- a list of
PlaneObject
objects. - iHandler - IIntersectionHandler
- intersections are reported to this class.