Esempio n. 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="eSearch"></param>
 /// <returns></returns>
 public int FindIndex(EdgeEnd eSearch)
 {
     GetEnumerator();   // force edgelist to be computed
     for (int i = 0; i < edgeList.Count; i++)
     {
         EdgeEnd e = edgeList[i];
         if (e == eSearch)
         {
             return(i);
         }
     }
     return(-1);
 }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ee"></param>
        /// <returns></returns>
        public EdgeEnd GetNextCW(EdgeEnd ee)
        {
            IList <EdgeEnd> temp = Edges;

            temp = null;    // Hack for calling property
            int i       = edgeList.IndexOf(ee);
            int iNextCW = i - 1;

            if (i == 0)
            {
                iNextCW = edgeList.Count - 1;
            }
            return(edgeList[iNextCW]);
        }
Esempio n. 3
0
        /// <summary>
        /// Compute the labelling for all dirEdges in this star, as well
        /// as the overall labelling.
        /// </summary>
        /// <param name="geom"></param>
        public override void ComputeLabelling(GeometryGraph[] geom)
        {
            base.ComputeLabelling(geom);

            // determine the overall labelling for this DirectedEdgeStar
            // (i.e. for the node it is based at)
            _label = new Label(Location.Null);
            IEnumerator <EdgeEnd> it = GetEnumerator();

            while (it.MoveNext())
            {
                EdgeEnd ee     = it.Current;
                Edge    e      = ee.Edge;
                Label   eLabel = e.Label;
                for (int i = 0; i < 2; i++)
                {
                    Location eLoc = eLabel.GetLocation(i);
                    if (eLoc == Location.Interior || eLoc == Location.Boundary)
                    {
                        _label.SetLocation(i, Location.Interior);
                    }
                }
            }
        }
Esempio n. 4
0
        /*
         * /// <summary>
         * ///
         * /// </summary>
         * public DirectedEdgeStar() { }
         */

        /// <summary>
        /// Insert a directed edge in the list.
        /// </summary>
        /// <param name="ee"></param>
        public override void Insert(EdgeEnd ee)
        {
            DirectedEdge de = (DirectedEdge)ee;

            InsertEdgeEnd(de, de);
        }
Esempio n. 5
0
 /// <summary>
 /// Insert an EdgeEnd into the map, and clear the edgeList cache,
 /// since the list of edges has now changed.
 /// </summary>
 /// <param name="e"></param>
 /// <param name="obj"></param>
 protected void InsertEdgeEnd(EdgeEnd e, EdgeEnd obj)
 {
     edgeMap[e] = obj;
     edgeList   = null;  // edge list has changed - clear the cache
 }
Esempio n. 6
0
 /*
  * /// <summary>
  * ///
  * /// </summary>
  * protected EdgeEndStar() { }
  */
 /// <summary>
 /// Insert a EdgeEnd into this EdgeEndStar.
 /// </summary>
 /// <param name="e"></param>
 abstract public void Insert(EdgeEnd e);
Esempio n. 7
0
 /// <summary>
 /// Add the edge to the list of edges at this node.
 /// </summary>
 /// <param name="e"></param>
 public void Add(EdgeEnd e)
 {
     // Assert: start pt of e is equal to node point
     _edges.Insert(e);
     e.Node = this;
 }
Esempio n. 8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="e"></param>
 public void Add(EdgeEnd e)
 {
     _nodes.Add(e);
     edgeEndList.Add(e);
 }