Exemple #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            string filename = openFileDialog1.FileName;
            string fileText = System.IO.File.ReadAllText(filename);

            figure = new Polyhedron(fileText);
            g.Clear(Color.White);
            figure.Show(g, 0);
        }
Exemple #2
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (comboBox1.SelectedIndex)
            {
            case 0:
                //Tetrahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Tetrahedron();
                figure.Show(g, projection);
                break;

            case 1:
                //Hexahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Hexahedron();
                figure.Show(g, projection);
                break;

            case 2:
                //Oktahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Octahedron();
                figure.Show(g, projection);
                break;

            case 3:
                //Icosahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Icosahedron();
                figure.Show(g, projection);
                break;

            case 4:
                //Dodecahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Dodecahedron();
                figure.Show(g, projection);
                break;

            default:
                break;
            }
        }
Exemple #3
0
        private void RotateAroundLine()
        {
            Edge rotateLine = new Edge(
                new Point3D(
                    (float)numericUpDown11.Value,
                    (float)numericUpDown12.Value,
                    (float)numericUpDown13.Value),
                new Point3D(
                    (float)numericUpDown14.Value,
                    (float)numericUpDown15.Value,
                    (float)numericUpDown16.Value));

            double angle = (double)numericUpDown16.Value;

            figure.Rotate(angle, rotateLineMode, rotateLine);

            g.Clear(Color.White);
            figure.Show(g, projection);
        }