GetPoints() публичный Метод

public GetPoints ( ) : IEnumerable
Результат IEnumerable
Пример #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="path"></param>
        /// <param name="v"></param>
        /// <param name="threshold"></param>
        /// <param name="dx"></param>
        /// <param name="dy"></param>
        /// <returns></returns>
        public static BaseShape HitTestPath(XPath path, Vector2 v, double threshold, double dx, double dy)
        {
            if (path.Geometry != null)
            {
                var points = path.GetPoints().ToImmutableArray();
                foreach (var point in points)
                {
                    if (ShapeBounds.GetPointBounds(point, threshold, dx, dy).Contains(v))
                    {
                        return point;
                    }
                }

                if (ShapeBounds.Contains(points, v, dx, dy))
                {
                    return path;
                }
            }

            return null;
        }
Пример #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="path"></param>
        /// <param name="selection"></param>
        /// <param name="selected"></param>
        /// <param name="dx"></param>
        /// <param name="dy"></param>
        /// <returns></returns>
        public static bool HitTestPath(XPath path, Vector2[] selection, ISet<BaseShape> selected, double dx, double dy)
        {
            if (path.Geometry != null)
            {
                var points = path.GetPoints().ToImmutableArray();
                if (ShapeBounds.Overlap(selection, points, dx, dy))
                {
                    if (selected != null)
                    {
                        selected.Add(path);
                        return false;
                    }
                    else
                    {
                        return true;
                    }
                }
            }

            return false;
        }