Esempio n. 1
0
        public TriangleShape(TriangleShape triangle) : base(triangle)
        {

        }
Esempio n. 2
0
        public void AddRandomTriangle()
        {
            Random rnd = new Random();
            int x = rnd.Next(5, 1700);
            int y = rnd.Next(5, 900);

            PointF p1 = new PointF(x, y);
            PointF p2 = new PointF(x + 120, y + 120);
            PointF p3 = new PointF(x - 120, y + 120);

            TriangleShape triangle = new TriangleShape(p1, p2, p3);
            triangle.FillColor = MainForm.GetRandomColor();
            triangle.BorderColor = MainForm.GetRandomColor();

            if (Program.form.TabControl.SelectedTab.Equals(Program.form.TabPage3))
                PrimitiveList3.Add(triangle);
            else
                PrimitiveList.Add(triangle);
            selection = triangle;
        }
Esempio n. 3
0
 public override Primitive Clone()
 {
     TriangleShape triangle = new TriangleShape(points[0],points[1], points[2]);
     triangle.FillColor = this.FillColor;
     triangle.BorderColor = this.BorderColor;
     return triangle;
 }