清理ModelSplitterManager中未使用的辅助函数

删除以下未使用的方法:
- GetAllModelItems: 已被新的深度遍历函数替代
- PreviewSplitByAttribute: 通用属性预览方法已不再使用

这些函数的功能已经被更优化的实现替代,删除以保持代码整洁。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
tian 2025-10-13 11:48:22 +08:00
parent fec15d0805
commit 2e583cb9b6

View File

@ -982,96 +982,6 @@ namespace NavisworksTransport
}
}
/// <summary>
/// 获取所有模型元素(支持深度限制)- 使用统一的深度遍历函数
/// </summary>
private ModelItemCollection GetAllModelItems(int maxDepth = 1)
{
return GetItemsByDepthUnified(maxDepth);
}
/// <summary>
/// 通用属性预览分层方法(基于分组策略模式)
/// </summary>
private List<SplitPreviewResult> PreviewSplitByAttribute(ModelItemCollection items, SplitConfiguration config, IGroupingStrategy strategy)
{
var results = new List<SplitPreviewResult>();
try
{
// 属性分组阶段 (35-70%)
OnProgressChanged(new ProgressChangedEventArgs(40, $"正在分析 {items.Count} 个模型元素的{strategy.GroupTypeName}信息"));
var groups = strategy.GroupItems(items, config);
LogManager.Info($"[分层管理器] {strategy.GroupTypeName}属性检测完成,发现 {groups?.Count ?? 0} 个{strategy.GroupTypeName}分组");
OnProgressChanged(new ProgressChangedEventArgs(70, $"{strategy.GroupTypeName}分组完成,发现 {groups?.Count ?? 0} 个{strategy.GroupTypeName}"));
if (groups != null && groups.Count > 0)
{
// 生成预览结果阶段 (70-85%)
OnProgressChanged(new ProgressChangedEventArgs(75, $"正在生成{strategy.GroupTypeName}预览结果"));
int processedGroups = 0;
foreach (var group in groups.Values)
{
var previewResult = new SplitPreviewResult
{
LayerName = SanitizeLayerName(group.GroupName),
LayerAttribute = GetAttributeDescription(config.Strategy, group.GroupName, group.Metadata),
Items = new ModelItemCollection()
};
// 添加模型项到集合中
if (group.Items != null && group.Items.Count > 0)
{
previewResult.Items.AddRange(group.Items);
LogManager.Info($"[分层管理器] {strategy.GroupTypeName}预览结果已缓存模型项: {strategy.GroupTypeName}='{previewResult.LayerName}', 模型项数量={previewResult.Items.Count}");
}
else
{
LogManager.Warning($"[分层管理器] {strategy.GroupTypeName}预览结果没有模型项: {strategy.GroupTypeName}='{previewResult.LayerName}'");
}
// 添加元数据
previewResult.Metadata["Original" + strategy.GroupTypeName + "Name"] = group.OriginalName;
previewResult.Metadata[strategy.GroupTypeName + "Name"] = group.GroupName;
previewResult.Metadata["MaxDepth"] = config.MaxDepth;
// 复制分组的自定义元数据
foreach (var meta in group.Metadata)
{
previewResult.Metadata[meta.Key] = meta.Value;
}
results.Add(previewResult);
// 更新进度
processedGroups++;
int progressPercent = 75 + (processedGroups * 10 / groups.Count);
OnProgressChanged(new ProgressChangedEventArgs(progressPercent,
$"已处理 {processedGroups}/{groups.Count} 个{strategy.GroupTypeName}分组"));
}
OnProgressChanged(new ProgressChangedEventArgs(85, $"{strategy.GroupTypeName}预览结果生成完成,共 {results.Count} 个分层"));
}
else
{
OnProgressChanged(new ProgressChangedEventArgs(85, $"未检测到{strategy.GroupTypeName}信息"));
LogManager.Warning($"[分层管理器] 未检测到任何{strategy.GroupTypeName}信息");
}
}
catch (Exception ex)
{
LogManager.Error($"[分层管理器] 按{strategy.GroupTypeName}属性预览失败: {ex.Message}", ex);
OnProgressChanged(new ProgressChangedEventArgs(35, $"{strategy.GroupTypeName}分析失败: {ex.Message}"));
throw;
}
return results;
}
/// <summary>
/// 智能遍历分层预览 - 边遍历边检查边停止的新算法
/// 替代原有的预收集模式,大幅提升预览性能
@ -1755,13 +1665,11 @@ namespace NavisworksTransport
progress.Update(0.3);
// 直接使用预览结果中的项目,这些已经是展开的完整节点树
// 不添加任何祖先路径,让 IsolateSpecificItems 自己处理
var itemsToIsolate = preview.Items;
LogManager.Info($"[分层管理器] 准备隔离显示 {itemsToIsolate.Count} 个节点");
// 使用 VisibilityManager.IsolateSpecificItems 隔离显示
// 这个方法会使用缓存优化,效率更高
bool isolateSuccess = VisibilityHelper.IsolateSpecificItems(itemsToIsolate);
if (!isolateSuccess)