/// <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. }
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. }
/// <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); } } }