Ejemplo n.º 1
0
        /// <summary>Creates a path using a ractangle for bounds.</summary>
        public override GraphicsPath CreatePath(Rectangle bounds)
        {
            GraphicsPath path = new GraphicsPath();

            for (int i = 0; i < points.Count; i++)
            {
                ShapePoint p1 = points[i];
                ShapePoint p2 = i < points.Count - 1 ? points[i + 1] : points[0];

                Point rp1 = p1.GetPoint(dimension, bounds);
                Point rp2 = p2.GetPoint(dimension, bounds);

                if (p1.Bezier)
                {
                    path.AddBezier(rp1, p1.ControlPoint1.GetPoint(dimension, bounds),
                                   p1.ControlPoint2.GetPoint(dimension, bounds), rp2);
                }
                else
                {
                    path.AddLine(rp1, rp2);
                }
            }
            path.CloseAllFigures();

            return(path);
        }
Ejemplo n.º 2
0
 public bool IsVisible(ShapePoint nextPoint, Point pt, int width)
 {
     if (this.bezier)
     {
         return(this.IsCurveVisible(this.GetCurve(nextPoint), pt, (double)width));
     }
     return(this.IsLineVisible(this.GetPoint(), nextPoint.GetPoint(), pt, (double)width));
 }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="nextPoint"></param>
 /// <param name="pt"></param>
 /// <param name="width"></param>
 /// <returns></returns>
 public bool IsVisible(ShapePoint nextPoint, Point pt, int width)
 {
     if (bezier)
     {
         return(IsCurveVisible(GetCurve(nextPoint), pt, width));
     }
     else
     {
         return(IsLineVisible(GetPoint(), nextPoint.GetPoint(), pt, width));
     }
 }
Ejemplo n.º 4
0
        public override GraphicsPath CreatePath(Rectangle bounds)
        {
            GraphicsPath graphicsPath = new GraphicsPath();

            for (int index = 0; index < this.points.Count; ++index)
            {
                ShapePoint point1     = this.points[index];
                ShapePoint shapePoint = index < this.points.Count - 1 ? this.points[index + 1] : this.points[0];
                Point      point2     = point1.GetPoint(this.dimension, bounds);
                Point      point3     = shapePoint.GetPoint(this.dimension, bounds);
                if (point1.Bezier)
                {
                    graphicsPath.AddBezier(point2, point1.ControlPoint1.GetPoint(this.dimension, bounds), point1.ControlPoint2.GetPoint(this.dimension, bounds), point3);
                }
                else
                {
                    graphicsPath.AddLine(point2, point3);
                }
            }
            graphicsPath.CloseAllFigures();
            return(graphicsPath);
        }