Exemple #1
0
        /// <summary>
        /// Generates stroke nodes along a given path.
        /// Drops any previously genererated nodes.
        /// </summary>
        /// <param name="path"></param>
        internal void MoveTo(IEnumerable <Point> path)
        {
            System.Diagnostics.Debug.Assert((path != null) && (IEnumerablePointHelper.GetCount(path) != 0));
            Point[] points = IEnumerablePointHelper.GetPointArray(path);

            if (_erasingStrokeNodes == null)
            {
                _erasingStrokeNodes = new List <StrokeNode>(points.Length);
            }
            else
            {
                _erasingStrokeNodes.Clear();
            }


            _bounds       = Rect.Empty;
            _nodeIterator = _nodeIterator.GetIteratorForNextSegment(points.Length > 1 ? FilterPoints(points) : points);
            for (int i = 0; i < _nodeIterator.Count; i++)
            {
                StrokeNode strokeNode = _nodeIterator[i];
                _bounds.Union(strokeNode.GetBoundsConnected());
                _erasingStrokeNodes.Add(strokeNode);
            }
#if POINTS_FILTER_TRACE
            _totalPointsAdded += path.Length;
            System.Diagnostics.Debug.WriteLine(String.Format("Total Points added: {0} screened: {1} collinear screened: {2}", _totalPointsAdded, _totalPointsScreened, _collinearPointsScreened));
#endif
        }