feat(app): 创建异常按所在切片是否已保存挂体/切片(resolveAnomalyMount, Task11 Step3)

This commit is contained in:
gaozheng 2026-06-24 20:49:19 +08:00
parent 07be3aef21
commit 8b57dd9679
1 changed files with 5 additions and 2 deletions

View File

@ -500,14 +500,17 @@ void buildWorkbench(QMainWindow& window, geopro::data::LocalSampleRepository& re
const ri::Vec3 e2{{p2[0] - o[0], p2[1] - o[1], p2[2] - o[2]}}; const ri::Vec3 e2{{p2[0] - o[0], p2[1] - o[1], p2[2] - o[2]}};
const ri::Vec3 normal = ri::normalize(ri::cross(e1, e2)); const ri::Vec3 normal = ri::normalize(ri::cross(e1, e2));
const std::string volId = sceneView->currentVolumeDsId(); const std::string volId = sceneView->currentVolumeDsId();
// 异常归属spec §8当前选中切片已保存selectedSliceDsId 非空)→挂该切片;临时切片→挂体。
const std::string savedSliceId = interactionMgr->selectedSliceDsId();
anomalyDrawTool->start( anomalyDrawTool->start(
o, normal, o, normal,
[&window, sceneView, scene3dRepo, renderWindowPtr, refreshAnomalies, volId, [&window, sceneView, scene3dRepo, renderWindowPtr, refreshAnomalies, volId,
normal, o](const std::vector<ri::Vec3>& worldPts) { savedSliceId, normal, o](const std::vector<ri::Vec3>& worldPts) {
// 草稿异常:先临时渲染(让用户在对话框前看到所画,且截图含异常)。 // 草稿异常:先临时渲染(让用户在对话框前看到所画,且截图含异常)。
geopro::core::Anomaly a; geopro::core::Anomaly a;
a.markType = geopro::core::AnomalyMarkType::Polygon; a.markType = geopro::core::AnomalyMarkType::Polygon;
a.remarkSourceId = volId; // Step1 暂挂体Step3 按所在切片是否已保存改 resolveAnomalyMount a.remarkSourceId =
geopro::core::resolveAnomalyMount(!savedSliceId.empty(), savedSliceId, volId);
a.lineColor = "#ff3030"; a.lineColor = "#ff3030";
a.lineWidth = 2.0; a.lineWidth = 2.0;
a.dashed = false; a.dashed = false;