Example #1
0
 /// <inheritdoc/>
 public override void ArcTo(XPoint point, XPathSize size, double rotationAngle = 0.0, bool isLargeArc = false, XSweepDirection sweepDirection = XSweepDirection.Clockwise, bool isStroked = true, bool isSmoothJoin = true)
 {
     var segment = XArcSegment.Create(
         point,
         size,
         rotationAngle,
         isLargeArc,
         sweepDirection,
         isStroked,
         isSmoothJoin);
     _currentFigure.Segments = _currentFigure.Segments.Add(segment);
 }
Example #2
0
 /// <summary>
 /// Creates a new <see cref="XArcSegment"/> instance.
 /// </summary>
 /// <param name="point">The end point.</param>
 /// <param name="size">The arc size.</param>
 /// <param name="rotationAngle">The rotation angle.</param>
 /// <param name="isLargeArc">The is large flag.</param>
 /// <param name="sweepDirection">The sweep direction flag.</param>
 /// <param name="isStroked">The flag indicating whether shape is stroked.</param>
 /// <param name="isSmoothJoin">The flag indicating whether shape is smooth join.</param>
 /// <returns>The new instance of the <see cref="XArcSegment"/> class.</returns>
 public static XArcSegment Create(XPoint point, XPathSize size, double rotationAngle, bool isLargeArc, XSweepDirection sweepDirection, bool isStroked, bool isSmoothJoin)
 {
     return new XArcSegment()
     {
         Point = point,
         Size = size,
         RotationAngle = rotationAngle,
         IsLargeArc = isLargeArc,
         SweepDirection = sweepDirection,
         IsStroked = isStroked,
         IsSmoothJoin = isSmoothJoin
     };
 }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="point"></param>
        /// <param name="size"></param>
        /// <param name="rotationAngle"></param>
        /// <param name="isLargeArc"></param>
        /// <param name="sweepDirection"></param>
        /// <param name="isStroked"></param>
        /// <param name="isSmoothJoin"></param>
        public void ArcTo(
            XPoint point,
            XPathSize size,
            double rotationAngle,
            bool isLargeArc = false,
            XSweepDirection sweepDirection = XSweepDirection.Clockwise,
            bool isStroked    = true,
            bool isSmoothJoin = true)
        {
            var segment = XArcSegment.Create(
                point,
                size,
                rotationAngle,
                isLargeArc,
                sweepDirection,
                isStroked,
                isSmoothJoin);

            _figure.Segments.Add(segment);
        }
Example #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="point"></param>
 /// <param name="size"></param>
 /// <param name="rotationAngle"></param>
 /// <param name="isLargeArc"></param>
 /// <param name="sweepDirection"></param>
 /// <param name="isStroked"></param>
 /// <param name="isSmoothJoin"></param>
 /// <returns></returns>
 public static XArcSegment Create(
     XPoint point,
     XPathSize size,
     double rotationAngle,
     bool isLargeArc,
     XSweepDirection sweepDirection,
     bool isStroked,
     bool isSmoothJoin)
 {
     return(new XArcSegment()
     {
         Point = point,
         Size = size,
         RotationAngle = rotationAngle,
         IsLargeArc = isLargeArc,
         SweepDirection = sweepDirection,
         IsStroked = isStroked,
         IsSmoothJoin = isSmoothJoin
     });
 }
Example #5
0
        public void AddArc(XPoint point1, XPoint point2, XSize size, double rotationAngle, bool isLargeArg, XSweepDirection sweepDirection)
        {
            List <XPoint> points = GeometryHelper.BezierCurveFromArc(point1, point2, size, rotationAngle, isLargeArg,
                                                                     sweepDirection == XSweepDirection.Clockwise, PathStart.MoveTo1st);
            int count = points.Count;

            Debug.Assert((count + 2) % 3 == 0);

            MoveOrLineTo(points[0].X, points[0].Y);
            for (int idx = 1; idx < count; idx += 3)
            {
                BezierTo(points[idx].X, points[idx].Y, points[idx + 1].X, points[idx + 1].Y, points[idx + 2].X, points[idx + 2].Y, false);
            }
        }
Example #6
0
        public void AddArc(XPoint point1, XPoint point2, XSize size, double rotationAngle, bool isLargeArg, XSweepDirection sweepDirection)
        {
            List<XPoint> points = GeometryHelper.BezierCurveFromArc(point1, point2, size, rotationAngle, isLargeArg,
                sweepDirection == XSweepDirection.Clockwise, PathStart.MoveTo1st);
            int count = points.Count;
            Debug.Assert((count + 2) % 3 == 0);

            MoveOrLineTo(points[0].X, points[0].Y);
            for (int idx = 1; idx < count; idx += 3)
                BezierTo(points[idx].X, points[idx].Y, points[idx + 1].X, points[idx + 1].Y, points[idx + 2].X, points[idx + 2].Y, false);
        }
Example #7
0
 /// <summary>
 /// Adds an elliptical arc to the current figure. The arc is specified WPF like.
 /// </summary>
 public void AddArc(XPoint point1, XPoint point2, XSize size, double rotationAngle, bool isLargeArg, XSweepDirection sweepDirection)
 {
     _corePath.AddArc(point1, point2, size, rotationAngle, isLargeArg, sweepDirection);
 }
Example #8
0
        /// <summary>
        /// Adds an elliptical arc to the current figure. The arc is specified WPF like.
        /// </summary>
        public void AddArc(XPoint point1, XPoint point2, XSize size, double rotationAngle, bool isLargeArg, XSweepDirection sweepDirection)
        {
#if CORE
            _corePath.AddArc(point1, point2, size, rotationAngle, isLargeArg, sweepDirection);
#endif
#if GDI
            DiagnosticsHelper.HandleNotImplemented("XGraphicsPath.AddArc");
#endif
#if WPF
            PathFigure figure = CurrentPathFigure;
            if (figure.Segments.Count == 0)
                figure.StartPoint = point1.ToPoint();
            else
            {
                // figure.Segments.Add(new LineSegment(point1.ToPoint(), true));
#if !SILVERLIGHT
                LineSegment lineSegment = new LineSegment(point1.ToPoint(), true);
#else
                LineSegment lineSegment = new LineSegment();
                lineSegment.Point = point1.ToPoint();
#endif
                figure.Segments.Add(lineSegment);
            }

            // figure.Segments.Add(new ArcSegment(point2.ToPoint(), size.ToSize(), rotationAngle, isLargeArg, sweepDirection, true));
#if !SILVERLIGHT
            ArcSegment arcSegment = new ArcSegment(point2.ToPoint(), size.ToSize(), rotationAngle, isLargeArg, (SweepDirection)sweepDirection, true);
#else
            ArcSegment arcSegment = new ArcSegment();
            arcSegment.Point = point2.ToPoint();
            arcSegment.Size = size.ToSize();
            arcSegment.RotationAngle = rotationAngle;
            arcSegment.IsLargeArc = isLargeArg;
            arcSegment.SweepDirection = (SweepDirection)sweepDirection;
#endif
            figure.Segments.Add(arcSegment);
#endif
        }
Example #9
0
 /// <summary>
 /// Adds arc segment.
 /// </summary>
 /// <param name="point">The end point.</param>
 /// <param name="size">The arc size.</param>
 /// <param name="rotationAngle">The rotation angle.</param>
 /// <param name="isLargeArc">The is large flag.</param>
 /// <param name="sweepDirection">The sweep direction flag.</param>
 /// <param name="isStroked">The flag indicating whether shape is stroked.</param>
 /// <param name="isSmoothJoin">The flag indicating whether shape is smooth join.</param>
 public abstract void ArcTo(XPoint point, XPathSize size, double rotationAngle, bool isLargeArc = false, XSweepDirection sweepDirection = XSweepDirection.Clockwise, bool isStroked = true, bool isSmoothJoin = true);
Example #10
0
 /// <summary>
 /// Adds arc segment.
 /// </summary>
 /// <param name="point">The end point.</param>
 /// <param name="size">The arc size.</param>
 /// <param name="rotationAngle">The rotation angle.</param>
 /// <param name="isLargeArc">The is large flag.</param>
 /// <param name="sweepDirection">The sweep direction flag.</param>
 /// <param name="isStroked">The flag indicating whether shape is stroked.</param>
 /// <param name="isSmoothJoin">The flag indicating whether shape is smooth join.</param>
 public abstract void ArcTo(XPoint point, XPathSize size, double rotationAngle, bool isLargeArc = false, XSweepDirection sweepDirection = XSweepDirection.Clockwise, bool isStroked = true, bool isSmoothJoin = true);