From 69765e092b79e6aef7fec9e3bd50b982f2086044 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Thu, 19 Feb 2026 14:52:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=B1=BB=E5=88=AB=E7=9A=84=E9=9A=9C=E7=A2=8D=E7=89=A9=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Core/Properties/CategoryAttributeManager.cs | 15 ++++++--------- src/PathPlanning/ChannelBasedGridBuilder.cs | 6 +++--- src/PathPlanning/RailGeometryHelper.cs | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/Core/Properties/CategoryAttributeManager.cs b/src/Core/Properties/CategoryAttributeManager.cs index 95be22d..267bbea 100644 --- a/src/Core/Properties/CategoryAttributeManager.cs +++ b/src/Core/Properties/CategoryAttributeManager.cs @@ -1331,7 +1331,7 @@ namespace NavisworksTransport // 首先检查是否有物流属性 if (CategoryAttributeManager.HasLogisticsAttributes(item)) { - var elementType = CategoryAttributeManager.GetLogisticsElementType(item); + var categoryId = CategoryAttributeManager.GetCategoryId(item); var isTraversable = CategoryAttributeManager.GetLogisticsPropertyValue(item, CategoryAttributeManager.LogisticsProperties.TRAVERSABLE); // 如果明确标记为不可通行,则为障碍物 @@ -1340,8 +1340,8 @@ namespace NavisworksTransport return true; } - // 如果明确标记为障碍物类型,则为障碍物 - if (elementType == CategoryAttributeManager.LogisticsElementType.障碍物) + // 使用类别定义检查是否为障碍物(支持自定义类别) + if (!CategoryAttributeManager.IsCategoryTraversable(categoryId)) { return true; } @@ -1425,7 +1425,7 @@ namespace NavisworksTransport // 首先检查是否有物流属性 if (CategoryAttributeManager.HasLogisticsAttributes(item)) { - var elementType = CategoryAttributeManager.GetLogisticsElementType(item); + var categoryId = CategoryAttributeManager.GetCategoryId(item); var isTraversable = CategoryAttributeManager.GetLogisticsPropertyValue(item, CategoryAttributeManager.LogisticsProperties.TRAVERSABLE); // 如果明确标记为可通行,则为通道 @@ -1434,11 +1434,8 @@ namespace NavisworksTransport return true; } - // 特定的可通行类型 - if (elementType == CategoryAttributeManager.LogisticsElementType.通道 || - elementType == CategoryAttributeManager.LogisticsElementType.门 || - elementType == CategoryAttributeManager.LogisticsElementType.电梯 || - elementType == CategoryAttributeManager.LogisticsElementType.楼梯) + // 使用类别定义检查是否可通行(支持自定义类别) + if (CategoryAttributeManager.IsCategoryTraversable(categoryId)) { return true; } diff --git a/src/PathPlanning/ChannelBasedGridBuilder.cs b/src/PathPlanning/ChannelBasedGridBuilder.cs index 0bba1b4..3d82c76 100644 --- a/src/PathPlanning/ChannelBasedGridBuilder.cs +++ b/src/PathPlanning/ChannelBasedGridBuilder.cs @@ -75,17 +75,17 @@ namespace NavisworksTransport.PathPlanning // 获取通道 var channels = CategoryAttributeManager.GetLogisticsItemsByType( - CategoryAttributeManager.LogisticsElementType.通道); + "通道"); channelItems.AddRange(channels); // 获取楼梯 var stairs = CategoryAttributeManager.GetLogisticsItemsByType( - CategoryAttributeManager.LogisticsElementType.楼梯); + "楼梯"); channelItems.AddRange(stairs); // 获取电梯 var elevators = CategoryAttributeManager.GetLogisticsItemsByType( - CategoryAttributeManager.LogisticsElementType.电梯); + "电梯"); channelItems.AddRange(elevators); if (!channelItems.Any()) diff --git a/src/PathPlanning/RailGeometryHelper.cs b/src/PathPlanning/RailGeometryHelper.cs index b4fff76..171cbf2 100644 --- a/src/PathPlanning/RailGeometryHelper.cs +++ b/src/PathPlanning/RailGeometryHelper.cs @@ -417,7 +417,7 @@ namespace NavisworksTransport.PathPlanning LogManager.Info("[空轨] 开始提取所有空轨模型的基准路径"); // 使用现成的辅助方法获取所有空轨模型 - var railItems = CategoryAttributeManager.GetLogisticsItemsByType(CategoryAttributeManager.LogisticsElementType.空轨); + var railItems = CategoryAttributeManager.GetLogisticsItemsByType("空轨"); if (railItems == null || railItems.Count == 0) {