示例#1
0
文件: Edge.cs 项目: vmoll/geotools
 /// <summary>
 /// Constructs a new edge using the coordinates collection and supplied label object.
 /// </summary>
 /// <param name="pts"></param>
 /// <param name="label"></param>
 public Edge(Coordinates pts, Label label)
 {
     _eiList = new EdgeIntersectionList( this );
     _pts = pts;
     _label = label;		// inherited member variable.
 }
示例#2
0
        private int _depthDelta  = 0;          // the change in area depth from the R to L side of this edge

        #region Constructors
        /// <summary>
        /// Constructs a new edge using the coordinates collection and supplied label object.
        /// </summary>
        /// <param name="pts"></param>
        /// <param name="label"></param>
        public Edge(Coordinates pts, Label label)
        {
            _eiList = new EdgeIntersectionList(this);
            _pts    = pts;
            _label  = label;                    // inherited member variable.
        }
示例#3
0
		/// <summary>
		/// Check that a ring does not self-intersect, except at its endpoints.
		/// Algorithm is to count the number of times each node along edge occurs.
		/// If any occur more than once, that must be a self-intersection.
		/// </summary>
		/// <param name="eiList"></param>
		private void CheckSelfIntersectingRing(EdgeIntersectionList eiList)
		{
			
			//Set nodeSet = new TreeSet(); awc  don't need sorted list, just a hashtable
			Hashtable nodeSet = new Hashtable();
			bool isFirst = true;
			//for (Iterator i = eiList.iterator(); i.hasNext(); ) 
			foreach(EdgeIntersection ei in eiList)
			{
				//EdgeIntersection ei = (EdgeIntersection) i.next();
				if (isFirst) 
				{
					isFirst = false;
					continue;
				}
				if (nodeSet.Contains(ei.Coordinate)) 
				{
					_validErr = new TopologyValidationError(
						TopologyValidationError.RingSelfIntersection,
						ei.Coordinate);
					return;
				}
				else 
				{
					//TODO: awc - should probably use hashcode
					nodeSet.Add(ei.Coordinate, ei.Coordinate);
				}
			}
		}