|
Algorithm Development Kit 1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalgs.model.problems.segmentIntersection.EventPoint
public class EventPoint
The EventPoint is the basic element of the EventQueue.
Each EventPoint is fully ordered according to the Horizontal Sweep Line. Specifically, e1 < e2 if and only if (a) e1.y > e2.y or (b) e1.y == e2.y and e1.x < e2.x
Note that even points store information about the line segments being processed, including: (a) upper segments that begin at the given event point; (b) lower segments that end at the given event point; and (c) segments that intersect at the event point.
Field Summary | |
---|---|
static java.util.Comparator<EventPoint> |
eventPointSorter
Globally useful sorter, sorts points based on a horizontal sweep line moving vertically down the Cartesian plane. |
IPoint |
point
The point. |
static java.util.Comparator<IPoint> |
pointSorter
Globally useful sorter, sorts points based on a horizontal sweep line moving vertically down the Cartesian plane. |
Constructor Summary | |
---|---|
EventPoint(IPoint p)
Constructor for the Event Point when not an upper (start) endpoint. |
Method Summary | |
---|---|
void |
addIntersectingLineSegment(ILineSegment ints)
Add this line segment as an intersecting one. |
void |
addLowerLineSegment(ILineSegment lower)
Add this line segment but only if its Lower (i.e., End) is reflective of this eventPoint. |
void |
addUpperLineSegment(ILineSegment upper)
Add this line segment but only if its Upper (i.e., Start) is reflective of this eventPoint. |
void |
addUpperLineSegments(List<ILineSegment> list)
Batch process a set of upper insertions here. |
int |
compare(EventPoint o1,
EventPoint o2)
Comparison assumes a horizontal sweep line starting from the top and sweeping down the plane. |
boolean |
equals(java.lang.Object o)
Need equals method if this class is ever to be used within the collection classes. |
List<ILineSegment> |
intersectingSegments()
Return the set of Line segments that intersect this eventPoint. |
List<ILineSegment> |
lowerEndpointSegments()
Return the set of Line segments whose lower (i.e., End) endpoint is this EventPoint. |
java.lang.String |
toString()
Useful representation. |
List<ILineSegment> |
upperEndpointSegments()
Return the set of Line segments whose upper (i.e., Start) endpoint is this EventPoint. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final IPoint point
public static java.util.Comparator<IPoint> pointSorter
public static java.util.Comparator<EventPoint> eventPointSorter
Constructor Detail |
---|
public EventPoint(IPoint p)
p
- point of interestMethod Detail |
---|
public int compare(EventPoint o1, EventPoint o2)
compare
in interface java.util.Comparator<EventPoint>
o1
- point 1 under comparisono2
- point 2 under comparisonpublic void addUpperLineSegment(ILineSegment upper)
upper
- public void addLowerLineSegment(ILineSegment lower)
lower
- public void addIntersectingLineSegment(ILineSegment ints)
ints
- public List<ILineSegment> upperEndpointSegments()
public List<ILineSegment> lowerEndpointSegments()
public List<ILineSegment> intersectingSegments()
public void addUpperLineSegments(List<ILineSegment> list)
list
- list of line segmentspublic boolean equals(java.lang.Object o)
equals
in interface java.util.Comparator<EventPoint>
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |