com.vividsolutions.jts.geomgraph

Class DirectedEdge

Implemented Interfaces:
Comparable

public class DirectedEdge
extends EdgeEnd

Version:
1.6

Field Summary

protected boolean
isForward

Fields inherited from class com.vividsolutions.jts.geomgraph.EdgeEnd

edge, label

Constructor Summary

DirectedEdge(Edge edge, boolean isForward)

Method Summary

static int
depthFactor(int currLocation, int nextLocation)
Computes the factor for the change in depth when moving from one location to another.
int
getDepth(int position)
int
getDepthDelta()
Edge
getEdge()
EdgeRing
getEdgeRing()
EdgeRing
getMinEdgeRing()
DirectedEdge
getNext()
DirectedEdge
getNextMin()
DirectedEdge
getSym()
Each Edge gives rise to a pair of symmetric DirectedEdges, in opposite directions.
boolean
isForward()
boolean
isInResult()
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.
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
boolean
isVisited()
void
print(PrintStream out)
void
printEdge(PrintStream out)
void
setDepth(int position, int depthVal)
void
setEdgeDepths(int position, int depth)
Set both edge depths.
void
setEdgeRing(EdgeRing edgeRing)
void
setInResult(boolean isInResult)
void
setMinEdgeRing(EdgeRing minEdgeRing)
void
setNext(DirectedEdge next)
void
setNextMin(DirectedEdge nextMin)
void
setSym(DirectedEdge de)
void
setVisited(boolean isVisited)
void
setVisitedEdge(boolean isVisited)
setVisitedEdge marks both DirectedEdges attached to a given Edge.

Methods inherited from class com.vividsolutions.jts.geomgraph.EdgeEnd

compareDirection, compareTo, computeLabel, getCoordinate, getDirectedCoordinate, getDx, getDy, getEdge, getLabel, getNode, getQuadrant, init, print, setNode

Field Details

isForward

protected boolean isForward

Constructor Details

DirectedEdge

public DirectedEdge(Edge edge,
                    boolean isForward)

Method Details

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

getDepth

public int getDepth(int position)

getDepthDelta

public int getDepthDelta()

getEdge

public Edge getEdge()
Overrides:
getEdge in interface EdgeEnd

getEdgeRing

public EdgeRing getEdgeRing()

getMinEdgeRing

public EdgeRing getMinEdgeRing()

getNext

public DirectedEdge getNext()

getNextMin

public DirectedEdge getNextMin()

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()

isInResult

public boolean isInResult()

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

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

isVisited

public boolean isVisited()

print

public void print(PrintStream out)
Overrides:
print in interface EdgeEnd

printEdge

public void printEdge(PrintStream out)

setDepth

public void setDepth(int position,
                     int depthVal)

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.

setEdgeRing

public void setEdgeRing(EdgeRing edgeRing)

setInResult

public void setInResult(boolean isInResult)

setMinEdgeRing

public void setMinEdgeRing(EdgeRing minEdgeRing)

setNext

public void setNext(DirectedEdge next)

setNextMin

public void setNextMin(DirectedEdge nextMin)

setSym

public void setSym(DirectedEdge de)

setVisited

public void setVisited(boolean isVisited)

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.