Пример #1
0
        ///// <summary>
        /////
        ///// </summary>
        ///// <param name="oca"></param>
        /*/// <param name="segString"></param>*/
        /// <returns></returns>
        private ISegmentString FindMatching(OrientedCoordinateArray oca /*, ISegmentString segString*/)
        {
            ISegmentString ret;

            if (_ocaMap.TryGetValue(oca, out ret))
            {
                return(ret);
            }
            return(null);
        }
Пример #2
0
        /// <summary>
        /// Dissolve the given <see cref="ISegmentString" />.
        /// </summary>
        /// <param name="segString"></param>
        public void Dissolve(ISegmentString segString)
        {
            OrientedCoordinateArray oca      = new OrientedCoordinateArray(segString.Coordinates);
            ISegmentString          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>
        /// Compares two <see cref="OrientedCoordinateArray" />s for their relative order.
        /// </summary>
        /// <param name="o1"></param>
        /// <returns>
        /// -1 this one is smaller;<br/>
        ///  0 the two objects are equal;<br/>
        ///  1 this one is greater.
        /// </returns>
        public int CompareTo(object o1)
        {
            OrientedCoordinateArray oca = (OrientedCoordinateArray)o1;

            return(CompareOriented(_pts, _orientation, oca._pts, oca._orientation));
        }
Пример #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="oca"></param>
 /// <param name="segString"></param>
 private void Add(OrientedCoordinateArray oca, ISegmentString segString)
 {
     _ocaMap.Add(oca, segString);
 }