Esempio n. 1
0
        public bool CreateUnidirectionalEdge(Vertex vA, Vertex vB, EdgeStyleTemplate style = null, string tooltip = "")
        {
            Edge newEdge = new Edge(vA, vB, tooltip);
            newEdge.style = newEdge.style == null ? style : DefaultEdgeStyleTemplate;
            if (vA != null && vB != null) {
                vA.children.Add(vB);
                vA.outgoingEdges.TryAdd(newEdge, newEdge);
                vB.incomingEdges.TryAdd(newEdge, newEdge);

                Line newLine = new Line();
                newLine.Stroke = Cached.BrushLimeGreen;
                newLine.StrokeThickness = 4;
                newLine.Opacity = 0.5;
                elements.Add(newLine);
                newEdge.line = newLine;
                return true;
            }
            return false;
        }
Esempio n. 2
0
 public bool CreateBidirectionalEdge(Vertex vA, Vertex vB, EdgeStyleTemplate style = null, string tooltip = "")
 {
     Edge newEdge = new Edge(vA, vB, tooltip);
     newEdge.style = newEdge.style == null ? style : DefaultEdgeStyleTemplate;
     if (vA != null && vB != null) {
         vA.children.Add(vB);
         vA.outgoingEdges.TryAdd(newEdge, newEdge);
         vB.incomingEdges.TryAdd(newEdge, newEdge);
         vB.outgoingEdges.TryAdd(newEdge, newEdge);
         vA.incomingEdges.TryAdd(newEdge, newEdge);
         return true;
     }
     return false;
 }
Esempio n. 3
0
        /// <summary>
        /// Creates a unidirectional link between two vetices
        /// </summary>
        public bool CreateUnidirectionalEdge(string vA, string vB, EdgeStyleTemplate style = null, string tooltip = "")
        {
            Vertex nA = vertices[vA];
            Vertex nB = vertices[vB];
            Edge newEdge = new Edge(nA, nB, tooltip);
            newEdge.style = newEdge.style == null ? style : DefaultEdgeStyleTemplate;
            nA.children.Add(nB);
            nA.outgoingEdges.TryAdd(newEdge, newEdge);
            nB.incomingEdges.TryAdd(newEdge, newEdge);

            Line newLine = new Line();
            newLine.Stroke = Cached.BrushLimeGreen;
            newLine.StrokeThickness = 4;
            elements.Add(newLine);
            return true;
        }
Esempio n. 4
0
 /// <summary>
 /// Creates a bidirectional link between two vetices
 /// </summary>
 public bool CreateBidirectionalEdge(string vA, string vB, EdgeStyleTemplate style = null, string tooltip = "")
 {
     Vertex nA = vertices[vA];
     Vertex nB = vertices[vB];
     Edge newEdge = new Edge(nA, nB, tooltip);
     newEdge.style = newEdge.style == null ? style : DefaultEdgeStyleTemplate;
     nA.children.Add(nB);
     nA.outgoingEdges.TryAdd(newEdge, newEdge);
     nB.incomingEdges.TryAdd(newEdge, newEdge);
     nB.outgoingEdges.TryAdd(newEdge, newEdge);
     nA.incomingEdges.TryAdd(newEdge, newEdge);
     return true;
 }