Package org.locationtech.jts.geomgraph
Class DirectedEdge
- java.lang.Object
-
- org.locationtech.jts.geomgraph.EdgeEnd
-
- org.locationtech.jts.geomgraph.DirectedEdge
-
- All Implemented Interfaces:
java.lang.Comparable
public class DirectedEdge extends EdgeEnd
- Version:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description private int[]depthThe depth of each side (position) of this edge.private EdgeRingedgeRingprotected booleanisForwardprivate booleanisInResultprivate booleanisVisitedprivate EdgeRingminEdgeRingprivate DirectedEdgenextprivate DirectedEdgenextMinprivate DirectedEdgesym
-
Constructor Summary
Constructors Constructor Description DirectedEdge(Edge edge, boolean isForward)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcomputeDirectedLabel()Compute the label in the appropriate orientation for this DirEdgestatic intdepthFactor(int currLocation, int nextLocation)Computes the factor for the change in depth when moving from one location to another.intgetDepth(int position)intgetDepthDelta()EdgegetEdge()EdgeRinggetEdgeRing()EdgeRinggetMinEdgeRing()DirectedEdgegetNext()DirectedEdgegetNextMin()DirectedEdgegetSym()Each Edge gives rise to a pair of symmetric DirectedEdges, in opposite directions.booleanisForward()booleanisInResult()booleanisInteriorAreaEdge()This is an interior Area edge if its label is an Area label for both Geometries and for each Geometry both sides are in the interior.booleanisLineEdge()This edge is a line edge if at least one of the labels is a line label any labels which are not line labels have all Locations = EXTERIORbooleanisVisited()voidprint(java.io.PrintStream out)voidprintEdge(java.io.PrintStream out)voidsetDepth(int position, int depthVal)voidsetEdgeDepths(int position, int depth)Set both edge depths.voidsetEdgeRing(EdgeRing edgeRing)voidsetInResult(boolean isInResult)voidsetMinEdgeRing(EdgeRing minEdgeRing)voidsetNext(DirectedEdge next)voidsetNextMin(DirectedEdge nextMin)voidsetSym(DirectedEdge de)voidsetVisited(boolean isVisited)voidsetVisitedEdge(boolean isVisited)setVisitedEdge marks both DirectedEdges attached to a given Edge.-
Methods inherited from class org.locationtech.jts.geomgraph.EdgeEnd
compareDirection, compareTo, computeLabel, getCoordinate, getDirectedCoordinate, getDx, getDy, getLabel, getNode, getQuadrant, init, setNode, toString
-
-
-
-
Field Detail
-
isForward
protected boolean isForward
-
isInResult
private boolean isInResult
-
isVisited
private boolean isVisited
-
sym
private DirectedEdge sym
-
next
private DirectedEdge next
-
nextMin
private DirectedEdge nextMin
-
edgeRing
private EdgeRing edgeRing
-
minEdgeRing
private EdgeRing minEdgeRing
-
depth
private int[] depth
The depth of each side (position) of this edge. The 0 element of the array is never used.
-
-
Constructor Detail
-
DirectedEdge
public DirectedEdge(Edge edge, boolean isForward)
-
-
Method Detail
-
depthFactor
public static int depthFactor(int currLocation, int nextLocation)Computes the factor for the change in depth when moving from one location to another. E.g. if crossing from the INTERIOR to the EXTERIOR the depth decreases, so the factor is -1
-
setInResult
public void setInResult(boolean isInResult)
-
isInResult
public boolean isInResult()
-
isVisited
public boolean isVisited()
-
setVisited
public void setVisited(boolean isVisited)
-
setEdgeRing
public void setEdgeRing(EdgeRing edgeRing)
-
getEdgeRing
public EdgeRing getEdgeRing()
-
setMinEdgeRing
public void setMinEdgeRing(EdgeRing minEdgeRing)
-
getMinEdgeRing
public EdgeRing getMinEdgeRing()
-
getDepth
public int getDepth(int position)
-
setDepth
public void setDepth(int position, int depthVal)
-
getDepthDelta
public int getDepthDelta()
-
setVisitedEdge
public void setVisitedEdge(boolean isVisited)
setVisitedEdge marks both DirectedEdges attached to a given Edge. This is used for edges corresponding to lines, which will only appear oriented in a single direction in the result.
-
getSym
public DirectedEdge getSym()
Each Edge gives rise to a pair of symmetric DirectedEdges, in opposite directions.- Returns:
- the DirectedEdge for the same Edge but in the opposite direction
-
isForward
public boolean isForward()
-
setSym
public void setSym(DirectedEdge de)
-
getNext
public DirectedEdge getNext()
-
setNext
public void setNext(DirectedEdge next)
-
getNextMin
public DirectedEdge getNextMin()
-
setNextMin
public void setNextMin(DirectedEdge nextMin)
-
isLineEdge
public boolean isLineEdge()
This edge is a line edge if- at least one of the labels is a line label
- any labels which are not line labels have all Locations = EXTERIOR
-
isInteriorAreaEdge
public boolean isInteriorAreaEdge()
This is an interior Area edge if- its label is an Area label for both Geometries
- and for each Geometry both sides are in the interior.
- Returns:
- true if this is an interior Area edge
-
computeDirectedLabel
private void computeDirectedLabel()
Compute the label in the appropriate orientation for this DirEdge
-
setEdgeDepths
public void setEdgeDepths(int position, int depth)Set both edge depths. One depth for a given side is provided. The other is computed depending on the Location transition and the depthDelta of the edge.
-
printEdge
public void printEdge(java.io.PrintStream out)
-
-