ifcviewer-full: console-print accumulating coplanar-patch area tool

Adds a click-to-measure area mode triggered by Ctrl+Shift+A.  Each LMB
click expands the picked triangle into its connected coplanar patch
(BFS over shared edges, dot(normal, seed) > 0.9999); re-clicking
removes that patch; Alt+LMB skips expansion for a single triangle.
Picks across different meshes accumulate as separate patches.

ViewportWindow gains pickMeshLocalAt (screen pick → mesh-local hit
via inverse composed transform) and a tool-mode pattern mirroring
the section tool (toggleAreaTool, surfacePickedInTool signal,
areaToolToggled signal, Esc to exit).  Per-mesh adjacency is built
lazily on first pick of each mesh and dropped on tool toggle.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-05-07 12:03:22 +10:00
parent f2b655fcf6
commit 016c278748
6 changed files with 391 additions and 4 deletions
+3
View File
@@ -32,6 +32,7 @@
#include <unordered_map>
#include <vector>
#include "Measurement.h"
#include "ViewportWindow.h"
#include "SceneLoader.h"
@@ -198,6 +199,8 @@ private:
QString pending_camera_;
int pending_benchmark_ = 0;
AreaMeasurement area_measurement_;
};
#endif // MAINWINDOW_H