Exemplo n.º 1
0
        /// <summary>
        /// Returns the points along the polyline using the first and last M values of the source.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="other">The other.</param>
        /// <returns>
        /// Returns a <see cref="IEnumerable{IPoint}" /> representing the points along the other polyline.
        /// </returns>
        public static IEnumerable <IPoint> GetPointsAtMs(this IPolyline source, IPolyline other)
        {
            var            points       = ((IMSegmentation3)source).GetPointsAtMs();
            IMSegmentation segmentation = (IMSegmentation)other;

            foreach (var point in points)
            {
                var ms = other.GetMsAtPoint(point);
                if (ms != null && ms.Any())
                {
                    foreach (var m in ms)
                    {
                        var collection = segmentation.GetPointsAtM(m, 0);
                        foreach (var geometry in collection.AsEnumerable())
                        {
                            yield return(geometry as IPoint);
                        }
                    }
                }
            }
        }