コード例 #1
0
ファイル: PathForm.cs プロジェクト: 15831944/backsight
        private void curveButton_Click(object sender, EventArgs e)
        {
            // Display curve dialog. On OK, replace current selection
            // (if any) with the result of formatting the dialog.

            ArcForm dial = new ArcForm();

            if (dial.ShowDialog() == DialogResult.OK)
            {
                ReplaceSel(dial.Format());
            }

            dial.Dispose();

            // Put focus back in the data entry box
            pathTextBox.Focus();
        }
コード例 #2
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();
                    }
                }
            }
        }
コード例 #3
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();
                    }
                }
            }
        }