Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            pol = new Polyhedron();
            switch (comboBox1.SelectedItem.ToString())
            {
            case "Гексаэдр":
                break;

            case "Тетраэдр":
                pol.Tetrahedron();
                break;
            }
            switch (comboBox3.SelectedItem.ToString())
            {
            case "Изометрическая":
                projection = 1;
                break;

            case "Ортогональная на Х":
                projection = 2;
                break;

            case "Ортогональная на Y":
                projection = 3;
                break;

            case "Ортогональная на XoY":
                projection = 4;
                break;
            }
            pol.Display(projection);
            foreach (var i in pol.edges)
            {
                g.DrawLine(col, i.Item1, i.Item2);
            }
            foreach (var i in pol.edges)
            {
                g.DrawLine(col, i.Item1, i.Item2);
            }
            textBox1.Text = "";
            foreach (var i in pol.vertices2D)
            {
                textBox1.Text += "(" + i.X + " " + i.Y + ")     ";
            }
            pictureBox1.Image = pictureBox1.Image;
        }
Beispiel #2
0
        //нарисовать
        private void button2_Click(object sender, EventArgs e)
        {
            pol = new Polyhedron();
            switch (comboBox1.SelectedItem.ToString())
            {
            case "Гексаэдр":
                pol = new cube();
                break;

            case "Тетраэдр":
                pol = new Tetrahedron();
                break;

            case "Октаэдр":
                pol = new Octahedron();
                break;

            case "Загрузить из файла":
                LoadFromFile();
                break;

            case "Фигура вращения":
                lastPoint              = PointF.Empty;
                pictureBox1.MouseDown += pictureBox1_MouseDown;
                pictureBox1.MouseMove += pictureBox1_MouseMove;
                pictureBox1.MouseUp   += pictureBox1_MouseUp;
                forming = new List <PointF>();
                break;

            default:
                return;

                break;
            }
            switch (comboBox3.SelectedItem.ToString())
            {
            case "Изометрическая":
                projection = 1;
                break;

            case "Ортогональная на YoZ":
                projection = 2;
                break;

            case "Ортогональная на XoZ":
                projection = 3;
                break;

            case "Ортогональная на XoY":
                projection = 4;
                break;

            case "Перспективная":
                projection = 5;
                break;

            default:
                return;

                break;
            }

            ClearWithout();

            pol.draw();

            pictureBox1.Image = pictureBox1.Image;
        }