Exemplo n.º 1
0
        private void component_Click(object sender, EventArgs e)
        {
            if (Mesh == null)
            {
                return;
            }

            if (meshes != null)
            {
                return;
            }

            meshes = TriMeshModify.SeperateComponent(Mesh);
            ToolStripMenuItem item = ((ToolStripMenuItem)sender);

            item.DropDownItems.Clear();

            int num = TriMeshUtil.CountComponents(Mesh, false);

            for (int i = 0; i < num; i++)
            {
                ToolStripMenuItem subitem = new ToolStripMenuItem();
                subitem.Name   = i.ToString() + "ToolStripMenuItem";
                subitem.Text   = "Component " + i.ToString();
                subitem.Tag    = i;
                subitem.Click += Component_Click;
                item.DropDownItems.Add(subitem);
            }
        }