mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 19:07:57 +00:00
ifcviewer-full: print object volume on click via lazy GPU readback
Adds neutral primitives on ViewportWindow (readbackMeshTriangles, findInstance) so consumers can compute per-object geometry queries without the library retaining a CPU triangle copy. Measurement.cpp in ifcviewer-full uses them to sum signed-tetrahedra in mesh-local space, weighted by |det(placement_3x3)| per instance for mapped-item scaling. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "AppSettings.h"
|
||||
#include "Federation.h"
|
||||
#include "FederationSettingsDialog.h"
|
||||
#include "Measurement.h"
|
||||
#include "ModelTransformationDialog.h"
|
||||
#include "SettingsWindow.h"
|
||||
#include "LodBuilder.h"
|
||||
@@ -871,6 +872,11 @@ void MainWindow::onObjectPicked(uint32_t object_id) {
|
||||
}
|
||||
|
||||
populateProperties(object_id);
|
||||
|
||||
if (object_id != 0) {
|
||||
const double v = volumeOfObjects(*viewport_, {object_id});
|
||||
qInfo("Volume of object %u: %.6f m^3", object_id, v);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::onTreeSelectionChanged() {
|
||||
|
||||
Reference in New Issue
Block a user