Examples of DirectedEdge


Examples of com.vividsolutions.jts.geomgraph.DirectedEdge

      // direction.
      List<DirectedEdge> directedEdgeList = new LinkedList<DirectedEdge>();
      Iterator<?> it = graph.getEdgeEnds().iterator();
      while (it.hasNext()) {

        DirectedEdge de = (DirectedEdge)it.next();
        if (de.isForward()) {
          directedEdgeList.add(de);
        }
      }

      List<LinkedHashSet<SplitEdge>> allTheRings = new ArrayList<LinkedHashSet<SplitEdge>>();
View Full Code Here

Examples of com.vividsolutions.jts.geomgraph.DirectedEdge

     */
    private void storeHolesRings( List<DirectedEdge> directedEdgeList ) {
          
            for (DirectedEdge de : directedEdgeList) {

                DirectedEdge startEdge = de;
                SplitEdge edge = (SplitEdge) startEdge.getEdge();

                // get one of the holesEdge but calculate the angle seeking
                // which edge is nearest at CCW direction.
                if (!edge.isVisited() && edge.isHoleEdge()) {

View Full Code Here

Examples of com.vividsolutions.jts.geomgraph.DirectedEdge

    List<DirectedEdge> directedEdgeList,
    List<LinkedHashSet<SplitEdge>> edgeList) {

      for (DirectedEdge de : directedEdgeList) {

    DirectedEdge startEdge = de;
    SplitEdge edge = (SplitEdge) startEdge.getEdge();

    // Starts from a shell edge
    if (!edge.isVisited() && edge.isShellEdge()) {
        edgeList.add(builtRing(startEdge,
          CGAlgorithms.COUNTERCLOCKWISE));
View Full Code Here

Examples of com.vividsolutions.jts.geomgraph.DirectedEdge

    List<DirectedEdge> directedEdgeList,
    List<LinkedHashSet<SplitEdge>> edgeList) {

      for (DirectedEdge de : directedEdgeList) {

    DirectedEdge startEdge = de;
    SplitEdge edge = (SplitEdge) startEdge.getEdge();

    // Get one of the intersection edges, and find ring
    if (!edge.isVisited() && edge.isIntersectionEdge()) {

        // check that the edge is only an intersection
View Full Code Here

Examples of com.vividsolutions.jts.geomgraph.DirectedEdge

      List<LinkedHashSet<SplitEdge>> edgeList = new ArrayList<LinkedHashSet<SplitEdge>>();

      // go through the DirectEdge
      for (DirectedEdge de : directedEdgeList) {

    DirectedEdge startEdge = de;
    SplitEdge edge = (SplitEdge) startEdge.getEdge();

    // interior edges must be visited twice, assure all of them
    // were processed 2 times.
    if (!edge.isTwiceVisited() && edge.isIntersectionEdge()) {
View Full Code Here

Examples of com.vividsolutions.jts.geomgraph.DirectedEdge

   * @return A list with a ring of edges.
   */
  private LinkedHashSet<SplitEdge> builtRing(
    final DirectedEdge startEdge, final int direction) {

      DirectedEdge currentDirectedEdge = startEdge;
      DirectedEdge nextDirectedEdge = null;

      LinkedHashSet<SplitEdge> ring = new LinkedHashSet<SplitEdge>();

      while (!edgesAreEqual((SplitEdge) startEdge.getEdge(),
        nextDirectedEdge)) {
    SplitEdge currentEdge = (SplitEdge) currentDirectedEdge
      .getEdge();

    ring.add(currentEdge);

    currentEdge.countVisited();

    DirectedEdge sym = currentDirectedEdge.getSym();
    SplitGraphNode endNode = (SplitGraphNode) sym.getNode();

    SplitEdgeStar nodeEdges = (SplitEdgeStar) endNode.getEdges();

    nextDirectedEdge = nodeEdges.findClosestEdgeInDirection(sym,
      direction);
View Full Code Here

Examples of com.vividsolutions.jts.geomgraph.DirectedEdge

   * @return The correct direction to form the new ring.
   */
  private int testDirection(final DirectedEdge startEdge,
    final int direction) {

      DirectedEdge currentDirectedEdge = startEdge;
      DirectedEdge nextDirectedEdge = null;

      int finalDirection = direction;

      while (!edgesAreEqual((SplitEdge) startEdge.getEdge(),
        nextDirectedEdge)) {

    SplitEdge currentEdge = (SplitEdge) currentDirectedEdge
      .getEdge();

    // if thats true, it means that ring already exist, so return
    // the opposite direction.
    if (currentEdge.isTwiceVisited()) {
        finalDirection = (direction == CGAlgorithms.CLOCKWISE) ? CGAlgorithms.COUNTERCLOCKWISE
          : CGAlgorithms.CLOCKWISE;
        break;
    }
    DirectedEdge sym = currentDirectedEdge.getSym();
    SplitGraphNode endNode = (SplitGraphNode) sym.getNode();

    SplitEdgeStar nodeEdges = (SplitEdgeStar) endNode.getEdges();
    nextDirectedEdge = nodeEdges.findClosestEdgeInDirection(sym,
      direction);

View Full Code Here

Examples of com.vividsolutions.jts.geomgraph.DirectedEdge

    final Coordinate nodeCoord = getCoordinate();
    final List<DirectedEdge> edges = getEdges();
    final List<DirectedEdge> outgoingEdges = new ArrayList<DirectedEdge>(edges.size());

    for (Iterator<DirectedEdge> it = edges.iterator(); it.hasNext();) {
      DirectedEdge edge = (DirectedEdge) it.next();
      if (!nodeCoord.equals2D(edge.getCoordinate())) {
        edge = edge.getSym();
      }
      assert nodeCoord.equals2D(edge.getCoordinate());
      outgoingEdges.add(edge);
    }
    return outgoingEdges;
  }
View Full Code Here

Examples of com.vividsolutions.jts.geomgraph.DirectedEdge

    final Coordinate nodeCoord = getCoordinate();

    assert nodeCoord.equals2D(edge.getCoordinate());

    double acutestAngle = Double.MAX_VALUE;
    DirectedEdge acutest = null;
    DirectedEdge adjacentEdge = null;

    final Coordinate tip1 = edge.getDirectedCoordinate();
    final Coordinate tail = nodeCoord;

    // ensure we're using outgoing edges
    final List<DirectedEdge> outgoingEdges = getOutgoingEdges();
    Iterator<DirectedEdge> it = outgoingEdges.iterator();
    while (it.hasNext()) {
      adjacentEdge = (DirectedEdge) it.next();

      if (adjacentEdge == edge) {
        continue;
      }

      Coordinate tip2 = adjacentEdge.getDirectedCoordinate();

      double angle = computeAngleInDirection(tip1, tail, tip2, searchDirection);

      if (angle < acutestAngle) {
        acutestAngle = angle;
View Full Code Here

Examples of com.vividsolutions.jts.geomgraph.DirectedEdge

  public String toString() {

    StringBuffer sb = new StringBuffer("SplitEdgeStar[degree: "); //$NON-NLS-1$
    sb.append(getDegree()).append(", edges: "); //$NON-NLS-1$
    for (Iterator<?> it = getEdges().iterator(); it.hasNext();) {
      DirectedEdge de = (DirectedEdge) it.next();
      sb.append("DirectedEdge["); //$NON-NLS-1$
      sb.append(de.getEdge()).append(" "); //$NON-NLS-1$
      sb.append("]"); //$NON-NLS-1$
    }
    sb.append("]"); //$NON-NLS-1$
    return sb.toString();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.