Unify sidecar production via SidecarBuilder

Renamed HeadlessSidecarBuilder to SidecarBuilder and reused it for live
loads. SceneLoader now constructs one per stream load, forwards meshReady
/instanceReady chunks alongside the viewport upload, and finalizes +
writes the sidecar at onStreamerFinished — no more GPU readback path
via ViewportWindow::snapshotModel (removed). Same code path now produces
sidecars for both live loads and the .rdbview offline export.

Sidecar use is opt-in per direction via SceneLoader::setShouldReadSidecar
and setShouldWriteSidecar; both default off so embedders that don't want
caching get a pure-streaming loader. ifcviewer-full and ifcviewer-minimal
opt in.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-05-16 21:11:27 +10:00
parent 5f467cd8fa
commit 8b8fafa698
13 changed files with 212 additions and 210 deletions
+2
View File
@@ -39,6 +39,8 @@ MinimalWindow::MinimalWindow(QWidget* parent)
statusBar()->addPermanentWidget(stats_label_);
loader_ = new SceneLoader(viewport_, this);
loader_->setShouldReadSidecar(true);
loader_->setShouldWriteSidecar(true);
connect(loader_, &SceneLoader::loadStarted,
this, &MinimalWindow::onLoadStarted);
connect(loader_, &SceneLoader::loadedFromSidecar,