From 99c6d17795b60e2d1072a2036844b1f68f3c50fa Mon Sep 17 00:00:00 2001 From: sladro Date: Fri, 19 Sep 2025 16:40:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=BAshell-analysis=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=B7=BB=E5=8A=A0=E6=8A=95=E7=A5=A8=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在FeatureDeletion结构体中添加vote_count字段,记录多方向投影分析中的投票数量 - 在AnalyzeShellFeaturesEnhanced函数中填充投票数据,利用visibilityVotes映射 - 更新JSON响应,为safeDeletions、suggestedDeletions、preserveList添加voteCount字段 - 提供模型外表面可见性程度的量化指标,增强分析结果的透明度 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CreoManager.cpp | 4 ++++ CreoManager.h | 1 + MFCCreoDll.cpp | 9 ++++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CreoManager.cpp b/CreoManager.cpp index b7bda22..83437ee 100644 --- a/CreoManager.cpp +++ b/CreoManager.cpp @@ -1725,6 +1725,10 @@ CreoManager::ShellAnalysisResult CreoManager::AnalyzeShellFeaturesEnhanced(const deletion.part_path = ""; // Not available in current analysis deletion.component_type = "COMPONENT"; + // Set vote count from projection analysis + auto votesIter = visibilityVotes.find(item.feature_id); + deletion.vote_count = (votesIter != visibilityVotes.end()) ? votesIter->second : 0; + if (item.confidence >= 0.8) { // Safe deletion - high confidence internal components result.safe_deletions.push_back(deletion); diff --git a/CreoManager.h b/CreoManager.h index 0e527e0..3be65ef 100644 --- a/CreoManager.h +++ b/CreoManager.h @@ -260,6 +260,7 @@ public: std::string part_path; std::string component_type = "FEATURE"; std::string volume_units = "percentage"; // Added to clarify units + int vote_count = 0; // Number of votes this component received in multi-directional projection analysis }; struct EstimatedReduction { diff --git a/MFCCreoDll.cpp b/MFCCreoDll.cpp index 00a8d14..4faf5fd 100644 --- a/MFCCreoDll.cpp +++ b/MFCCreoDll.cpp @@ -995,7 +995,8 @@ HttpResponse ShellAnalysisHandler(const HttpRequest& request) { << "\"volumeReduction\": " << deletion.volume_reduction << "," << "\"partFile\": \"" << EscapeJsonString(deletion.part_file) << "\"," << "\"partPath\": \"" << EscapeJsonString(deletion.part_path) << "\"," - << "\"componentType\": \"" << EscapeJsonString(deletion.component_type) << "\"" + << "\"componentType\": \"" << EscapeJsonString(deletion.component_type) << "\"," + << "\"voteCount\": " << deletion.vote_count << "}"; } @@ -1016,7 +1017,8 @@ HttpResponse ShellAnalysisHandler(const HttpRequest& request) { << "\"volumeReduction\": " << deletion.volume_reduction << "," << "\"partFile\": \"" << EscapeJsonString(deletion.part_file) << "\"," << "\"partPath\": \"" << EscapeJsonString(deletion.part_path) << "\"," - << "\"componentType\": \"" << EscapeJsonString(deletion.component_type) << "\"" + << "\"componentType\": \"" << EscapeJsonString(deletion.component_type) << "\"," + << "\"voteCount\": " << deletion.vote_count << "}"; } @@ -1037,7 +1039,8 @@ HttpResponse ShellAnalysisHandler(const HttpRequest& request) { << "\"volumeReduction\": " << preserve.volume_reduction << "," << "\"partFile\": \"" << EscapeJsonString(preserve.part_file) << "\"," << "\"partPath\": \"" << EscapeJsonString(preserve.part_path) << "\"," - << "\"componentType\": \"" << EscapeJsonString(preserve.component_type) << "\"" + << "\"componentType\": \"" << EscapeJsonString(preserve.component_type) << "\"," + << "\"voteCount\": " << preserve.vote_count << "}"; }