Inheritance: GraphData
 public Edge(string iId, Node iSource, Node iTarget, EdgeData iData)
 {
     ID       = iId;
     Source   = iSource;
     Target   = iTarget;
     Data     = (iData != null) ? iData : new EdgeData();
     Directed = false;
 }
Exemple #2
0
 public Edge(string iId, Node iSource, Node iTarget, EdgeData iData)
 {
     ID = iId;
     Source = iSource;
     Target = iTarget;
     Data = (iData != null) ? iData : new EdgeData();
     Directed = false;
 }
        public Edge CreateEdge(Node iSource, Node iTarget, EdgeData iData = null)
        {
            if (iSource == null || iTarget == null)
            {
                return(null);
            }

            Edge tNewEdge = new Edge(m_nextEdgeId.ToString(), iSource, iTarget, iData);

            m_nextEdgeId++;
            AddEdge(tNewEdge);
            return(tNewEdge);
        }
Exemple #4
0
        public IEdge CreateEdge(INode iSource, INode iTarget, EdgeData iData = null)
        {
            if (iSource == null || iTarget == null)
            {
                return(null);
            }

            var tNewEdge = mCreator.CreateEdge(m_nextEdgeId.ToString(), iSource, iTarget, iData);

            m_nextEdgeId++;
            AddEdge(tNewEdge);

            return(tNewEdge);
        }
        public Edge CreateEdge(string iSource, string iTarget, EdgeData iData = null)
        {
            if (!m_nodeSet.ContainsKey(iSource))
            {
                return(null);
            }
            if (!m_nodeSet.ContainsKey(iTarget))
            {
                return(null);
            }
            Node node1 = m_nodeSet[iSource];
            Node node2 = m_nodeSet[iTarget];

            return(CreateEdge(node1, node2, iData));
        }
        private bool addEdge(string nodeName1, string nodeName2)
        {
            nodeName1 = nodeName1.Trim();
            nodeName2 = nodeName2.Trim();
            if (nodeName1 == nodeName2)
            {
                return false;
            }
            Node node1 = m_fdgGraph.GetNode(nodeName1);
            Node node2 = m_fdgGraph.GetNode(nodeName2);
            EdgeData data = new EdgeData();

            string label = nodeName1 + "-" + nodeName2;
            data.label = label;
            data.length = 60.0f;

            Edge newEdge = m_fdgGraph.CreateEdge(node1, node2, data);
            m_fdgLines[newEdge] = new GridLine(0, 0, 0, 0);

            lbEdge.Items.Add(label);
            return true;
        }
Exemple #7
0
 public Edge CreateEdge(string iSource, string iTarget, EdgeData iData = null)
 {
     if (!m_nodeSet.ContainsKey(iSource))
         return null;
     if (!m_nodeSet.ContainsKey(iTarget))
         return null;
     Node node1 = m_nodeSet[iSource];
     Node node2 = m_nodeSet[iTarget];
     return CreateEdge(node1, node2, iData);
 }
Exemple #8
0
        public Edge CreateEdge(Node iSource, Node iTarget, EdgeData iData = null)
        {
            if (iSource == null || iTarget == null)
                return null;

            Edge tNewEdge = new Edge(m_nextEdgeId.ToString(), iSource, iTarget, iData);
            m_nextEdgeId++;
            AddEdge(tNewEdge);
            return tNewEdge;
        }