Ejemplo n.º 1
0
        private void cmd_clear_Click(object sender, EventArgs e)
        {
            points.Clear(); // clear input points
            polygon = null;
            m       = null; // clear shape
            listBox1.Items.Clear();
            cmb_minumum.Items.Clear();
            cmb_other.Items.Clear();
            Graphics g = panel_screen.CreateGraphics();

            g.Clear(Color.White);
            cmd_3color.Enabled  = false;
            cmd_animate.Enabled = false;
            cmd_cut.Enabled     = false;
            cmd_scan1.Enabled   = false;
            cmd_scan2.Enabled   = false;
            button5.Text        = "-";
            button6.Text        = "-";
            button7.Text        = "-";
            button5.Enabled     = false;
            button6.Enabled     = false;
            button7.Enabled     = false;
            label1.Visible      = false;
            status = prosess_status.WAITING_USER_INPUT;
        }
Ejemplo n.º 2
0
        // triangulate button
        private void cmd_cut_Click(object sender, EventArgs e)
        {
            // if there's not a complete polygon yet
            if (polygon == null | status != prosess_status.POLYGON_READY)
            {
                return; // cancel prosessing
            }
            if (polygon.Length < 3)
            {
                return;
            }

            m = new mPolygonShape(polygon);             // initialize a new polygon-shape
            m.triangulate();                            // triangualete
            m.lb = listBox1;                            // assign reference of listbox
            listBox1.Items.Clear();                     // clear listbox

            Graphics g = panel_screen.CreateGraphics(); // Graphics handle

            g.Clear(Color.White);                       // cls screen

            // draw the result
            draw_ears(false); // wire_frame_only=false, allows filling of polygons
            draw_polygon();   // top of it, draw polygon, vertex markers
            status             = prosess_status.TRIANGULATION_COMPLETED;
            cmd_3color.Enabled = true;
        }