SFSweepLine
Objective-C
@interface SFSweepLine : NSObject
Swift
class SFSweepLine : NSObject
Sweep Line algorithm
-
Initialize
Declaration
Objective-C
- (instancetype)initWithRings:(NSArray<SFLineString *> *)rings;
Swift
init!(rings: [SFLineString]!)
Parameters
rings
polygon rings
Return Value
sweep line
-
Add the event to the sweep line
Declaration
Parameters
event
event
Return Value
added segment
-
Find the existing event segment
Declaration
Parameters
event
event
Return Value
segment
-
Determine if the two segments intersect
Declaration
Parameters
segment1
segment 1
segment2
segment 2
Return Value
true if intersection, false if not
-
XY order of two points
Declaration
Parameters
point1
point 1
point2
point 2
Return Value
NSOrderedDescending if p1 > p2, NSOrderedAscending if p1 < p2, NSOrderedSame if equal