Example #1
0
        private void curveButton_Click(object sender, EventArgs e)
        {
            CircularLeg leg = (CurrentFace.Leg as CircularLeg);

            if (leg == null)
            {
                return;
            }

            CircularLegMetrics metrics = leg.Metrics;

            if (metrics.IsCulDeSac)
            {
                using (CulDeSacForm dial = new CulDeSacForm(leg))
                {
                    if (dial.ShowDialog() == DialogResult.OK)
                    {
                        metrics.SetCentralAngle(dial.CentralAngle);
                        metrics.SetRadius(dial.Radius);
                        metrics.IsClockwise = dial.IsClockwise;
                        var newMetrics = new CircularLegMetrics(dial.Radius, dial.IsClockwise, dial.CentralAngle);
                        m_Edits.SetArcMetrics(m_CurFaceIndex, newMetrics);
                        Rework();
                    }
                }
            }
            else
            {
                using (ArcForm dial = new ArcForm(leg))
                {
                    if (dial.ShowDialog() == DialogResult.OK)
                    {
                        metrics.SetEntryAngle(dial.EntryAngle);
                        metrics.SetExitAngle(dial.ExitAngle);
                        metrics.SetRadius(dial.Radius);
                        metrics.IsClockwise = dial.IsClockwise;
                        var newMetrics = new CircularLegMetrics(dial.Radius, dial.IsClockwise, dial.EntryAngle, dial.ExitAngle);
                        m_Edits.SetArcMetrics(m_CurFaceIndex, newMetrics);
                        Rework();
                    }
                }
            }
        }