mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 11:20:21 +00:00
ifcviewer: move buildModelBindGroup + captureNextFrameToPng setter into ViewportCore (#84-v)
Two small helpers + the screenshot-quit flag flip across; the render- side capture encode + readback + PNG save itself stays in VW (those need a stbi-style PNG writer to replace QImage::save before they can move, and that's its own commit). VW keeps tiny forwarders so bonsai's SceneLoader + the CLI screenshot path don't see the move. The streaming sync-fallback gate already reads the core-side pending_screenshot_path_, so capture timing is unchanged.
This commit is contained in:
@@ -4582,3 +4582,24 @@ void ViewportCore::configureSurface(int width_px, int height_px) {
|
||||
edge_bind_group_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// Small cross-chunk + capture helpers (#84-v)
|
||||
// ===========================================================================
|
||||
|
||||
void ViewportCore::buildModelBindGroup(ModelGpuData& m) {
|
||||
if (!m.mesh_storage || !m.instance_storage) {
|
||||
// Empty model — no chunks, no bind groups; the draw loop will skip.
|
||||
return;
|
||||
}
|
||||
for (std::size_t ci = 0; ci < m.chunks.size(); ++ci) {
|
||||
buildChunkBindGroup(m, ci);
|
||||
}
|
||||
}
|
||||
|
||||
void ViewportCore::captureNextFrameToPng(const std::string& path,
|
||||
bool quit_after) {
|
||||
pending_screenshot_path_ = path;
|
||||
pending_screenshot_quit_ = quit_after;
|
||||
host_->requestFrame();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user