コード例 #1
0
ファイル: Subgraph.cs プロジェクト: spacefan/iGeospatial
        /// <summary> Adds an {@link Edge} to the subgraph.
        /// The associated {@link DirectedEdge}s and {@link Node}s
        /// are also added.
        ///
        /// </summary>
        /// <param name="e">the edge to add
        /// </param>
        public void Add(Edge e)
        {
            if (edges.Contains(e))
            {
                return;
            }

            edges.Add(e);
            dirEdges.Add(e.GetDirEdge(0));
            dirEdges.Add(e.GetDirEdge(1));
            nodeMap.Add(e.GetDirEdge(0).FromNode);
            nodeMap.Add(e.GetDirEdge(1).FromNode);
        }
コード例 #2
0
ファイル: PlanarGraph.cs プロジェクト: spacefan/iGeospatial
 /// <summary>
 /// Adds a node to the map, replacing any that is already at that location.
 /// Only subclasses can Add Nodes, to ensure Nodes are of the right type.
 /// </summary>
 /// <returns> The added node.</returns>
 protected void Add(Node node)
 {
     nodeMap.Add(node);
 }