public GeometryConicForm(GeometryConicType geometry) { InitializeComponent(); comboBoxGeometry.Items.Add(GeometryConicType.Sphere); comboBoxGeometry.Items.Add(GeometryConicType.Cylinder); comboBoxGeometry.Items.Add(GeometryConicType.Cone); this.Geometry = geometry; switch (this.Geometry) { case GeometryConicType.Sphere: comboBoxGeometry.SelectedIndex = 0; numericRows.Value = 10; numericCols.Value = 20; break; case GeometryConicType.Cylinder: comboBoxGeometry.SelectedIndex = 1; numericRows.Value = 1; numericCols.Value = 8; break; case GeometryConicType.Cone: comboBoxGeometry.SelectedIndex = 2; numericRows.Value = 1; numericCols.Value = 8; break; } }
private void CreateConicCommon(GeometryConicType geometry) { using (GeometryConicForm form = new GeometryConicForm(geometry)) { if (form.ShowDialog() == DialogResult.OK) { switch (form.Geometry) { case GeometryConicType.Sphere: ModelEditorCore.CreateModelSphere(this.editorWindow, Math.Max(2, form.Rows), Math.Max(3, form.Cols)); break; case GeometryConicType.Cylinder: ModelEditorCore.CreateModelCylinder(this.editorWindow, Math.Max(1, form.Rows), Math.Max(3, form.Cols)); break; case GeometryConicType.Cone: ModelEditorCore.CreateModelCone(this.editorWindow, Math.Max(1, form.Rows), Math.Max(3, form.Cols)); break; } } } }