コード例 #1
0
ファイル: Visual.cs プロジェクト: timka-rabbit/my_priojects
        public void Draw(IDrawer draw)
        {
            IPoint p1, p2, end;

            this.GetPoint(0, out p1);
            this.GetPoint(1, out end);
            p2 = (IPoint)p1.Clone();
            draw.DrawStart(p1.X, p1.Y);
            int i;

            for (i = 1; i < Params.n; i++)
            {
                this.GetPoint((double)i / Params.n, out p2);
                if (p2.CompareTo(end))
                {
                    break;
                }
                draw.DrawLine(p1.X, p1.Y, p2.X, p2.Y);
                path.AddLine(p1.X, p1.Y, p2.X, p2.Y);
                p1 = (IPoint)p2.Clone();
            }
            draw.DrawEnd(p1.X, p1.Y, end.X, end.Y);
            path.AddLine(p1.X, p1.Y, end.X, end.Y);
        }