From 2934bacd34cd4b79127706e7517a6d92d085fd67 Mon Sep 17 00:00:00 2001 From: gaozheng Date: Tue, 16 Jun 2026 18:29:45 +0800 Subject: [PATCH] =?UTF-8?q?refactor(vtk):=20=E5=B8=98=E9=9D=A2=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E6=94=B9=E5=BC=82=E6=AD=A5=E8=B5=B0=20loadSection(QPo?= =?UTF-8?q?inter+generation=E5=AE=88=E6=8A=A4,=E5=AF=B9=E9=BD=90volume?= =?UTF-8?q?=E8=B7=AF=E5=BE=84)(=E2=91=A0.3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controller/VtkSceneController.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/controller/VtkSceneController.cpp b/src/controller/VtkSceneController.cpp index 20206e2..cb9bfc1 100644 --- a/src/controller/VtkSceneController.cpp +++ b/src/controller/VtkSceneController.cpp @@ -103,7 +103,19 @@ void VtkSceneController::rebuildInternal() { }); } if (showCurtain_) { - for (const auto& dsId : checkedDs_) view_.addCurtain(grid(dsId), colorScale(dsId)); + for (const auto& dsId : checkedDs_) { + sceneRepo_.loadSection( + dsId, + [self, gen](data::SectionData s) { + if (!self || gen != self->rebuildGeneration_) return; // 已析构/迟到:丢弃 + self->view_.addCurtain(s.grid, s.scale); + if (!self->inRebuild_) self->view_.render(false); // 同步路径由末尾统一 render + }, + [self, gen](const std::string& m) { + if (!self || gen != self->rebuildGeneration_) return; + emit self->loadFailed(QString::fromStdString(m)); + }); + } } if (showVoxel_) { for (const auto& dsId : checkedDs_) {