Ejemplo n.º 1
0
 /// <summary>
 /// Returns the DirectedEdge on the left-hand side of the given DirectedEdge (which
 /// must be a member of this DirectedEdgeStar).
 /// </summary>
 /// <param name="dirEdge"></param>
 /// <returns></returns>
 public virtual DirectedEdge GetNextEdge(DirectedEdge dirEdge)
 {
     int i = GetIndex(dirEdge);
     return (DirectedEdge)_outEdges[GetIndex(i + 1)];
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds a new member to this DirectedEdgeStar.
 /// </summary>
 /// <param name="de"></param>
 public virtual void Add(DirectedEdge de)
 {
     _outEdges.Add(de);
     _sorted = false;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Drops a member of this DirectedEdgeStar.
 /// </summary>
 /// <param name="de"></param>
 public virtual void Remove(DirectedEdge de)
 {
     _outEdges.Remove(de);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Returns the zero-based index of the given DirectedEdge, after sorting in ascending order
 /// by angle with the positive x-axis.
 /// </summary>
 /// <param name="dirEdge"></param>
 /// <returns></returns>
 public virtual int GetIndex(DirectedEdge dirEdge)
 {
     SortEdges();
     for (int i = 0; i < _outEdges.Count; i++)
     {
         DirectedEdge de = (DirectedEdge)_outEdges[i];
         if (de == dirEdge)
             return i;
     }
     return -1;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Adds an outgoing DirectedEdge to this Node.
 /// </summary>
 /// <param name="de"></param>
 public virtual void AddOutEdge(DirectedEdge de)
 {
     DeStar.Add(de);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Adds a DirectedEdge which is known to form part of this ring.
 /// </summary>
 /// <param name="de">The DirectedEdge to add.</param>
 public virtual void Add(DirectedEdge de)
 {
     _deList.Add(de);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Adds the Edge to this PlanarGraph; only subclasses can add DirectedEdges,
 /// to ensure the edges added are of the right class.
 /// </summary>
 /// <param name="dirEdge"></param>
 protected virtual void Add(DirectedEdge dirEdge)
 {
     _dirEdges.Add(dirEdge);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Removes DirectedEdge from its from-Node and from this PlanarGraph. Notice:
 /// This method does not remove the Nodes associated with the DirectedEdge,
 /// even if the removal of the DirectedEdge reduces the degree of a Node to
 /// zero.
 /// </summary>
 /// <param name="de"></param>
 public virtual void Remove(DirectedEdge de)
 {
     DirectedEdge sym = de.Sym;
     if (sym != null)
         sym.Sym = null;
     de.FromNode.OutEdges.Remove(de);
     de.Remove();
     _dirEdges.Remove(de);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Adds an outgoing DirectedEdge to this Node.
 /// </summary>
 /// <param name="de"></param>
 public virtual void AddOutEdge(DirectedEdge de)
 {
     DeStar.Add(de);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Adds a new member to this DirectedEdgeStar.
 /// </summary>
 /// <param name="de"></param>
 public virtual void Add(DirectedEdge de)
 {
     _outEdges.Add(de);
     _sorted = false;
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Returns the DirectedEdge on the left-hand side of the given DirectedEdge (which
        /// must be a member of this DirectedEdgeStar).
        /// </summary>
        /// <param name="dirEdge"></param>
        /// <returns></returns>
        public virtual DirectedEdge GetNextEdge(DirectedEdge dirEdge)
        {
            int i = GetIndex(dirEdge);

            return((DirectedEdge)_outEdges[GetIndex(i + 1)]);
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Drops a member of this DirectedEdgeStar.
 /// </summary>
 /// <param name="de"></param>
 public virtual void Remove(DirectedEdge de)
 {
     _outEdges.Remove(de);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Adds the Edge to this PlanarGraph; only subclasses can add DirectedEdges,
 /// to ensure the edges added are of the right class.
 /// </summary>
 /// <param name="dirEdge"></param>
 protected virtual void Add(DirectedEdge dirEdge)
 {
     _dirEdges.Add(dirEdge);
 }