NodableSegmentString
, SegmentString
public class NodedSegmentString extends java.lang.Object implements NodableSegmentString
Coordinate
s.
Intended to optimize the noding of contiguous segments by
reducing the number of allocated objects.
SegmentStrings can carry a context object, which is useful
for preserving topological or parentage information.
All noded substrings are initialized with the same context object.Constructor | Description |
---|---|
NodedSegmentString(Coordinate[] pts,
java.lang.Object data) |
Creates a new segment string from a list of vertices.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addIntersection(LineIntersector li,
int segmentIndex,
int geomIndex,
int intIndex) |
Add an SegmentNode for intersection intIndex.
|
void |
addIntersection(Coordinate intPt,
int segmentIndex) |
Adds an intersection node for a given point and segment to this segment string.
|
SegmentNode |
addIntersectionNode(Coordinate intPt,
int segmentIndex) |
Adds an intersection node for a given point and segment to this segment string.
|
void |
addIntersections(LineIntersector li,
int segmentIndex,
int geomIndex) |
Adds EdgeIntersections for one or both
intersections found for a segment of an edge to the edge intersection list.
|
Coordinate |
getCoordinate(int i) |
|
Coordinate[] |
getCoordinates() |
|
java.lang.Object |
getData() |
Gets the user-defined data for this segment string.
|
static java.util.List |
getNodedSubstrings(java.util.Collection segStrings) |
Gets the
SegmentString s which result from splitting this string at node points. |
static void |
getNodedSubstrings(java.util.Collection segStrings,
java.util.Collection resultEdgelist) |
Adds the noded
SegmentString s which result from splitting this string at node points. |
SegmentNodeList |
getNodeList() |
|
int |
getSegmentOctant(int index) |
Gets the octant of the segment starting at vertex
index . |
boolean |
isClosed() |
|
void |
setData(java.lang.Object data) |
Sets the user-defined data for this segment string.
|
int |
size() |
|
java.lang.String |
toString() |
public NodedSegmentString(Coordinate[] pts, java.lang.Object data)
pts
- the vertices of the segment stringdata
- the user-defined data of this segment string (may be null)public static java.util.List getNodedSubstrings(java.util.Collection segStrings)
SegmentString
s which result from splitting this string at node points.segStrings
- a Collection of NodedSegmentStringspublic static void getNodedSubstrings(java.util.Collection segStrings, java.util.Collection resultEdgelist)
SegmentString
s which result from splitting this string at node points.segStrings
- a Collection of NodedSegmentStringsresultEdgelist
- a List which will collect the NodedSegmentStrings representing the substringspublic java.lang.Object getData()
getData
in interface SegmentString
public void setData(java.lang.Object data)
setData
in interface SegmentString
data
- an Object containing user-defined datapublic SegmentNodeList getNodeList()
public int size()
size
in interface SegmentString
public Coordinate getCoordinate(int i)
getCoordinate
in interface SegmentString
public Coordinate[] getCoordinates()
getCoordinates
in interface SegmentString
public boolean isClosed()
isClosed
in interface SegmentString
public int getSegmentOctant(int index)
index
.index
- the index of the vertex starting the segment. Must not be
the last index in the vertex listpublic void addIntersections(LineIntersector li, int segmentIndex, int geomIndex)
public void addIntersection(LineIntersector li, int segmentIndex, int geomIndex, int intIndex)
public void addIntersection(Coordinate intPt, int segmentIndex)
addIntersection
in interface NodableSegmentString
intPt
- the location of the intersectionsegmentIndex
- the index of the segment containing the intersectionpublic SegmentNode addIntersectionNode(Coordinate intPt, int segmentIndex)
intPt
- the location of the intersectionsegmentIndex
- the index of the segment containing the intersectionpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018. All rights reserved.