コード例 #1
0
    public static void Draw(this ICurve curve)
    {
        if (curve == null)
        {
            return;
        }

        Curve c = curve as Curve;

        if (c != null)
        {
            foreach (ICurve segment in c.Segments)
            {
                LineSegment ls = segment as LineSegment;
                if (ls != null)
                {
                    ls.Draw();
                    continue;
                }

                CubicBezierSegment cubic = segment as CubicBezierSegment;
                if (cubic != null)
                {
                    cubic.Draw();
                    continue;
                }
                curve.DrawGeneric();
            }
        }
        else
        {
            var ls = curve as LineSegment;
            if (ls != null)
            {
                ls.Draw();
            }
            else
            {
                curve.DrawGeneric();
            }
        }
    }