Exemplo n.º 1
0
        /// <summary>
        /// Creates a default enumerator for a given stroke
        /// If using the strokes drawing attributes, pass stroke.DrawingAttributes for the second
        /// argument.  If using an overridden DA, use that instance.
        /// </summary>
        internal static StrokeNodeIterator GetIterator(StylusPointCollection stylusPoints, DrawingAttributes drawingAttributes)
        {
            if (stylusPoints == null)
            {
                throw new System.ArgumentNullException("stylusPoints");
            }
            if (drawingAttributes == null)
            {
                throw new System.ArgumentNullException("drawingAttributes");
            }

            StrokeNodeOperations operations =
                StrokeNodeOperations.CreateInstance(drawingAttributes.StylusShape);

            bool usePressure = !drawingAttributes.IgnorePressure;

            return(new StrokeNodeIterator(stylusPoints, operations, usePressure));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor for an incremental node enumerator that builds nodes
 /// from array(s) of points and a given stylus shape.
 /// </summary>
 /// <param name="nodeShape">a shape that defines the stroke contour</param>
 internal StrokeNodeIterator(StylusShape nodeShape)
     : this(null,    //stylusPoints
            StrokeNodeOperations.CreateInstance(nodeShape),
            false)   //usePressure)
 {
 }
Exemplo n.º 3
0
 /// <summary>
 /// Constructor for an incremental node enumerator that builds nodes
 /// from StylusPointCollections
 /// called by the IncrementalRenderer
 /// </summary>
 /// <param name="drawingAttributes">drawing attributes</param>
 internal StrokeNodeIterator(DrawingAttributes drawingAttributes)
     : this(null,                                                                    //stylusPoints
            StrokeNodeOperations.CreateInstance((drawingAttributes == null ? null : drawingAttributes.StylusShape)),
            (drawingAttributes == null ? false : !drawingAttributes.IgnorePressure)) //usePressure
 {
 }