ifcviewer-web: streaming loading bar (metadata → geometry progress)

Users had no feedback during the seconds before/while a model streams. Add a
top progress strip + caption driven by the streaming state:
- "Loading model… N MB" while the critical metadata downloads (no chunks yet),
- "Loading geometry — R / T chunks · N MB" as chunks go resident,
- "Loaded — T chunks · N MB", then it hides.

ViewportCore::streamingProgress(resident, total) sums chunk residency across
models; main_web exports ifcv_chunks_resident_c / ifcv_chunks_total_c for
shell.html to poll each RAF. The EM_JS range reader accumulates
Module.__ifcvBytesLoaded so the caption can show MB downloaded. Shown only for
streamed loads (?model= URL / picked file), not the embedded sample.

6/6 web smoke pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-07-01 08:54:42 +10:00
parent 41a85a70ba
commit 13ec2be807
5 changed files with 86 additions and 2 deletions
+5
View File
@@ -386,6 +386,11 @@ public:
void beginWebChunkLoad(std::uint32_t model_id, std::size_t chunk_idx);
#endif
// Streaming progress for a loading UI: resident vs total streaming chunks
// across all models. total == 0 means no streaming model is set up yet
// (still in the metadata phase). Cheap; safe to poll every frame.
void streamingProgress(int& resident_chunks, int& total_chunks) const;
// Direct-load (bonsai-side) entry points. Bonsai's SceneLoader feeds
// the viewer one mesh + one instance at a time, then calls
// finalizeModel once everything's staged. The staging map lives on