Examples of DirectedEdge


Examples of com.vividsolutions.jts.planargraph.DirectedEdge

    Coordinate[] coordinates = CoordinateArrays.removeRepeatedPoints(lineString.getCoordinates());
    Coordinate startCoordinate = coordinates[0];
    Coordinate endCoordinate = coordinates[coordinates.length - 1];
    Node startNode = getNode(startCoordinate);
    Node endNode = getNode(endCoordinate);
    DirectedEdge directedEdge0 = new LineMergeDirectedEdge(startNode, endNode,
        coordinates[1], true);
    DirectedEdge directedEdge1 = new LineMergeDirectedEdge(endNode, startNode,
        coordinates[coordinates.length - 2], false);
    Edge edge = new LineMergeEdge(lineString);
    edge.setDirectedEdges(directedEdge0, directedEdge1);
    add(edge);
  }
View Full Code Here

Examples of com.vividsolutions.jts.planargraph.DirectedEdge

   
    Coordinate startCoordinate = coordinates[0];
    Coordinate endCoordinate = coordinates[coordinates.length - 1];
    Node startNode = getNode(startCoordinate);
    Node endNode = getNode(endCoordinate);
    DirectedEdge directedEdge0 = new LineMergeDirectedEdge(startNode, endNode,
        coordinates[1], true);
    DirectedEdge directedEdge1 = new LineMergeDirectedEdge(endNode, startNode,
        coordinates[coordinates.length - 2], false);
    Edge edge = new LineMergeEdge(lineString);
    edge.setDirectedEdges(directedEdge0, directedEdge1);
    add(edge);
  }
View Full Code Here

Examples of com.vividsolutions.jts.planargraph.DirectedEdge

    assertTrue(! algorithms.isOnLine(new Coordinate(30,10),
          new Coordinate[] {new Coordinate(0,10), new Coordinate(20,10)}));
  }

  public void testDirectedEdgeComparator() {
    DirectedEdge d1 = new DirectedEdge(new Node(new Coordinate(0, 0)),
        new Node(new Coordinate(10, 10)), new Coordinate(10, 10), true);
    DirectedEdge d2 = new DirectedEdge(new Node(new Coordinate(0, 0)),
        new Node(new Coordinate(20, 20)), new Coordinate(20, 20), false);
    assertEquals(0, d2.compareTo(d1));
  }
View Full Code Here

Examples of com.vividsolutions.jts.planargraph.DirectedEdge

        new Node(new Coordinate(20, 20)), new Coordinate(20, 20), false);
    assertEquals(0, d2.compareTo(d1));
  }

  public void testDirectedEdgeToEdges() {
    DirectedEdge d1 = new DirectedEdge(new Node(new Coordinate(0, 0)),
        new Node(new Coordinate(10, 10)), new Coordinate(10, 10), true);
    DirectedEdge d2 = new DirectedEdge(new Node(new Coordinate(20, 0)),
        new Node(new Coordinate(20, 10)), new Coordinate(20, 10), false);
    List edges = DirectedEdge.toEdges(Arrays.asList(new Object[]{d1, d2}));
    assertEquals(2, edges.size());
    assertNull(edges.get(0));
    assertNull(edges.get(1));
View Full Code Here

Examples of de.timefinder.algo.graph.DirectedEdge

            }
        }
    }

    private OrderRelation newDirectedEdge(String s) {
        return new DirectedEdge(s);
    }
View Full Code Here

Examples of edu.uci.ics.jung.graph.DirectedEdge

        }
        Resource target = currentRelations.getProperty(KNOBOT.target)
            .getResource();
        Vertex targetVertex = (Vertex) vertexTopic.get(target);
        if (targetVertex != null) {
          DirectedEdge e = (DirectedEdge) g
              .addEdge(new DirectedSparseEdge(
                  (Vertex) vertexTopic.get(currentSource),
                  targetVertex));
        } else {
          //is an item

          Vertex vertex;
          vertex = (Vertex) allTopicsAndItems.get(target);
          if (vertex == null) {
            vertex = (Vertex) g
                .addVertex(new DirectedSparseVertex());
            vertex.addUserDatum("label", target.getURI(),
                UserData.SHARED);
            allTopicsAndItems.put(target, vertex);
          }
          DirectedEdge e = (DirectedEdge) g
              .addEdge(new DirectedSparseEdge(
                  (Vertex) vertexTopic.get(currentSource),
                  vertex));
        }
      }
View Full Code Here

Examples of graph.model.directed.DirectedEdge

            vertices.add(v);
        }

        int i = 0;
        for (List<Integer> line : input) {
            Edge edge = new DirectedEdge(i++ ,vertices.get(line.get(0) - 1), vertices.get(line.get(1) - 1), line.get(2), line.get(3));
            edges.add(edge);
        }

        graph.addVertices(vertices);
        graph.addEdges(edges);
View Full Code Here

Examples of org.geotools.geometry.iso.topograph2D.DirectedEdge

   * of dimensional collapses. They do not form part of the result area
   * boundary.
   */
  private void findResultAreaEdges(int opCode) {
    for (Iterator it = graph.getEdgeEnds().iterator(); it.hasNext();) {
      DirectedEdge de = (DirectedEdge) it.next();
      // mark all dirEdges with the appropriate label
      Label label = de.getLabel();
      if (label.isArea()
          && !de.isInteriorAreaEdge()
          && isResultOfOp(label.getLocation(0, Position.RIGHT), label
              .getLocation(1, Position.RIGHT), opCode)) {
        de.setInResult(true);
        // Debug.print("in result "); Debug.println(de);
      }
    }
  }
View Full Code Here

Examples of org.geotools.geometry.iso.topograph2D.DirectedEdge

   */
  private void cancelDuplicateResultEdges() {
    // remove any dirEdges whose sym is also included
    // (they "cancel each other out")
    for (Iterator it = graph.getEdgeEnds().iterator(); it.hasNext();) {
      DirectedEdge de = (DirectedEdge) it.next();
      DirectedEdge sym = de.getSym();
      if (de.isInResult() && sym.isInResult()) {
        de.setInResult(false);
        sym.setInResult(false);
        // Debug.print("cancelled "); Debug.println(de);
        // Debug.println(sym);
      }
    }
  }
View Full Code Here

Examples of org.geotools.geometry.iso.topograph2D.DirectedEdge

    /**
     * For all L edges which weren't handled by the above, use a
     * point-in-poly test to determine whether they are covered
     */
    for (Iterator it = op.getGraph().getEdgeEnds().iterator(); it.hasNext();) {
      DirectedEdge de = (DirectedEdge) it.next();
      Edge e = de.getEdge();
      if (de.isLineEdge() && !e.isCoveredSet()) {
        boolean isCovered = op.isCoveredByA(de.getCoordinate());
        e.setCovered(isCovered);
      }
    }
  }
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.