From 4aa62864f34fd54a4ddab588ff89ca1f2f37ee45 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Wed, 28 Jan 2026 21:47:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=87=E6=8D=A2=E7=BA=BF?= =?UTF-8?q?=E6=A1=86=E6=A8=A1=E5=BC=8F=E7=9A=84=E5=8A=9F=E8=83=BD=EF=BC=88?= =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E6=80=A7=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/requirement/todo_features.md | 4 ++ .../ViewModels/AnimationControlViewModel.cs | 47 +++++++++++++++++++ src/UI/WPF/Views/AnimationControlView.xaml | 3 ++ 3 files changed, 54 insertions(+) diff --git a/doc/requirement/todo_features.md b/doc/requirement/todo_features.md index 774e539..8e533a9 100644 --- a/doc/requirement/todo_features.md +++ b/doc/requirement/todo_features.md @@ -2,6 +2,10 @@ ## 功能点 +### [2026/1/28] + +1. [ ] (优化)将ViewPonit的RenderStyle改成Shaded,以免影响高亮(考虑在显示碰撞时,改成Wireframe) + ### [2026/1/26] 1. [x] (优化)完善碰撞报告截图保存机制,自动导出html报告。 diff --git a/src/UI/WPF/ViewModels/AnimationControlViewModel.cs b/src/UI/WPF/ViewModels/AnimationControlViewModel.cs index 1d6a838..168bfc3 100644 --- a/src/UI/WPF/ViewModels/AnimationControlViewModel.cs +++ b/src/UI/WPF/ViewModels/AnimationControlViewModel.cs @@ -801,6 +801,7 @@ namespace NavisworksTransport.UI.WPF.ViewModels public ICommand ClearManualHighlightsCommand { get; private set; } public ICommand HighlightPrecomputedCollisionResultsCommand { get; private set; } public ICommand ClearPrecomputedCollisionHighlightsCommand { get; private set; } + public ICommand ToggleWireframeModeCommand { get; private set; } public ICommand HighlightClashDetectiveResultsCommand { get; private set; } public ICommand ClearClashDetectiveHighlightsCommand { get; private set; } @@ -967,6 +968,7 @@ namespace NavisworksTransport.UI.WPF.ViewModels ClearManualHighlightsCommand = new RelayCommand(ExecuteClearManualHighlights, () => HasManualCollisionTargets); HighlightPrecomputedCollisionResultsCommand = new RelayCommand(ExecuteHighlightPrecomputedCollisionResults, () => HasClashDetectiveResults); ClearPrecomputedCollisionHighlightsCommand = new RelayCommand(ExecuteClearPrecomputedCollisionHighlights, () => HasClashDetectiveResults); + ToggleWireframeModeCommand = new RelayCommand(ExecuteToggleWireframeMode); HighlightClashDetectiveResultsCommand = new RelayCommand(ExecuteHighlightClashDetectiveResults, () => HasClashDetectiveResults); ClearClashDetectiveHighlightsCommand = new RelayCommand(ExecuteClearClashDetectiveHighlights, () => HasClashDetectiveResults); RefreshClashDetectiveResultsCommand = new RelayCommand(ExecuteRefreshClashDetectiveResults); @@ -2018,6 +2020,51 @@ namespace NavisworksTransport.UI.WPF.ViewModels UpdateMainStatus("已清除预计算碰撞结果高亮"); } + private void ExecuteToggleWireframeMode() + { + try + { + var doc = Application.ActiveDocument; + if (doc == null || doc.IsClear) + { + LogManager.Warning("[线框模式] 没有活动的文档"); + UpdateMainStatus("无法切换线框模式:没有活动文档"); + return; + } + + // 创建当前视角的副本 + var newViewpoint = doc.CurrentViewpoint.Value.CreateCopy(); + + // 判断当前是否已经是线框模式 + bool isWireframe = (newViewpoint.RenderStyle == ViewpointRenderStyle.Wireframe); + + if (!isWireframe) + { + // 切换到线框模式 + newViewpoint.RenderStyle = ViewpointRenderStyle.Wireframe; + + LogManager.Info("[线框模式] 视图模式已切换为Wireframe"); + UpdateMainStatus("已切换到线框模式"); + } + else + { + // 切换回着色模式 + newViewpoint.RenderStyle = ViewpointRenderStyle.Shaded; + + LogManager.Info("[线框模式] 视图模式已切换回Shaded"); + UpdateMainStatus("已切换回着色模式"); + } + + // 应用修改后的视角 + doc.CurrentViewpoint.CopyFrom(newViewpoint); + } + catch (Exception ex) + { + LogManager.Error($"切换线框模式失败: {ex.Message}", ex); + UpdateMainStatus("切换线框模式失败"); + } + } + private void ExecuteHighlightClashDetectiveResults() { if (string.IsNullOrEmpty(_clashIntegration?.CurrentTestName)) diff --git a/src/UI/WPF/Views/AnimationControlView.xaml b/src/UI/WPF/Views/AnimationControlView.xaml index a64c48b..a86fe3b 100644 --- a/src/UI/WPF/Views/AnimationControlView.xaml +++ b/src/UI/WPF/Views/AnimationControlView.xaml @@ -389,6 +389,9 @@ NavisworksTransport 检测动画页签视图 - 采用与类别设置和分层管 Command="{Binding ClearPrecomputedCollisionHighlightsCommand}" IsEnabled="{Binding HasClashDetectiveResults}" Style="{StaticResource SecondaryButtonStyle}"/> +