mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 06:21:40 +00:00
ifcviewer-full: volume tool with HUD + per-object labels
Mirrors the Area tool's display: HUD shows total volume + object count, each selected object gets a label at its world-AABB centroid showing its individual volume. Gated behind ToolMode::Volume (Ctrl+Shift+V) so it stays out of the way until invoked. Volume is a passive tool — selection works as in None (multi-select, modifier toggle, box-select all keep working). Area / Length still intercept clicks through surfacePickedInTool. Adds volumesPerObject() reusing the same mesh-cached readback path as volumeOfObjects, so the per-object split costs no extra GL readbacks. computeObjectAabb is promoted to public for the centroid lookup. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,15 @@
|
||||
double volumeOfObjects(ViewportWindow& vp,
|
||||
const std::vector<uint32_t>& object_ids);
|
||||
|
||||
// Per-object volumes (m³). Same algorithm as volumeOfObjects but
|
||||
// attributed per id rather than summed. Skips ids that don't resolve
|
||||
// to a live instance, so the result may be shorter than the input.
|
||||
// Used by MainWindow's volume readout to drive both the total HUD and
|
||||
// the per-object overlay labels.
|
||||
std::vector<std::pair<uint32_t, double>>
|
||||
volumesPerObject(ViewportWindow& vp,
|
||||
const std::vector<uint32_t>& object_ids);
|
||||
|
||||
// Click-to-accumulate area measurement. Each pick resolves the screen
|
||||
// click to a (instance, triangle) using ViewportWindow's primitives,
|
||||
// expands it into the connected coplanar patch (BFS over shared edges,
|
||||
|
||||
Reference in New Issue
Block a user