Kaynağa Gözat

Add a two-point method picture effect

cxs 1 ay önce
ebeveyn
işleme
1b28a67b69

+ 8 - 1
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -1805,7 +1805,7 @@
 <Form>
     <Name>frmInitializeTwoPointRectangle</Name>
     <Controls>
-	  <Control name="frmInitializeTwoPointRectangle" text="两点法矩形" />
+	  <Control name="frmInitializeTwoPointRectangle" text="两点法矩形" />
      
 	  <Control name="groupBox1" text="左上角点" />
 	
@@ -1819,6 +1819,13 @@
 	  <Control name="btnwrite2" text="写入" />
 	  <Control name="bn_Cancel" text="取消" />
 	  <Control name="bn_OK" text="确定" />
+	  
+	  <Control name="groupBox3" text="斜面聚焦第三点" />
+	  <Control name="bn_TheThirdPoint" text="获取" />
+	  
+      <Control name="cB_Inclinedplanefocus" text="启用斜面聚焦" />
+	  <Control name="label10" text="放大倍数" />
+	  
 	
     </Controls>
  </Form>

+ 37 - 34
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -15,6 +15,7 @@ using System.Threading;
 using System.Windows.Forms;
 
 
+
 namespace OTSMeasureApp
 {
     public enum EnumMousePointPosition
@@ -63,45 +64,29 @@ namespace OTSMeasureApp
         DeleteSampleData = 11,
         SlopFocus = 12
     }
-
-
     public enum DrawMeasureAreaActionType
     {
         NoAction = 1,
         //圆形
         Circle = 2,
-
-
         Rectangle = 3,
-
-
-
         //多边形
         Polygon = 4,
-
         //圆形三点法
         CircleByThreePoints = 5,
-
         InverseSelection = 6,
-
         OnlyShot = 7
-
-
     }
     public partial class OTSSamplespaceWindow : DockContent
     {
         #region 全局变量定义
-
         public CVisualStage m_visualStage;
-
-
         string m_SampleHoleSelectName = string.Empty;
         public string m_SampleSelectName = string.Empty;
 
 
-        public List<CVisualSampleArea> m_visualSamples;
-
 
+        public List<CVisualSampleArea> m_visualSamples;
         //手绘测量区域
         public static CMeasureArea m_DrawMeasureGDIObject = new CMeasureArea();
 
@@ -193,6 +178,14 @@ namespace OTSMeasureApp
             lan = new OTSCommon.Language(this);
             table = lan.GetNameTable(this.Name);
         }
+        
+        
+        
+        
+        
+        
+        
+        
         #region 菜单操作
         private void CMStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
         {
@@ -435,20 +428,16 @@ namespace OTSMeasureApp
                 var para = m_visualStage.GetSampleMeasurePara(sam.GetMeasureGDIObject());
 
                 SetWorkSampleMeasureArea(para);
-
-
             }
-
-
-
-
         }
+
         public void DrawRectangleBytTwoPoint()
         {
             //手绘测量区域类型为圆形
 
             frmInitializeTwoPointRectangle frmInput = new frmInitializeTwoPointRectangle();
-            if (frmInput.ShowDialog() == DialogResult.OK)
+            DialogResult result=frmInput.ShowDialog();
+            if (result == DialogResult.OK)
             {
                 PointF lt =frmInput.LTPoint;
                 PointF rb= frmInput.RBPoint;  
@@ -462,20 +451,19 @@ namespace OTSMeasureApp
                 Color MeasureColor = Color.Red;
                 CMeasureArea newGDI=new CMeasureArea(visualRec, ShapeType.RECTANGLE,"", sam.GetSampleName(), MeasureColor);
 
-
                 newGDI.SetZoomNumber(m_visualStage.GetZoomNum());
                 newGDI.SetDisplayRefPoint(m_visualStage.GetDisplayRefPoint());
-
                 newGDI.IsWorkSample = true;
                 sam.SetMeasureGDIObject(newGDI);
                 m_DrawPolygonFinishGDIObject = null;
                 m_DrawMeasureGDIObject = null;
-
                 var para = m_visualStage.GetSampleMeasurePara(sam.GetMeasureGDIObject());
 
                 SetWorkSampleMeasureArea(para);
-
                 if(frmInput.IsInclinedPlaneFocus) m_MeasureAppForm.m_ProjParam.GetWorkSample().GetMsrParams().SlopParam = frmInput.GetCSlopFocusParam();
+                CSEMFieldData semdata = m_MeasureAppForm.m_ProjParam.GetResultData().GetWorkingSample().GetSEMDataMsr();
+                semdata.SetMagnification(frmInput.GetMagnification());
+                PrepareVisualMeasureField(GetWorkingVisualSample());
             }
         }
 
@@ -489,6 +477,26 @@ namespace OTSMeasureApp
 
 
 
+
+        
+        
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
         public void SetWorkSampleMeasureArea(SampleMeasurePara SMeasurePara)
         {
@@ -513,12 +521,7 @@ namespace OTSMeasureApp
             }
             WSample.SetSampleHoleName(SMeasurePara.sampleHoleName);
             WSample.SetMsrDomain(Domain);
-
-
-
-
             return;
-
         }
 
         public CVisualSampleArea GetWorkingVisualSample()
@@ -572,6 +575,7 @@ namespace OTSMeasureApp
             Invalidate();
         }
 
+
         public void DisplaySample(SampleMeasurePara SMeasrueArea)
         {
             var m_Sample = m_MeasureAppForm.m_ProjParam.GetResultData().GetSampleByName(SMeasrueArea.sSampleName);
@@ -580,7 +584,6 @@ namespace OTSMeasureApp
             {
                 //this part code is to be compatible with previouse version result file which there's no AllField position info.
                 DrawSampleAndMeasureInfo(SMeasrueArea);
-
             }
             else
             {

+ 27 - 2
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/frmInitializeTwoPointRectangle.Designer.cs

@@ -50,6 +50,7 @@
             this.bn_OK = new System.Windows.Forms.Button();
             this.panel1 = new System.Windows.Forms.Panel();
             this.panel2 = new System.Windows.Forms.Panel();
+            this.label11 = new System.Windows.Forms.Label();
             this.panel3 = new System.Windows.Forms.Panel();
             this.tBx_Magnification = new System.Windows.Forms.TextBox();
             this.label10 = new System.Windows.Forms.Label();
@@ -65,6 +66,7 @@
             this.tBx_TheThirdPointY = new System.Windows.Forms.TextBox();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
+            this.panel2.SuspendLayout();
             this.panel3.SuspendLayout();
             this.groupBox3.SuspendLayout();
             this.SuspendLayout();
@@ -96,6 +98,7 @@
             this.tB_LTPointWD.ReadOnly = true;
             this.tB_LTPointWD.Size = new System.Drawing.Size(83, 21);
             this.tB_LTPointWD.TabIndex = 10;
+            this.tB_LTPointWD.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             // 
             // label8
             // 
@@ -145,6 +148,7 @@
             this.tB_LTPointX.Name = "tB_LTPointX";
             this.tB_LTPointX.Size = new System.Drawing.Size(76, 21);
             this.tB_LTPointX.TabIndex = 3;
+            this.tB_LTPointX.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             // 
             // label3
             // 
@@ -163,6 +167,7 @@
             this.tB_LTPointY.Name = "tB_LTPointY";
             this.tB_LTPointY.Size = new System.Drawing.Size(76, 21);
             this.tB_LTPointY.TabIndex = 5;
+            this.tB_LTPointY.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             // 
             // groupBox2
             // 
@@ -191,6 +196,7 @@
             this.tBx_RBPointWD.ReadOnly = true;
             this.tBx_RBPointWD.Size = new System.Drawing.Size(83, 21);
             this.tBx_RBPointWD.TabIndex = 15;
+            this.tBx_RBPointWD.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             // 
             // label7
             // 
@@ -219,6 +225,7 @@
             this.tB_RBPointY.Name = "tB_RBPointY";
             this.tB_RBPointY.Size = new System.Drawing.Size(76, 21);
             this.tB_RBPointY.TabIndex = 11;
+            this.tB_RBPointY.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             // 
             // label5
             // 
@@ -237,6 +244,7 @@
             this.tB_RBPointX.Name = "tB_RBPointX";
             this.tB_RBPointX.Size = new System.Drawing.Size(76, 21);
             this.tB_RBPointX.TabIndex = 9;
+            this.tB_RBPointX.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             // 
             // label4
             // 
@@ -294,11 +302,21 @@
             // panel2
             // 
             this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.panel2.Controls.Add(this.label11);
             this.panel2.Location = new System.Drawing.Point(12, 483);
             this.panel2.Name = "panel2";
             this.panel2.Size = new System.Drawing.Size(462, 165);
             this.panel2.TabIndex = 25;
             // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Location = new System.Drawing.Point(17, 19);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(233, 12);
+            this.label11.TabIndex = 0;
+            this.label11.Text = "注:第三点请不要位于前两点所在的直线上!";
+            // 
             // panel3
             // 
             this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@@ -321,6 +339,7 @@
             this.tBx_Magnification.Name = "tBx_Magnification";
             this.tBx_Magnification.Size = new System.Drawing.Size(100, 21);
             this.tBx_Magnification.TabIndex = 26;
+            this.tBx_Magnification.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             // 
             // label10
             // 
@@ -359,7 +378,7 @@
             this.groupBox3.Size = new System.Drawing.Size(572, 84);
             this.groupBox3.TabIndex = 22;
             this.groupBox3.TabStop = false;
-            this.groupBox3.Text = "LeftTopPoint";
+            this.groupBox3.Text = "TheThirdPoint";
             // 
             // tBx_TheThirdPointWD
             // 
@@ -369,6 +388,7 @@
             this.tBx_TheThirdPointWD.ReadOnly = true;
             this.tBx_TheThirdPointWD.Size = new System.Drawing.Size(83, 21);
             this.tBx_TheThirdPointWD.TabIndex = 17;
+            this.tBx_TheThirdPointWD.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             // 
             // label9
             // 
@@ -399,7 +419,7 @@
             this.bn_TheThirdPoint.TabIndex = 6;
             this.bn_TheThirdPoint.Text = "Obtain";
             this.bn_TheThirdPoint.UseVisualStyleBackColor = true;
-            this.bn_TheThirdPoint.Click += new System.EventHandler(this.bn_TheThirdPoint_Click_1);
+            this.bn_TheThirdPoint.Click += new System.EventHandler(this.bn_TheThirdPoint_Click);
             // 
             // label1
             // 
@@ -418,6 +438,7 @@
             this.tBx_TheThirdPointX.Name = "tBx_TheThirdPointX";
             this.tBx_TheThirdPointX.Size = new System.Drawing.Size(76, 21);
             this.tBx_TheThirdPointX.TabIndex = 3;
+            this.tBx_TheThirdPointX.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             // 
             // label6
             // 
@@ -436,6 +457,7 @@
             this.tBx_TheThirdPointY.Name = "tBx_TheThirdPointY";
             this.tBx_TheThirdPointY.Size = new System.Drawing.Size(76, 21);
             this.tBx_TheThirdPointY.TabIndex = 5;
+            this.tBx_TheThirdPointY.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             // 
             // frmInitializeTwoPointRectangle
             // 
@@ -456,6 +478,8 @@
             this.groupBox1.PerformLayout();
             this.groupBox2.ResumeLayout(false);
             this.groupBox2.PerformLayout();
+            this.panel2.ResumeLayout(false);
+            this.panel2.PerformLayout();
             this.panel3.ResumeLayout(false);
             this.panel3.PerformLayout();
             this.groupBox3.ResumeLayout(false);
@@ -501,5 +525,6 @@
         private System.Windows.Forms.CheckBox cB_Inclinedplanefocus;
         private System.Windows.Forms.TextBox tBx_Magnification;
         private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.Label label11;
     }
 }

+ 512 - 23
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/frmInitializeTwoPointRectangle.cs

@@ -3,6 +3,7 @@ using OTSModelSharp.ServiceCenter;
 using System;
 using System.Collections;
 using System.Drawing;
+using System.Drawing.Drawing2D;
 using System.Windows.Forms;
 
 namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
@@ -13,21 +14,23 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
         public PointF LTPoint;
         public PointF RBPoint;
         public PointF TheThirdPoint;
-        public bool IsOK = false;
         public bool IsInclinedPlaneFocus = false;
-
-
         OTSCommon.Language lan;
         Hashtable table;
-
         CSlopFocusParam slopFocusParam;
 
-
         public frmInitializeTwoPointRectangle()
         {
             InitializeComponent();
             lan = new OTSCommon.Language(this);
             table = lan.GetNameTable(this.Name);
+            if (panel1 != null)
+            {
+                panel1.Paint += Panel1_Paint;
+                panel1.MouseMove += Panel1_MouseMove;
+                panel1.MouseLeave += Panel1_MouseLeave;
+                panel1.Resize += Panel1_Resize;
+            }
         }
         private void bn_FirstPoint_Click(object sender, EventArgs e)
         {
@@ -45,12 +48,14 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
             {
                 tB_LTPointWD.Text = WD.ToString();
             }
+            if (panel1 != null) panel1.Invalidate();
         }
         private void bn_SecondPoint_Click(object sender, EventArgs e)
         {
             double Px = 0;
             double Py = 0;
             double Pr = 0;
+
             if (cfun.GetSemPositionXY(ref Px, ref Py, ref Pr))
             {
                 tB_RBPointX.Text = Px.ToString();
@@ -58,17 +63,33 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
                 RBPoint = new PointF((float)Px, (float)Py);
             }
             double WD = 0;
+
+
             if (cfun.GetWorkingDistance(ref WD))
             {
-                tB_RBPointX.Text = WD.ToString();
+                tBx_RBPointWD.Text = WD.ToString();
             }
+            if (panel1 != null) panel1.Invalidate();
         }
         private void frmInitializeTwoPointRectangle_Load(object sender, EventArgs e)
         {
             if (cfun == null){cfun = SemController.GetSEMController();}
             cB_Inclinedplanefocus.Checked=true;double val=0;
             if(cfun.GetMagnification(ref val)) tBx_Magnification.Text=val.ToString();
+            InitializeDrawingAreas();
+            panel1.Invalidate();
         }
+
+
+
+
+
+
+
+
+
+
+
         private void button1_Click(object sender, EventArgs e)
         {
             if (tB_LTPointWD.Text == "")
@@ -81,11 +102,6 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
             double wd = Convert.ToDouble(tB_LTPointWD.Text);
             if (cfun.MoveSEMToPoint(Px, Py)) cfun.SetWorkingDistance(wd);
         }
-
-
-
-
-
         private void button2_Click(object sender, EventArgs e)
         {
             if (tBx_RBPointWD.Text == "")
@@ -101,7 +117,7 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
                 cfun.SetWorkingDistance(wd);
             }
         }
-        private void bn_TheThirdPoint_Click_1(object sender, EventArgs e)
+        private void bn_TheThirdPoint_Click(object sender, EventArgs e)
         {
             double Px = 0;
             double Py = 0;
@@ -117,6 +133,7 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
             {
                 tBx_TheThirdPointWD.Text = WD.ToString();
             }
+            if (panel1 != null) panel1.Invalidate();
         }
         private void btn_gtTheThirdPoint_Click(object sender, EventArgs e)
         {
@@ -135,20 +152,20 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
         }
         private void bn_OK_Click(object sender, EventArgs e)
         {
-            
-            IsOK = true;
             double iPX1, iPY1, iPX2, iPY2, iPX3, iPY3;
             iPX1 = iPY1 = iPX2 = iPY2 = iPX3 = iPY3 = 0;
             double dPW1, dPW2, dPW3;
             dPW1 = dPW2 = dPW3 = 0;
             if (!double.TryParse(tB_LTPointX.Text, out iPX1) || !double.TryParse(tB_LTPointY.Text, out iPY1) || !double.TryParse(tB_RBPointX.Text, out iPX2) || !double.TryParse(tB_RBPointY.Text, out iPY2) ||  !double.TryParse(tB_LTPointWD.Text, out dPW1) || !double.TryParse(tBx_RBPointWD.Text, out dPW2) )
             {
-                MessageBox.Show("Please check Params!");
+                DialogResult result= MessageBox.Show("Please check Params!");
+                this.DialogResult= DialogResult.None;
                 return;
             }
             if (tB_LTPointX.Text == tB_RBPointX.Text && tB_LTPointY.Text == tB_RBPointY.Text)
             {
-                MessageBox.Show("Please select different points!");
+                DialogResult result= MessageBox.Show("Please select different points!");
+                this.DialogResult = DialogResult.None;
                 return;
             }
             if(cB_Inclinedplanefocus.Checked)
@@ -157,14 +174,27 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
                 if(!double.TryParse(tBx_TheThirdPointX.Text, out iPX3) || !double.TryParse(tBx_TheThirdPointY.Text, out iPY3) || !double.TryParse(tBx_TheThirdPointWD.Text, out dPW3))
                 {
                     MessageBox.Show("Please check Params!");
+                    this.DialogResult = DialogResult.None;
                     return;
                 }
                 if((tB_LTPointX.Text == tBx_TheThirdPointX.Text && tB_LTPointX.Text ==tBx_TheThirdPointY.Text) || (tB_LTPointX.Text == tBx_TheThirdPointY.Text && tB_RBPointY.Text == tBx_TheThirdPointY.Text))
                 {
                     MessageBox.Show("Please check Params!");
+                    this.DialogResult = DialogResult.None;
                     return;
                 }
             }
+
+
+
+
+
+
+
+
+            LTPoint = new PointF((float)iPX1, (float)iPY1);
+            RBPoint = new PointF((float)iPX2, (float)iPY2);
+            TheThirdPoint = new PointF((float)iPX3, (float)iPY3);
             if (slopFocusParam == null)
             {
                 slopFocusParam = new CSlopFocusParam();
@@ -182,19 +212,478 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
         {
             this.Close();
         }
-
-
-        
-        
-        
         private void cB_Inclinedplanefocus_CheckedChanged(object sender, EventArgs e)
         {
-            if(cB_Inclinedplanefocus.Checked)IsInclinedPlaneFocus = true;
-            else IsInclinedPlaneFocus = false;
+            if (cB_Inclinedplanefocus.Checked)
+            {
+                IsInclinedPlaneFocus = true;
+
+                groupBox3.Enabled =true;
+                foreach (Control c in groupBox3.Controls)
+                {
+                    c.Enabled = true;
+                }
+            }
+            else
+            {
+                IsInclinedPlaneFocus = false;
+                isMouseInThirdPoint = false;
+                UpdateGroupBoxHighlight(groupBox3, false); // 需要确认存在groupBox3控件
+                groupBox3.Enabled =false; 
+                foreach (Control c in groupBox3.Controls)
+                {
+                    c.Enabled = false;
+                }
+            }
+            if (panel1 != null)
+            {
+                panel1.Invalidate();
+            }
         }
         public CSlopFocusParam GetCSlopFocusParam()
         {
             return slopFocusParam;
         }
+        public double GetMagnification()
+        {
+            
+            
+            
+            double dMagnification = 0;
+            double.TryParse(tBx_Magnification.Text, out dMagnification);
+            return dMagnification;
+        }
+        private RectangleF rectangleArea;
+        private RectangleF topLeftCircle;
+        private RectangleF bottomRightCircle;
+        private RectangleF thirdPointCircle;
+        private bool isMouseInTopLeft = false;
+        private bool isMouseInBottomRight = false;
+        private bool isMouseInThirdPoint = false;
+
+        private void Panel1_Resize(object sender, EventArgs e)
+        {
+            InitializeDrawingAreas();
+            panel1.Invalidate();
+        }
+
+        // 初始化绘图区域
+        private void InitializeDrawingAreas()
+        {
+            if (panel1 == null) return;
+
+            // 定义矩形区域(居中显示)
+            int margin = 30;
+            rectangleArea = new RectangleF(
+                margin,
+                margin,
+                panel1.Width - 2 * margin,
+                panel1.Height - 2 * margin);
+
+            // 定义圆圈区域(直径16像素)
+            float circleDiameter = 16f;
+            float circleRadius = circleDiameter / 2;
+
+            topLeftCircle = new RectangleF(
+                rectangleArea.Left - circleRadius,
+                rectangleArea.Top - circleRadius,
+                circleDiameter, circleDiameter);
+
+            bottomRightCircle = new RectangleF(
+                rectangleArea.Right - circleRadius,
+                rectangleArea.Bottom - circleRadius,
+                circleDiameter, circleDiameter);
+
+            // 第三个点位于矩形内部,靠近右边但不在对角线上
+            thirdPointCircle = new RectangleF(
+                rectangleArea.Right - circleRadius - 30,
+                rectangleArea.Top + rectangleArea.Height / 3 - circleRadius,
+                circleDiameter, circleDiameter);
+        }
+
+        // Panel 绘制事件 - 创建高级视觉效果
+        private void Panel1_Paint(object sender, PaintEventArgs e)
+        {
+            Graphics g = e.Graphics;
+            g.SmoothingMode = SmoothingMode.AntiAlias;
+            g.CompositingQuality = CompositingQuality.HighQuality;
+
+            // 确保绘图区域已初始化
+            if (rectangleArea.IsEmpty)
+            {
+                InitializeDrawingAreas();
+            }
+
+            // 绘制高级效果矩形(绿色背景)
+            DrawAdvancedRectangle(g, rectangleArea);
+
+            // 绘制带渐变的圆圈(黄色)
+            DrawAdvancedCircle(g, topLeftCircle, isMouseInTopLeft);
+            DrawAdvancedCircle(g, bottomRightCircle, isMouseInBottomRight);
+
+            // 如果选中了倾斜平面焦点选项,绘制第三个点
+            if (cB_Inclinedplanefocus.Checked)
+            {
+                DrawAdvancedCircle(g, thirdPointCircle, isMouseInThirdPoint);
+
+                // 在第三个点上方绘制"任意非对角线点"文字
+                DrawNonDiagonalPointLabel(g, thirdPointCircle);
+
+                // 显示第三个点坐标
+                if (tBx_TheThirdPointX.Text != "" && tBx_TheThirdPointY.Text != "")
+                {
+                    DrawPointCoordinates(g, thirdPointCircle, tBx_TheThirdPointX.Text, tBx_TheThirdPointY.Text, "THIRD");
+                }
+            }
+
+            // 显示左上角点坐标
+            if (tB_LTPointX.Text != "" && tB_LTPointY.Text != "")
+            {
+                DrawPointCoordinates(g, topLeftCircle, tB_LTPointX.Text, tB_LTPointY.Text, "LT");
+            }
+            // 显示右下角点坐标
+            if (tB_RBPointX.Text != "" && tB_RBPointY.Text != "")
+            {
+                DrawPointCoordinates(g, bottomRightCircle, tB_RBPointX.Text, tB_RBPointY.Text, "RB");
+            }
+        }
+        // 绘制坐标值
+        private void DrawPointCoordinates(Graphics g, RectangleF circleRect, string xValue, string yValue, string Pointlocation)
+        {
+            string coordinates = $"({xValue}, {yValue})";
+
+            // 使用高质量文本渲染
+            g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
+
+            // 定义字体
+            using (Font font = new Font("微软雅黑", 8, FontStyle.Regular))
+            {
+                // 测量文字大小
+                SizeF textSize = g.MeasureString(coordinates, font);
+
+                float textX, textY;
+
+                if (Pointlocation == "LT")
+                {
+                    // 左上角点:坐标显示在右下方
+                    textX = circleRect.Right + 5;
+                    textY = circleRect.Bottom + 5;
+                }
+                else if (Pointlocation == "RB")
+                {
+                    // 右下角点:坐标显示在左上方
+                    textX = circleRect.Left - textSize.Width - 5;
+                    textY = circleRect.Top - textSize.Height - 5;
+                }
+                else
+                {
+                    // 对于其他点(包括第三个点):坐标显示在下方
+                    textX = circleRect.X + (circleRect.Width - textSize.Width) / 2; // 居中
+                    textY = circleRect.Bottom + 5; // 下方5像素
+                }
+
+                // 确保文字不会超出边界
+                if (textX < 0) textX = 0;
+                if (textY < 0) textY = 0;
+                if (textX + textSize.Width > panel1.Width) textX = panel1.Width - textSize.Width;
+                if (textY + textSize.Height > panel1.Height) textY = panel1.Height - textSize.Height;
+                // 绘制坐标文字(银白色)
+                using (SolidBrush textBrush = new SolidBrush(Color.White))
+                {
+                    g.DrawString(coordinates, font, textBrush, textX, textY);
+                }
+            }
+        }
+
+
+        // 绘制"任意非对角线点"文字标识
+        private void DrawNonDiagonalPointLabel(Graphics g, RectangleF circleRect)
+        {
+            string labelText = "任意非对角线点";
+
+            // 使用高质量文本渲染
+            g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
+
+            // 定义字体
+            using (Font font = new Font("微软雅黑", 9, FontStyle.Bold))
+            {
+                // 测量文字大小
+                SizeF textSize = g.MeasureString(labelText, font);
+
+                // 计算文字位置(在圆圈上方居中)
+                float textX = circleRect.X + (circleRect.Width - textSize.Width) / 2;
+                float textY = circleRect.Y - textSize.Height - 5; // 上方5像素间距
+
+                // 创建文字路径以实现轮廓效果
+                using (GraphicsPath textPath = new GraphicsPath())
+                {
+                    textPath.AddString(
+                        labelText,
+                        FontFamily.GenericSansSerif,
+                        (int)FontStyle.Bold,
+                        g.DpiY * 9 / 72, // 9pt 转换为像素
+                        new PointF(textX, textY),
+                        StringFormat.GenericDefault);
+
+                    // 绘制文字阴影效果
+                    using (Matrix translateMatrix = new Matrix())
+                    {
+                        translateMatrix.Translate(1, 1);
+                        textPath.Transform(translateMatrix);
+
+                        using (SolidBrush shadowBrush = new SolidBrush(Color.FromArgb(120, 0, 0, 0)))
+                        {
+                            g.FillPath(shadowBrush, textPath);
+                        }
+
+                        // 恢复原始位置
+                        translateMatrix.Reset();
+                        translateMatrix.Translate(-1, -1);
+                        textPath.Transform(translateMatrix);
+                    }
+
+                    // 绘制文字主体(深绿色)
+                    using (SolidBrush textBrush = new SolidBrush(Color.DarkGreen))
+                    {
+                        g.FillPath(textBrush, textPath);
+                    }
+
+                    // 绘制文字边框(可选)
+                    using (Pen textPen = new Pen(Color.FromArgb(180, Color.ForestGreen), 0.5f))
+                    {
+                        g.DrawPath(textPen, textPath);
+                    }
+                }
+            }
+        }
+
+        // 绘制高级效果矩形(绿色背景)
+        private void DrawAdvancedRectangle(Graphics g, RectangleF rect)
+        {
+            // 创建圆角矩形路径
+            using (GraphicsPath path = new GraphicsPath())
+            {
+                float radius = 10f;
+                path.AddArc(rect.X, rect.Y, radius, radius, 180, 90);
+                path.AddArc(rect.Right - radius, rect.Y, radius, radius, 270, 90);
+                path.AddArc(rect.Right - radius, rect.Bottom - radius, radius, radius, 0, 90);
+                path.AddArc(rect.X, rect.Bottom - radius, radius, radius, 90, 90);
+                path.CloseFigure();
+
+                // 填充绿色渐变背景
+                using (LinearGradientBrush brush = new LinearGradientBrush(
+                    rect, Color.FromArgb(144, 238, 144), Color.FromArgb(0, 100, 0), 45f)) // 浅绿到深绿
+                {
+                    g.FillPath(brush, path);
+                }
+
+                // 绘制外边框
+                using (Pen pen = new Pen(Color.FromArgb(0, 100, 0), 2)) // 深绿色边框
+                {
+                    g.DrawPath(pen, path);
+                }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+                // 添加内部发光效果
+                using (Pen innerPen = new Pen(Color.FromArgb(144, 255, 144), 1)) // 浅绿色内边框
+                {
+                    innerPen.Alignment = PenAlignment.Inset;
+                    RectangleF innerRect = new RectangleF(rect.X + 1, rect.Y + 1, rect.Width - 2, rect.Height - 2);
+                    using (GraphicsPath innerPath = new GraphicsPath())
+                    {
+                        float innerRadius = 8f;
+                        innerPath.AddArc(innerRect.X, innerRect.Y, innerRadius, innerRadius, 180, 90);
+                        innerPath.AddArc(innerRect.Right - innerRadius, innerRect.Y, innerRadius, innerRadius, 270, 90);
+                        innerPath.AddArc(innerRect.Right - innerRadius, innerRect.Bottom - innerRadius, innerRadius, innerRadius, 0, 90);
+                        innerPath.AddArc(innerRect.X, innerRect.Bottom - innerRadius, innerRadius, innerRadius, 90, 90);
+                        innerPath.CloseFigure();
+                        g.DrawPath(innerPen, innerPath);
+                    }
+                }
+
+                // 添加阴影效果
+                using (Pen shadowPen = new Pen(Color.FromArgb(50, 0, 0, 0), 3))
+                {
+                    shadowPen.Alignment = PenAlignment.Outset;
+                    g.DrawPath(shadowPen, path);
+                }
+            }
+        }
+
+        // 绘制高级效果圆圈(黄色)
+        private void DrawAdvancedCircle(Graphics g, RectangleF circleRect, bool isHovered)
+        {
+            // 创建圆形路径
+            using (GraphicsPath path = new GraphicsPath())
+            {
+                path.AddEllipse(circleRect);
+
+                // 使用黄色系
+                Color centerColor = isHovered ? Color.Gold : Color.Yellow;     // 悬停时用金色,正常时用黄色
+                Color rimColor = isHovered ? Color.Orange : Color.Goldenrod;   // 悬停时用橙色,正常时用金麒麟色
+
+                // 径向渐变画刷
+                using (PathGradientBrush brush = new PathGradientBrush(path))
+                {
+                    brush.CenterColor = centerColor;
+                    brush.SurroundColors = new Color[] { rimColor };
+                    brush.CenterPoint = new PointF(
+                        circleRect.X + circleRect.Width / 2,
+                        circleRect.Y + circleRect.Height / 2);
+
+                    // 设置焦点缩放以创建更好的渐变效果
+                    brush.FocusScales = new PointF(0.3f, 0.3f);
+
+                    g.FillPath(brush, path);
+                }
+
+                // 添加高光效果(左上角的小圆形高光)
+                RectangleF highlightRect = new RectangleF(
+                    circleRect.X + circleRect.Width * 0.15f,
+                    circleRect.Y + circleRect.Height * 0.15f,
+                    circleRect.Width * 0.3f,
+                    circleRect.Height * 0.3f);
+
+                using (SolidBrush highlightBrush = new SolidBrush(Color.FromArgb(200, Color.White)))
+                {
+                    g.FillEllipse(highlightBrush, highlightRect);
+                }
+
+                // 添加边框
+                using (Pen pen = new Pen(Color.FromArgb(200, Color.SaddleBrown), isHovered ? 2.5f : 1.5f))
+                {
+                    g.DrawEllipse(pen, circleRect);
+                }
+
+                // 添加外发光效果
+                if (isHovered)
+                {
+                    using (Pen glowPen = new Pen(Color.FromArgb(100, Color.Orange), 3))
+                    {
+                        glowPen.Alignment = PenAlignment.Outset;
+                        g.DrawEllipse(glowPen, circleRect);
+                    }
+                }
+            }
+        }
+
+        // 鼠标移动事件处理
+        private void Panel1_MouseMove(object sender, MouseEventArgs e)
+        {
+            bool wasInTopLeft = isMouseInTopLeft;
+            bool wasInBottomRight = isMouseInBottomRight;
+            bool wasInThirdPoint = isMouseInThirdPoint;
+
+            // 检测鼠标是否在圆圈内
+            isMouseInTopLeft = IsPointInCircle(e.Location, topLeftCircle);
+            isMouseInBottomRight = IsPointInCircle(e.Location, bottomRightCircle);
+
+            // 只有在选中倾斜平面焦点时才检查第三个点
+            if (cB_Inclinedplanefocus.Checked)
+            {
+                isMouseInThirdPoint = IsPointInCircle(e.Location, thirdPointCircle);
+            }
+            else
+            {
+                isMouseInThirdPoint = false;
+            }
+
+            // 如果状态发生变化,刷新显示并更新GroupBox高亮
+            if (wasInTopLeft != isMouseInTopLeft ||
+                wasInBottomRight != isMouseInBottomRight ||
+                wasInThirdPoint != isMouseInThirdPoint)
+            {
+                panel1.Invalidate();
+
+                // 更新GroupBox高亮状态
+                if (wasInTopLeft != isMouseInTopLeft)
+                    UpdateGroupBoxHighlight(groupBox1, isMouseInTopLeft);
+
+                if (wasInBottomRight != isMouseInBottomRight)
+                    UpdateGroupBoxHighlight(groupBox2, isMouseInBottomRight);
+
+                if (wasInThirdPoint != isMouseInThirdPoint)
+                    UpdateGroupBoxHighlight(groupBox3, isMouseInThirdPoint);
+            }
+        }
+
+        // 鼠标离开Panel区域
+        private void Panel1_MouseLeave(object sender, EventArgs e)
+        {
+            bool wasInTopLeft = isMouseInTopLeft;
+            bool wasInBottomRight = isMouseInBottomRight;
+            bool wasInThirdPoint = isMouseInThirdPoint;
+
+            isMouseInTopLeft = false;
+            isMouseInBottomRight = false;
+            isMouseInThirdPoint = false;
+
+            panel1.Invalidate();
+
+            // 取消GroupBox高亮
+            if (wasInTopLeft)
+                UpdateGroupBoxHighlight(groupBox1, false);
+            if (wasInBottomRight)
+                UpdateGroupBoxHighlight(groupBox2, false);
+            if (wasInThirdPoint)
+                UpdateGroupBoxHighlight(groupBox3, false);
+        }
+
+        // 检查点是否在圆内
+        private bool IsPointInCircle(Point point, RectangleF circle)
+        {
+            if (circle.IsEmpty) return false;
+
+            float centerX = circle.X + circle.Width / 2;
+            float centerY = circle.Y + circle.Height / 2;
+            float radius = circle.Width / 2;
+
+            float distance = (float)Math.Sqrt(
+                Math.Pow(point.X - centerX, 2) +
+                Math.Pow(point.Y - centerY, 2));
+
+            return distance <= radius;
+        }
+
+        // 更新GroupBox高亮效果
+        private void UpdateGroupBoxHighlight(GroupBox groupBox, bool isHighlighted)
+        {
+            if (groupBox == null) return;
+
+            if (isHighlighted)
+            {
+                // 高亮效果:黄色边框和浅绿色背景
+                groupBox.BackColor = Color.FromArgb(240, 255, 240);
+                groupBox.ForeColor = Color.DarkGreen;
+            }
+            else
+            {
+                // 恢复默认样式
+                groupBox.BackColor = SystemColors.Control;
+                groupBox.ForeColor = SystemColors.ControlText;
+            }
+
+            // 强制刷新GroupBox显示
+            groupBox.Invalidate();
+        }
     }
 }