Ejemplo n.º 1
0
        private void Plot()
        {
            if (ph == null)
            {
                return;
            }
            g.Clear(Color.White);

            Point3d.DrawPoint0(g, Color.LimeGreen);

            Polyhedron proj = ph.Clone() as Polyhedron;

            if (radioButtonCenterProj.Checked)
            {
                Affine.CentralProjection(proj, 10);
                pictureBox2.Image = bmp[3];
            }
            else if (radioButtonIsoProj.Checked)
            {
                Affine.IsometricProjection(proj);
                pictureBox2.Image = bmp[0];
            }
            else if (radioButtonOrtoProj.Checked)
            {
                switch (comboBoxProjPlane.SelectedIndex)
                {
                case 0:
                    Affine.OrtographicProjection(proj, 'z');
                    pictureBox2.Image = bmp[1];
                    break;

                case 1:
                    Affine.OrtographicProjection(proj, 'y');
                    pictureBox2.Image = bmp[2];
                    break;

                case 2:
                    Affine.OrtographicProjection(proj, 'x');
                    pictureBox2.Image = bmp[3];
                    break;

                default:
                    throw new Exception("Bad projection plane.");
                }
            }
            else
            {
                throw new Exception("Projection error.");
            }

            proj.Draw(g, Color.Black);
            //pictureBox1.Invalidate();
        }
Ejemplo n.º 2
0
        //Действия
        private void Draw()
        {
            if (polyhedron == null)
            {
                return;
            }
            g.Clear(Color.White);

            My_Point.DrawPoint0(g, Color.LimeGreen);

            Polyhedron proj = polyhedron.Clone() as Polyhedron;

            AffineTransform.IsometricProjection(proj);

            proj.Draw(g, Color.Black);
        }