refactor(vtk): 帘面渲染改异步走 loadSection(QPointer+generation守护,对齐volume路径)(①.3)

This commit is contained in:
gaozheng 2026-06-16 18:29:45 +08:00
parent 2d155c864c
commit 2934bacd34
1 changed files with 13 additions and 1 deletions

View File

@ -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_) {