From a7edfa5c78ded2b43175e2d7501880cf57b158a9 Mon Sep 17 00:00:00 2001 From: gaozheng Date: Tue, 16 Jun 2026 11:14:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(vtk):=20=E8=BD=B4=E5=90=91=E5=88=87?= =?UTF-8?q?=E7=89=87=E7=A6=81=E7=94=A8=E6=97=8B=E8=BD=AC(G22-24=20?= =?UTF-8?q?=E8=A7=92=E5=BA=A6=E4=B8=8D=E8=83=BD=E5=86=8D=E8=B0=83=E6=95=B4?= =?UTF-8?q?),=E4=BB=85=E4=BB=BB=E6=84=8F=E5=88=87=E7=89=87=E5=8F=AF?= =?UTF-8?q?=E8=BD=AC(F25)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 上一版让所有切片都能拖边缘旋转,违反 G22-24(上下/前后/左右角度不能再调整)。 修: 轴向切片 SetMarginSizeX/Y(0) 去掉旋转抓取区→只能移动不能转; 任意切片(Oblique)保留默认 margin→可拖边缘旋转(F25)。ctest 221/221 --- src/render/interact/SliceTool.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/render/interact/SliceTool.cpp b/src/render/interact/SliceTool.cpp index 19b92ce..033fa9a 100644 --- a/src/render/interact/SliceTool.cpp +++ b/src/render/interact/SliceTool.cpp @@ -78,10 +78,15 @@ SliceTool::SliceTool(vtkImageData* image, vtkRenderWindowInteractor* interactor, } } - // 照原型配置(f57291a):左键拖动=移动切面(默认左键是窗位调整,无用);中键=取值光标。 - // 切面边缘(margins)拖动可旋转切面 → 任意切片"可任意调整角度"(F25)。 + // 左键拖动=移动切面(默认左键是窗位调整,无用);中键=取值光标。 widget_->SetLeftButtonAction(vtkImagePlaneWidget::VTK_SLICE_MOTION_ACTION); widget_->SetMiddleButtonAction(vtkImagePlaneWidget::VTK_CURSOR_ACTION); + // 旋转只允许"任意切片"(F25 可任意调整);轴向(上下/前后/左右)角度固定(G22-24 角度不能再调整): + // 把切面边缘(margins, 旋转抓取区)设为 0 → 抓哪里都只移动、不旋转。 + if (axis_ != SliceAxis::Oblique) { + widget_->SetMarginSizeX(0.0); + widget_->SetMarginSizeY(0.0); + } widget_->On(); // 保持 widget 交互开启:任意切片可拖动调整角度/位置(F25 '可任意调整')。