public class NodingIntersectionFinder extends Object implements SegmentIntersector
SegmentString
s,
if any exist.
Non-noded intersections include:
SegmentString
s
(with a segment string endpoint or with another interior vertex)
setInteriorIntersectionsOnly(boolean)
.
By default only the first intersection is found,
but all can be found by setting setFindAllIntersections(boolean)
Constructor and Description |
---|
NodingIntersectionFinder(LineIntersector li)
Creates an intersection finder which finds an intersection
if one exists
|
Modifier and Type | Method and Description |
---|---|
int |
count()
Gets the count of intersections found.
|
static NodingIntersectionFinder |
createAllIntersectionsFinder(LineIntersector li)
Creates a finder which finds all intersections.
|
static NodingIntersectionFinder |
createAnyIntersectionFinder(LineIntersector li)
Creates a finder which tests if there is at least one intersection.
|
static NodingIntersectionFinder |
createInteriorIntersectionCounter(LineIntersector li)
Creates an finder which counts all interior intersections.
|
static NodingIntersectionFinder |
createInteriorIntersectionsFinder(LineIntersector li)
Creates a finder which finds all interior intersections.
|
static NodingIntersectionFinder |
createIntersectionCounter(LineIntersector li)
Creates an finder which counts all intersections.
|
Coordinate |
getIntersection()
Gets the computed location of the intersection.
|
List |
getIntersections()
Gets the intersections found.
|
Coordinate[] |
getIntersectionSegments()
Gets the endpoints of the intersecting segments.
|
boolean |
hasIntersection()
Tests whether an intersection was found.
|
boolean |
isDone()
Reports whether the client of this class
needs to continue testing all intersections in an arrangement.
|
void |
processIntersections(SegmentString e0,
int segIndex0,
SegmentString e1,
int segIndex1)
This method is called by clients
of the
SegmentIntersector class to process
intersections for two segments of the SegmentString s being intersected. |
void |
setCheckEndSegmentsOnly(boolean isCheckEndSegmentsOnly)
Sets whether only end segments should be tested for intersection.
|
void |
setFindAllIntersections(boolean findAllIntersections)
Sets whether all intersections should be computed.
|
void |
setInteriorIntersectionsOnly(boolean isInteriorIntersectionsOnly)
Sets whether only interior (proper) intersections will be found.
|
void |
setKeepIntersections(boolean keepIntersections)
Sets whether intersection points are recorded.
|
public NodingIntersectionFinder(LineIntersector li)
li
- the LineIntersector to usepublic static NodingIntersectionFinder createAnyIntersectionFinder(LineIntersector li)
li
- a line intersectorpublic static NodingIntersectionFinder createAllIntersectionsFinder(LineIntersector li)
li
- a line intersectorpublic static NodingIntersectionFinder createInteriorIntersectionsFinder(LineIntersector li)
li
- a line intersectorpublic static NodingIntersectionFinder createIntersectionCounter(LineIntersector li)
li
- a line intersectorpublic static NodingIntersectionFinder createInteriorIntersectionCounter(LineIntersector li)
li
- a line intersectorpublic void setFindAllIntersections(boolean findAllIntersections)
false
(the default value)
the value of isDone()
is true
after the first intersection is found.
Default is false
.
findAllIntersections
- whether all intersections should be computedpublic void setInteriorIntersectionsOnly(boolean isInteriorIntersectionsOnly)
isInteriorIntersectionsOnly
- whether to find only interior intersectionspublic void setCheckEndSegmentsOnly(boolean isCheckEndSegmentsOnly)
isCheckEndSegmentsOnly
- whether to test only end segmentspublic void setKeepIntersections(boolean keepIntersections)
false
.
Default is true
.
keepIntersections
- indicates whether intersections should be recordedpublic List getIntersections()
Coordinate
public int count()
public boolean hasIntersection()
public Coordinate getIntersection()
public Coordinate[] getIntersectionSegments()
public void processIntersections(SegmentString e0, int segIndex0, SegmentString e1, int segIndex1)
SegmentIntersector
class to process
intersections for two segments of the SegmentString
s being intersected.
Note that some clients (such as MonotoneChain
s) may optimize away
this call for segment pairs which they have determined do not intersect
(e.g. by an disjoint envelope test).processIntersections
in interface SegmentIntersector
public boolean isDone()
SegmentIntersector
isDone
in interface SegmentIntersector
Copyright © 2022. All rights reserved.