コード例 #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, segString);
     if (existing == null)
         Add(oca, segString);            
     else
     {
         if (merger != null)
         {
             bool isSameOrientation = CoordinateArrays.Equals(existing.Coordinates, segString.Coordinates);
             merger.Merge(existing, segString, isSameOrientation);
         }
     }
 }
コード例 #2
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, segString);

            if (existing == null)
            {
                Add(oca, segString);
            }
            else
            {
                if (merger != null)
                {
                    bool isSameOrientation = CoordinateArrays.Equals(existing.Coordinates, segString.Coordinates);
                    merger.Merge(existing, segString, isSameOrientation);
                }
            }
        }
コード例 #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="oca"></param>
 /// <param name="segString"></param>
 private void Add(OrientedCoordinateArray oca, SegmentString segString)
 {
     ocaMap.Add(oca, segString);
 }
コード例 #4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="oca"></param>
 /// <param name="segString"></param>
 /// <returns></returns>
 private SegmentString FindMatching(OrientedCoordinateArray oca, SegmentString segString)
 {
     return (SegmentString)ocaMap[oca];            
 }        
コード例 #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="oca"></param>
 /// <param name="segString"></param>
 private void Add(OrientedCoordinateArray oca, SegmentString segString)
 {
     ocaMap.Add(oca, segString);
 }
コード例 #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="oca"></param>
 /// <param name="segString"></param>
 /// <returns></returns>
 private SegmentString FindMatching(OrientedCoordinateArray oca, SegmentString segString)
 {
     return((SegmentString)ocaMap[oca]);
 }
コード例 #7
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));
        }