/// <summary> /// Dissolve the given <see cref="SegmentString" />. /// </summary> /// <param name="segString"></param> public void Dissolve(SegmentString segString) { OrientedCoordinateArray oca = new OrientedCoordinateArray(segString.Coordinates); SegmentString existing = FindMatching(oca, segString); if (existing == null) Add(oca, segString); else { if (merger != null) { bool isSameOrientation = CoordinateArrays.Equals(existing.Coordinates, segString.Coordinates); merger.Merge(existing, segString, isSameOrientation); } } }
/// <summary> /// Dissolve the given <see cref="SegmentString" />. /// </summary> /// <param name="segString"></param> public void Dissolve(SegmentString segString) { OrientedCoordinateArray oca = new OrientedCoordinateArray(segString.Coordinates); SegmentString existing = FindMatching(oca, segString); if (existing == null) { Add(oca, segString); } else { if (merger != null) { bool isSameOrientation = CoordinateArrays.Equals(existing.Coordinates, segString.Coordinates); merger.Merge(existing, segString, isSameOrientation); } } }
/// <summary> /// /// </summary> /// <param name="oca"></param> /// <param name="segString"></param> private void Add(OrientedCoordinateArray oca, SegmentString segString) { ocaMap.Add(oca, segString); }
/// <summary> /// /// </summary> /// <param name="oca"></param> /// <param name="segString"></param> /// <returns></returns> private SegmentString FindMatching(OrientedCoordinateArray oca, SegmentString segString) { return (SegmentString)ocaMap[oca]; }
/// <summary> /// /// </summary> /// <param name="oca"></param> /// <param name="segString"></param> /// <returns></returns> private SegmentString FindMatching(OrientedCoordinateArray oca, SegmentString segString) { return((SegmentString)ocaMap[oca]); }
/// <summary> /// Compares two <see cref="OrientedCoordinateArray" />s for their relative order. /// </summary> /// <param name="o1"></param> /// <returns> /// -1 this one is smaller, or /// 0 the two objects are equal, or /// 1 this one is greater. /// </returns> public int CompareTo(object o1) { OrientedCoordinateArray oca = (OrientedCoordinateArray)o1; return(CompareOriented(pts, orientation, oca.pts, oca.orientation)); }