コード例 #1
0
ファイル: PlanarGraph.cs プロジェクト: AlvaIce/GFJT-2020
 /// <summary>
 /// Removes an Edge and its associated DirectedEdges from their from-Nodes and
 /// from this PlanarGraph. Notice: This method does not remove the Nodes associated
 /// with the Edge, even if the removal of the Edge reduces the degree of a
 /// Node to zero.
 /// </summary>
 /// <param name="edge"></param>
 public virtual void Remove(Edge edge)
 {
     Remove(edge.GetDirEdge(0));
     Remove(edge.GetDirEdge(1));
     _edges.Remove(edge);
     edge.Remove();
 }
コード例 #2
0
        /// <summary>
        /// Adds an <see cref="Edge" /> to the subgraph.
        /// The associated <see cref="DirectedEdge" />s and <see cref="Node" />s are also added.
        /// </summary>
        /// <param name="e">The <see cref="Edge" /> to add.</param>
        public virtual 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);
        }
コード例 #3
0
ファイル: PlanarGraph.cs プロジェクト: AlvaIce/GFJT-2020
 /// <summary>
 /// Adds the Edge and its DirectedEdges with this PlanarGraph.
 /// Assumes that the Edge has already been created with its associated DirectEdges.
 /// Only subclasses can add Edges, to ensure the edges added are of the right class.
 /// </summary>
 /// <param name="edge"></param>
 protected virtual void Add(Edge edge)
 {
     _edges.Add(edge);
     Add(edge.GetDirEdge(0));
     Add(edge.GetDirEdge(1));
 }
コード例 #4
0
ファイル: Subgraph.cs プロジェクト: hanchao/DotSpatial
        /// <summary>
        /// Adds an <see cref="Edge" /> to the subgraph.
        /// The associated <see cref="DirectedEdge" />s and <see cref="Node" />s are also added.
        /// </summary>
        /// <param name="e">The <see cref="Edge" /> to add.</param>
        public virtual 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);
        }
コード例 #5
0
ファイル: PlanarGraph.cs プロジェクト: ExRam/DotSpatial-PCL
 /// <summary>
 /// Removes an Edge and its associated DirectedEdges from their from-Nodes and
 /// from this PlanarGraph. Notice: This method does not remove the Nodes associated
 /// with the Edge, even if the removal of the Edge reduces the degree of a
 /// Node to zero.
 /// </summary>
 /// <param name="edge"></param>
 public virtual void Remove(Edge edge)
 {
     Remove(edge.GetDirEdge(0));
     Remove(edge.GetDirEdge(1));
     _edges.Remove(edge);
     edge.Remove();
 }
コード例 #6
0
ファイル: PlanarGraph.cs プロジェクト: ExRam/DotSpatial-PCL
 /// <summary>
 /// Adds the Edge and its DirectedEdges with this PlanarGraph.
 /// Assumes that the Edge has already been created with its associated DirectEdges.
 /// Only subclasses can add Edges, to ensure the edges added are of the right class.
 /// </summary>
 /// <param name="edge"></param>
 protected virtual void Add(Edge edge)
 {
     _edges.Add(edge);
     Add(edge.GetDirEdge(0));
     Add(edge.GetDirEdge(1));
 }