ifcviewer: move const-lookup methods into ViewportCore (#84-e)

Move two pure-read methods (no GPU touch, no Qt) that the bonsai
measurement / federation-origin paths use:

  bool findInstance(uint32_t, InstanceLookup&)        const
  bool firstGeometryPointWorldM(uint32_t, Vector3d&)  const

ViewportWindow keeps both public-API method names — they now forward
to core_ for the implementation so existing callers in
bonsaiviewer/Measurement.cpp + Federation hooks don't have to change.
The InstanceLookup type also stays a `using` alias in ViewportWindow
(was added in #74).

Both methods were already de-Qt'd (`findInstance` delegates to
InstanceCompose; `firstGeometryPointWorldM` is pure Eigen). The move
is a straight transplant — no behaviour change.

Builds: desktop / bonsai / web all green. Tests 100/100.
This commit is contained in:
Dion Moult
2026-06-05 13:54:28 +10:00
parent ad6822ac85
commit b2fe9c4a71
3 changed files with 51 additions and 28 deletions
+13
View File
@@ -41,6 +41,7 @@
#include <unordered_map>
#include "BufferPool.h"
#include "InstanceCompose.h"
#include "InstancedGeometry.h"
#include "ModelGpuData.h"
#include "StreamingThread.h"
@@ -68,6 +69,18 @@ public:
void composeInstanceFromPlacement(InstanceCpu& inst,
const ModelGpuData& m) const;
// Cross-model object_id lookup. Delegates to
// InstanceCompose::findInstanceInModels; the wrapper exists so
// callers don't have to know about the underlying map of models.
bool findInstance(uint32_t object_id,
InstanceCompose::InstanceLookup& out) const;
// A point that actually lies on the model's first instance — used
// by the federation false-origin guess on first geometry. Pure
// read of models_gpu_; no GPU touch.
bool firstGeometryPointWorldM(uint32_t model_id,
Eigen::Vector3d& out) const;
// Friend access for ViewportWindow's reference proxies. As each
// render method moves into ViewportCore it stops needing these
// (it touches the fields directly); once everything has migrated