From 1a379eebeaea426823f45460ee7fac1b2f5a1cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BC=9F?= Date: Wed, 29 Apr 2026 09:00:17 +0800 Subject: [PATCH] =?UTF-8?q?BGA=E6=A3=80=E6=B5=8B:=20ROI=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E3=80=81=E6=8B=96=E6=8B=BD=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=81=E6=B8=85=E9=99=A4=E6=B5=8B=E9=87=8F?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E6=B8=85=E9=99=A4ROI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XplorePlane/Assets/Icons/polygon.png | Bin 0 -> 682 bytes .../ImageProcessing/BgaDetectionViewModel.cs | 10 ++++-- .../ImageProcessing/BgaDetectionPanel.xaml | 34 +++++++++++++++++- .../Views/Main/ViewportPanelView.xaml.cs | 2 ++ 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 XplorePlane/Assets/Icons/polygon.png diff --git a/XplorePlane/Assets/Icons/polygon.png b/XplorePlane/Assets/Icons/polygon.png new file mode 100644 index 0000000000000000000000000000000000000000..a9325a0e2d39d5791c588ef48296964efbd29069 GIT binary patch literal 682 zcmV;b0#*HqP)DT_b; z{S!#az+$o3%x1HFs?6u}3bLF|r<2$TM+pGv_{WtpzhMZ6yH4d(o^B$w|gP?!?vv;$V6>0Rg>u zOdkMto_5CM@pya@3#Ln!GkUKD1h8uuBYnK}m=0^V+wHDcuh*+;9)(9hqG!ovUA!); z%p|h_A`=|N+SRiJgqcR4eeqmycU+dG9;bI9Edhtw35>HZp6k>dpU>w5v%odSS78ZY z!$gl>nPT|64M(7vHLoktEdgc6#ZL=-*^iVZ0H>OEzWNf%aH2_Oq6 zFgEEz1bTU_QR+Z#iABsdyH)~J99ow0={031f6)jVNGAc73XZ~L0TGzL;1O$5+H)4Z-sG1(1n^WKxATw2es;ff&e;{f`rfk^2S!0RR796lwSX000I_L_t&o0IrdWP)z{# QssI2007*qoM6N<$g6@_mx&QzG literal 0 HcmV?d00001 diff --git a/XplorePlane/ViewModels/ImageProcessing/BgaDetectionViewModel.cs b/XplorePlane/ViewModels/ImageProcessing/BgaDetectionViewModel.cs index 914204a..2db8a1e 100644 --- a/XplorePlane/ViewModels/ImageProcessing/BgaDetectionViewModel.cs +++ b/XplorePlane/ViewModels/ImageProcessing/BgaDetectionViewModel.cs @@ -113,11 +113,15 @@ namespace XplorePlane.ViewModels.ImageProcessing _canvas.ROIItems.Add(_roiShape); _canvas.SelectedROI = _roiShape; - // 手动注册 CollectionChanged + // 手动注册 CollectionChanged(仅在添加/删除顶点时更新 Adorner,拖拽不触发) _roiShape.Points.CollectionChanged += (s, e) => { - _canvas.SelectedROI = null; - _canvas.SelectedROI = _roiShape; + if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add || + e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove) + { + _canvas.SelectedROI = null; + _canvas.SelectedROI = _roiShape; + } }; // 禁用右键菜单(参考点点距方式) diff --git a/XplorePlane/Views/ImageProcessing/BgaDetectionPanel.xaml b/XplorePlane/Views/ImageProcessing/BgaDetectionPanel.xaml index c56120a..a2b6593 100644 --- a/XplorePlane/Views/ImageProcessing/BgaDetectionPanel.xaml +++ b/XplorePlane/Views/ImageProcessing/BgaDetectionPanel.xaml @@ -14,7 +14,39 @@ - + + + + + + diff --git a/XplorePlane/Views/Main/ViewportPanelView.xaml.cs b/XplorePlane/Views/Main/ViewportPanelView.xaml.cs index 5a16883..c8ced63 100644 --- a/XplorePlane/Views/Main/ViewportPanelView.xaml.cs +++ b/XplorePlane/Views/Main/ViewportPanelView.xaml.cs @@ -137,6 +137,8 @@ namespace XplorePlane.Views private void ClearAllMeasurements_Click(object sender, RoutedEventArgs e) { RoiCanvas.ClearMeasurements(); + RoiCanvas.ROIItems?.Clear(); + RoiCanvas.SelectedROI = null; if (DataContext is ViewportPanelViewModel vm) vm.ResetMeasurementState(); SetStatus("已清除所有测量");