mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
ifcviewer-web: load many models from the URL + per-model loading panel
Query string: auto-load a whole federation, not one model. Accepts repeated
params (?model=a&model=b&…) and/or a comma list (?models=a,b,c); each becomes
its own streamed byte-source, clearing the embedded sample once then streaming
concurrently into one scene. A failed URL is reported without aborting the rest.
Loading UI: the bare aggregate chunk count didn't reveal the federation state,
so surface per-model progress. ViewportCore::streamingModelCount() +
streamingModelProgress(idx,…) (ordered by model_id = load order) feed
main_web's ifcv_model_count_c / ifcv_model_{resident,total}_c. shell.html draws
a panel: "Loading N models — X done · Y streaming · Z waiting · N MB" plus one
segment per model (blue fill while streaming, green when resident, grey while
its metadata is still pending) — so parallel loading and how many remain are
visible at a glance.
Verified: 10 models from a 10x ?model= query stream in parallel; the panel
steps 10 waiting → streaming → all done. 111/111 unit + 6/6 web smoke pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -222,6 +222,20 @@ extern "C" EMSCRIPTEN_KEEPALIVE int ifcv_chunks_total_c() {
|
||||
int r = 0, t = 0; g_app->core.streamingProgress(r, t); return t;
|
||||
}
|
||||
|
||||
// Per-model progress for the federation loading panel: how many models are in
|
||||
// the scene, and the idx-th model's resident/total chunks (idx ordered by load).
|
||||
extern "C" EMSCRIPTEN_KEEPALIVE int ifcv_model_count_c() {
|
||||
return g_app ? g_app->core.streamingModelCount() : 0;
|
||||
}
|
||||
extern "C" EMSCRIPTEN_KEEPALIVE int ifcv_model_resident_c(int idx) {
|
||||
if (!g_app) return 0;
|
||||
int r = 0, t = 0; g_app->core.streamingModelProgress(idx, r, t); return r;
|
||||
}
|
||||
extern "C" EMSCRIPTEN_KEEPALIVE int ifcv_model_total_c(int idx) {
|
||||
if (!g_app) return 0;
|
||||
int r = 0, t = 0; g_app->core.streamingModelProgress(idx, r, t); return t;
|
||||
}
|
||||
|
||||
int main(int /*argc*/, char** /*argv*/) {
|
||||
Log::info() << "ifcviewer-web: starting";
|
||||
g_app = new AppState();
|
||||
|
||||
Reference in New Issue
Block a user