Examples of Edge


Examples of org.nexml.model.Edge

      tbNode.setName(label);
    }
   
    Set<Node> xmlParents = xmlTree.getInNodes(xmlNode)
    if ( ! xmlParents.isEmpty() ) { // xmlNode is not topological root
      Edge xmlEdge = xmlTree.getEdge(xmlParents.iterator().next(), xmlNode);
      if ( xmlEdge instanceof FloatEdge ) {
        Double length = ((FloatEdge)xmlEdge).getLength();
        sb.append(':').append(length);
        tbNode.setBranchLength(length);
      }
View Full Code Here

Examples of org.openbel.framework.tools.xgmml.XGMMLObjects.Edge

            XGMMLUtility.writeNode(xNode, supportingTerms, writer);
        }

        // Iterate over all the edges
        for (KamEdge kamEdge : kam.getEdges()) {
            Edge xEdge = new Edge();
            xEdge.id = kamEdge.getId();
            xEdge.rel = kamEdge.getRelationshipType();
            KamNode knsrc = kamEdge.getSourceNode();
            KamNode kntgt = kamEdge.getTargetNode();
            xEdge.source = knsrc.getId();
View Full Code Here

Examples of org.opensphere.geometry.triangulation.model.Edge

      Integer idS = this.coordinates.get(s.p0);
      Integer idD = this.coordinates.get(s.p1);
      Vertex oV = this.vertices.get(idS);
      Vertex eV = this.vertices.get(idD);
     
      Edge edge;
      if (qeBorder.contains(qe)) {
        oV.setBorder(true);
        eV.setBorder(true);
        edge = new Edge(i, s, oV, eV, true);
        if (s.getLength() < this.threshold) {
          this.shortLengths.put(i, edge);
        } else {
          this.lengths.put(i, edge);
        }
      } else {
        edge = new Edge(i, s, oV, eV, false);
      }
      this.edges.put(i, edge);
      this.segments.put(s, i);
      i++;
    }

    // hm of linesegment and hm of edges // with id as key
    // hm of triangles using hm of ls and connection with hm of edges
   
    i = 0;
    for (QuadEdgeTriangle qet : qeTriangles) {
      LineSegment sA = qet.getEdge(0).toLineSegment();
      LineSegment sB = qet.getEdge(1).toLineSegment();
      LineSegment sC = qet.getEdge(2).toLineSegment();
      sA.normalize();
      sB.normalize();
      sC.normalize();
     
      Edge edgeA = this.edges.get(this.segments.get(sA));
      Edge edgeB = this.edges.get(this.segments.get(sB));
      Edge edgeC = this.edges.get(this.segments.get(sC));
      if (edgeA == null || edgeB == null || edgeC == null)
          continue;

      Triangle triangle = new Triangle(i, qet.isBorder()?true:false);
      triangle.addEdge(edgeA);
      triangle.addEdge(edgeB);
      triangle.addEdge(edgeC);

      edgeA.addTriangle(triangle);
      edgeB.addTriangle(triangle);
      edgeC.addTriangle(triangle);

      this.triangles.put(i, triangle);
      i++;
    }

    // add triangle neighbourood
    for (Edge edge : this.edges.values()) {
      if (edge.getTriangles().size() > 1) {
        Triangle tA = edge.getTriangles().get(0);
        Triangle tB = edge.getTriangles().get(1);
        tA.addNeighbour(tB);
        tB.addNeighbour(tA);
      }
    }

   
    // concave hull algorithm
    int index = 0;
    while (index != -1) {
      index = -1;

      Edge e = null;

      // find the max length (smallest id so first entry)
      int si = this.lengths.size();

      if (si != 0) {
        Entry<Integer, Edge> entry = this.lengths.firstEntry();
        int ind = entry.getKey();
        if (entry.getValue().getGeometry().getLength() > this.threshold) {
          index = ind;
          e = entry.getValue();
        }
      }

      if (index != -1) {
        Triangle triangle = e.getTriangles().get(0);
        List<Triangle> neighbours = triangle.getNeighbours();
        // irregular triangle test
        if (neighbours.size() == 1) {
          this.shortLengths.put(e.getId(), e);
          this.lengths.remove(e.getId());
        } else  {
          Edge e0 = triangle.getEdges().get(0);
          Edge e1 = triangle.getEdges().get(1);
          // test if all the vertices are on the border
          if (e0.getOV().isBorder() && e0.getEV().isBorder()
              && e1.getOV().isBorder() && e1.getEV().isBorder()) {
            this.shortLengths.put(e.getId(), e);
            this.lengths.remove(e.getId());
          } else {
            // management of triangles
                  if (neighbours.size() < 1) continue; //not sure this is safe
            Triangle tA = neighbours.get(0);
            Triangle tB = neighbours.get(1);
            tA.setBorder(true); // FIXME not necessarily useful
            tB.setBorder(true); // FIXME not necessarily useful
            this.triangles.remove(triangle.getId());
            tA.removeNeighbour(triangle);
            tB.removeNeighbour(triangle);
           
            // new edges
            List<Edge> ee = triangle.getEdges();
            Edge eA = ee.get(0);
            Edge eB = ee.get(1);
            Edge eC = ee.get(2);
           
            if (eA.isBorder()) {
              this.edges.remove(eA.getId());
              eB.setBorder(true);
              eB.getOV().setBorder(true);
              eB.getEV().setBorder(true);
              eC.setBorder(true);
              eC.getOV().setBorder(true);
              eC.getEV().setBorder(true);

              // clean the relationships with the triangle
              eB.removeTriangle(triangle);
              eC.removeTriangle(triangle);

              if (eB.getGeometry().getLength() < this.threshold) {
                this.shortLengths.put(eB.getId(), eB);
              } else {
                this.lengths.put(eB.getId(), eB);
              }
              if (eC.getGeometry().getLength() < this.threshold) {
                this.shortLengths.put(eC.getId(), eC);
              } else {
                this.lengths.put(eC.getId(), eC);
              }
              this.lengths.remove(eA.getId());
            } else if (eB.isBorder()) {
              this.edges.remove(eB.getId());
              eA.setBorder(true);
              eA.getOV().setBorder(true);
              eA.getEV().setBorder(true);
              eC.setBorder(true);
              eC.getOV().setBorder(true);
              eC.getEV().setBorder(true);

              // clean the relationships with the triangle
              eA.removeTriangle(triangle);
              eC.removeTriangle(triangle);

              if (eA.getGeometry().getLength() < this.threshold) {
                this.shortLengths.put(eA.getId(), eA);
              } else {
                this.lengths.put(eA.getId(), eA);
              }
              if (eC.getGeometry().getLength() < this.threshold) {
                this.shortLengths.put(eC.getId(), eC);
              } else {
                this.lengths.put(eC.getId(), eC);
              }
              this.lengths.remove(eB.getId());
            } else {
              this.edges.remove(eC.getId());
              eA.setBorder(true);
              eA.getOV().setBorder(true);
              eA.getEV().setBorder(true);
              eB.setBorder(true);
              eB.getOV().setBorder(true);
              eB.getEV().setBorder(true);
              // clean the relationships with the triangle
              eA.removeTriangle(triangle);
              eB.removeTriangle(triangle);

              if (eA.getGeometry().getLength() < this.threshold) {
                this.shortLengths.put(eA.getId(), eA);
              } else {
                this.lengths.put(eA.getId(), eA);
              }
              if (eB.getGeometry().getLength() < this.threshold) {
                this.shortLengths.put(eB.getId(), eB);
              } else {
                this.lengths.put(eB.getId(), eB);
              }
              this.lengths.remove(eC.getId());
            }
          }
        }
      }
    }
View Full Code Here

Examples of org.opentripplanner.routing.core.Edge

    if (_pathState.hasTransfers()) {
      TransferPatternService tpService = _context.getTransferPatternService();
      List<TPState> transferStates = _pathState.getTransferStates(tpService);
      for (TPState nextState : transferStates) {
        Edge edge = new TPTransferEdge(_context, _pathState, nextState,
            _departure, _arrival, true);
        edges.add(edge);
      }
    }

    if (_pathState.isExitAllowed()) {
      TPDepartureVertex from = new TPDepartureVertex(_context, _pathState);
      Edge edge = new TPFreeEdge(_context, from, this);
      return Arrays.asList(edge);
    }

    return edges;
  }
View Full Code Here

Examples of org.opentripplanner.routing.graph.Edge

                    // -- get all Edges needed later for the edge representation
                    // and to calculate an edge-based walkshed
                    // Note, it can happen that we get a null geometry here, e.g. for hop-edges!
                    Collection<Edge> vertexEdgesIn = state.getVertex().getIncoming();
                    for (Iterator<Edge> iterator = vertexEdgesIn.iterator(); iterator.hasNext();) {
                        Edge edge = (Edge) iterator.next();
                        Geometry edgeGeom = edge.getGeometry();
                        if (edgeGeom != null) { // make sure we get only real edges
                            if (edgeGeom instanceof LineString) {
                                // allConnectingEdges.add(edge); // instead of this, use a map now, so we don't have similar edge many times
                                connectingEdgesMap.put(new ReversibleLineStringWrapper(
                                        (LineString) edgeGeom), edge);
                            }
                        }
                    }
                    Collection<Edge> vertexEdgesOut = state.getVertex().getOutgoing();
                    for (Iterator<Edge> iterator = vertexEdgesOut.iterator(); iterator.hasNext();) {
                        Edge edge = (Edge) iterator.next();
                        Geometry edgeGeom = edge.getGeometry();
                        if (edgeGeom != null) {
                            if (edgeGeom instanceof LineString) {
                                // allConnectingEdges.add(edge); // instead of this, use a map now, so we don't similar edge many times
                                connectingEdgesMap.put(new ReversibleLineStringWrapper(
                                        (LineString) edgeGeom), edge);
View Full Code Here

Examples of org.patika.mada.graph.Edge

    LinkedList<Edge> tempEdgeList = new LinkedList<Edge>();

    for (Edge edge : edges)
    {
      Edge e = (Edge) graph.getCorrespMember(edge);
      assert e != null;
      tempEdgeList.add(e);
    }
    edges = tempEdgeList;
View Full Code Here

Examples of org.securegraph.Edge

                LumifyProperties.VISIBILITY_JSON.addPropertyValue(resolvedToVertexBuilder, MULTI_VALUE_PROPERTY_KEY, sourceVertexVisibilityJson, metadata, sourceVertex.getVisibility());
                Vertex resolvedToVertex = resolvedToVertexBuilder.save(authorizations);
                getGraph().flush();

                String edgeId = sourceVertex.getId() + "-" + artifactHasEntityIri + "-" + resolvedToVertex.getId();
                Edge resolvedEdge = getGraph().prepareEdge(edgeId, sourceVertex, resolvedToVertex, artifactHasEntityIri, sourceVertex.getVisibility()).save(authorizations);
                LumifyProperties.VISIBILITY_JSON.addPropertyValue(resolvedEdge, MULTI_VALUE_PROPERTY_KEY, sourceVertexVisibilityJson, metadata, sourceVertex.getVisibility(), authorizations);
                VisibilityJson visibilityJson = LumifyProperties.TERM_MENTION_VISIBILITY_JSON.getPropertyValue(termMention);
                if (visibilityJson != null && visibilityJson.getWorkspaces().size() > 0) {
                    Set<String> workspaceIds = visibilityJson.getWorkspaces();
                    for (String workspaceId : workspaceIds) {
View Full Code Here

Examples of org.securegraph.Edge

        if (property == null) {
            throw new RuntimeException("Could not find property: " + propertyName);
        }

        // TODO remove all properties from all edges? I don't think so
        Edge edge = graph.getEdge(edgeId, authorizations);
        Object oldValue = null;
        Property oldProperty = edge.getProperty(propertyKey, propertyName);
        if (oldProperty != null) {
            oldValue = oldProperty.getValue();
        }
        // TODO: replace "" when we implement commenting on ui
        auditRepository.auditRelationshipProperty(AuditAction.DELETE, sourceId, destId, propertyKey, property.getDisplayName(),
                oldValue, null, edge, "", "", user, lumifyVisibility.getVisibility());
        edge.removeProperty(propertyKey, propertyName, authorizations);
        graph.flush();

        workQueueRepository.pushGraphPropertyQueue(edge, null, propertyName, workspaceId, null);

        respondWithSuccessJson(response);
View Full Code Here

Examples of org.tuba.spatschorke.diploma.operation.ecoregmf2oodraw.figures.data.Edge

    }

    for (Object object : gmfDiagram.getEdges()) {
      if (object instanceof org.eclipse.gmf.runtime.notation.Edge) {
        org.eclipse.gmf.runtime.notation.Edge edge = (org.eclipse.gmf.runtime.notation.Edge) object;
        diagram.getEdges().add(new Edge(edge));
      }
    }
    IShapeProvider shapeProvider = new ShapeProvider(diagram);
    return new OODrawRepresentation(shapeProvider);
  }
View Full Code Here

Examples of perestrojka.common.Edge

    ret = new ArrayList<ConversionStep>();
    Vertex predecessor = null;

    Vertex activeVertex = targetVertex;
    while ((predecessor = activeVertex.getPredecessor()) != null) {
      Edge edge = findEdge(predecessor, activeVertex);
      ret.add(0, new ConversionStep(activeVertex.getFormat(), edge.getConversionExtension()));
      activeVertex = predecessor;
    }
   
    // add to cache
    cache.add(sourceFormat, targetFormat, ret);
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.