Package org.meteoinfo.jts.geomgraph
Class Edge
- java.lang.Object
-
- org.meteoinfo.jts.geomgraph.GraphComponent
-
- org.meteoinfo.jts.geomgraph.Edge
-
public class Edge extends GraphComponent
-
-
Field Summary
-
Fields inherited from class org.meteoinfo.jts.geomgraph.GraphComponent
label
-
-
Constructor Summary
Constructors Constructor Description Edge(Coordinate[] pts)Edge(Coordinate[] pts, Label label)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIntersection(LineIntersector li, int segmentIndex, int geomIndex, int intIndex)Add an EdgeIntersection for intersection intIndex.voidaddIntersections(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.voidcomputeIM(IntersectionMatrix im)Update the IM with the contribution for this component.booleanequals(java.lang.Object o)equals is defined to be:EdgegetCollapsedEdge()CoordinategetCoordinate()CoordinategetCoordinate(int i)Coordinate[]getCoordinates()DepthgetDepth()intgetDepthDelta()The depthDelta is the change in depth as an edge is crossed from R to LEdgeIntersectionListgetEdgeIntersectionList()EnvelopegetEnvelope()intgetMaximumSegmentIndex()MonotoneChainEdgegetMonotoneChainEdge()intgetNumPoints()booleanisClosed()booleanisCollapsed()An Edge is collapsed if it is an Area edge and it consists of two segments which are equal and opposite (eg a zero-width V).booleanisIsolated()An isolated component is one that does not intersect or touch any other component.booleanisPointwiseEqual(Edge e)voidprint(java.io.PrintStream out)voidprintReverse(java.io.PrintStream out)voidsetDepthDelta(int depthDelta)voidsetIsolated(boolean isIsolated)voidsetName(java.lang.String name)java.lang.StringtoString()static voidupdateIM(Label label, IntersectionMatrix im)Updates an IM from the label for an edge.-
Methods inherited from class org.meteoinfo.jts.geomgraph.GraphComponent
getLabel, isCovered, isCoveredSet, isInResult, isVisited, setCovered, setInResult, setLabel, setVisited, updateIM
-
-
-
-
Constructor Detail
-
Edge
public Edge(Coordinate[] pts, Label label)
-
Edge
public Edge(Coordinate[] pts)
-
-
Method Detail
-
updateIM
public static void updateIM(Label label, IntersectionMatrix im)
Updates an IM from the label for an edge. Handles edges from both L and A geometries.
-
getNumPoints
public int getNumPoints()
-
setName
public void setName(java.lang.String name)
-
getCoordinates
public Coordinate[] getCoordinates()
-
getCoordinate
public Coordinate getCoordinate(int i)
-
getCoordinate
public Coordinate getCoordinate()
- Specified by:
getCoordinatein classGraphComponent- Returns:
- a coordinate in this component (or null, if there are none)
-
getEnvelope
public Envelope getEnvelope()
-
getDepth
public Depth getDepth()
-
getDepthDelta
public int getDepthDelta()
The depthDelta is the change in depth as an edge is crossed from R to L- Returns:
- the change in depth as the edge is crossed from R to L
-
setDepthDelta
public void setDepthDelta(int depthDelta)
-
getMaximumSegmentIndex
public int getMaximumSegmentIndex()
-
getEdgeIntersectionList
public EdgeIntersectionList getEdgeIntersectionList()
-
getMonotoneChainEdge
public MonotoneChainEdge getMonotoneChainEdge()
-
isClosed
public boolean isClosed()
-
isCollapsed
public boolean isCollapsed()
An Edge is collapsed if it is an Area edge and it consists of two segments which are equal and opposite (eg a zero-width V).
-
getCollapsedEdge
public Edge getCollapsedEdge()
-
setIsolated
public void setIsolated(boolean isIsolated)
-
isIsolated
public boolean isIsolated()
Description copied from class:GraphComponentAn isolated component is one that does not intersect or touch any other component. This is the case if the label has valid locations for only a single Geometry.- Specified by:
isIsolatedin classGraphComponent- Returns:
- true if this component is isolated
-
addIntersections
public 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.
-
addIntersection
public void addIntersection(LineIntersector li, int segmentIndex, int geomIndex, int intIndex)
Add an EdgeIntersection for intersection intIndex. An intersection that falls exactly on a vertex of the edge is normalized to use the higher of the two possible segmentIndexes
-
computeIM
public void computeIM(IntersectionMatrix im)
Update the IM with the contribution for this component. A component only contributes if it has a labelling for both parent geometries- Specified by:
computeIMin classGraphComponent
-
equals
public boolean equals(java.lang.Object o)
equals is defined to be:e1 equals e2 iff the coordinates of e1 are the same or the reverse of the coordinates in e2
- Overrides:
equalsin classjava.lang.Object
-
isPointwiseEqual
public boolean isPointwiseEqual(Edge e)
- Returns:
- true if the coordinate sequences of the Edges are identical
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
print
public void print(java.io.PrintStream out)
-
printReverse
public void printReverse(java.io.PrintStream out)
-
-