Esempio n. 1
0
        /// <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);

            if (existing == null)
            {
                Add(oca, segString);
            }
            else
            {
                if (_merger != null)
                {
                    bool isSameOrientation = Equals(existing.Coordinates, segString.Coordinates);
                    _merger.Merge(existing, segString, isSameOrientation);
                }
            }
        }
Esempio n. 2
0
 /// <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);
 }
 /// <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);
     if (existing == null)
         Add(oca, segString);
     else
     {
         if (_merger != null)
         {
             bool isSameOrientation = 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>
 /// <returns></returns>
 private SegmentString FindMatching(OrientedCoordinateArray oca)
 {
     return (SegmentString)_ocaMap[oca];
 }
Esempio n. 6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="oca"></param>
 /// <param name="segString"></param>
 private void Add(OrientedCoordinateArray oca, SegmentString segString)
 {
     _ocaMap.Add(oca, segString);
 }
Esempio n. 7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="oca"></param>
 /// <returns></returns>
 private SegmentString FindMatching(OrientedCoordinateArray oca)
 {
     return((SegmentString)_ocaMap[oca]);
 }