internal StrokeNodeIterator GetIteratorForNextSegment(Point[] points) { if (points == null) { throw new ArgumentNullException("points"); } StylusPointCollection stylusPointCollection = new StylusPointCollection(points); if (_stylusPoints != null && _stylusPoints.Count > 0) { stylusPointCollection.Insert(0, _stylusPoints[_stylusPoints.Count - 1]); } return(new StrokeNodeIterator(stylusPointCollection, _operations, _usePressure)); }
internal StrokeNodeIterator GetIteratorForNextSegment(StylusPointCollection stylusPoints) { if (stylusPoints == null) { throw new ArgumentNullException("stylusPoints"); } if (_stylusPoints != null && _stylusPoints.Count > 0 && stylusPoints.Count > 0) { StylusPoint item = stylusPoints[0]; StylusPoint stylusPoint = _stylusPoints[_stylusPoints.Count - 1]; item.X = stylusPoint.X; item.Y = stylusPoint.Y; item.PressureFactor = stylusPoint.PressureFactor; stylusPoints.Insert(0, item); } return(new StrokeNodeIterator(stylusPoints, _operations, _usePressure)); }
/// <summary> /// Generates (enumerates) StrokeNode objects for a stroke increment /// represented by an array of points. This method is supposed to be used only /// on objects created via the c-tor with a StylusShape parameter. /// </summary> /// <param name="points">an array of points representing a stroke increment</param> /// <returns>yields StrokeNode objects one by one</returns> internal StrokeNodeIterator GetIteratorForNextSegment(Point[] points) { if (points == null) { throw new System.ArgumentNullException("points"); } StylusPointCollection newStylusPoints = new StylusPointCollection(points); if (_stylusPoints != null && _stylusPoints.Count > 0) { //insert the previous last point newStylusPoints.Insert(0, _stylusPoints[_stylusPoints.Count - 1]); } return(new StrokeNodeIterator(newStylusPoints, _operations, _usePressure)); }
/// <summary> /// Generates (enumerates) StrokeNode objects for a stroke increment /// represented by an StylusPointCollection. Called from IncrementalRenderer /// </summary> /// <param name="stylusPoints">StylusPointCollection</param> /// <returns>yields StrokeNode objects one by one</returns> internal StrokeNodeIterator GetIteratorForNextSegment(StylusPointCollection stylusPoints) { if (stylusPoints == null) { throw new System.ArgumentNullException("stylusPoints"); } if (_stylusPoints != null && _stylusPoints.Count > 0 && stylusPoints.Count > 0) { //insert the previous last point, but we need insert a compatible //previous point. The easiest way to do this is to clone a point //(since StylusPoint is a struct, we get get one out to get a copy StylusPoint sp = stylusPoints[0]; StylusPoint lastStylusPoint = _stylusPoints[_stylusPoints.Count - 1]; sp.X = lastStylusPoint.X; sp.Y = lastStylusPoint.Y; sp.PressureFactor = lastStylusPoint.PressureFactor; stylusPoints.Insert(0, sp); } return(new StrokeNodeIterator(stylusPoints, _operations, _usePressure)); }
/// <summary> /// Generates (enumerates) StrokeNode objects for a stroke increment /// represented by an array of points. This method is supposed to be used only /// on objects created via the c-tor with a StylusShape parameter. /// </summary> /// <param name="points">an array of points representing a stroke increment</param> /// <returns>yields StrokeNode objects one by one</returns> internal StrokeNodeIterator GetIteratorForNextSegment(Point[] points) { if (points == null) { throw new System.ArgumentNullException("points"); } StylusPointCollection newStylusPoints = new StylusPointCollection(points); if (_stylusPoints != null && _stylusPoints.Count > 0) { //insert the previous last point newStylusPoints.Insert(0, _stylusPoints[_stylusPoints.Count - 1]); } return new StrokeNodeIterator( newStylusPoints, _operations, _usePressure); }
/// <summary> /// Generates (enumerates) StrokeNode objects for a stroke increment /// represented by an StylusPointCollection. Called from IncrementalRenderer /// </summary> /// <param name="stylusPoints">StylusPointCollection</param> /// <returns>yields StrokeNode objects one by one</returns> internal StrokeNodeIterator GetIteratorForNextSegment(StylusPointCollection stylusPoints) { if (stylusPoints == null) { throw new System.ArgumentNullException("stylusPoints"); } if (_stylusPoints != null && _stylusPoints.Count > 0 && stylusPoints.Count > 0) { //insert the previous last point, but we need insert a compatible //previous point. The easiest way to do this is to clone a point //(since StylusPoint is a struct, we get get one out to get a copy StylusPoint sp = stylusPoints[0]; StylusPoint lastStylusPoint = _stylusPoints[_stylusPoints.Count - 1]; sp.X = lastStylusPoint.X; sp.Y = lastStylusPoint.Y; sp.PressureFactor = lastStylusPoint.PressureFactor; stylusPoints.Insert(0, sp); } return new StrokeNodeIterator( stylusPoints, _operations, _usePressure); }