ifcviewer: move composeInstanceFromPlacement into ViewportCore (#84-d)

First method-body migration. composeInstanceFromPlacement composes the
federated-false-origin × model-transformation × coordinate-operation ×
placement chain and re-derives the world AABB; it's a small,
self-contained method that only reads scene state and one matrix.

Moved:
  Eigen::Matrix4d federated_false_origin_meters_   (storage → core_)
  void composeInstanceFromPlacement(InstanceCpu&, ...) (body → core_)

ViewportWindow keeps:
  - alias reference to federated_false_origin_meters_ (existing
    setFederatedFalseOrigin call site still writes through it)
  - no method declaration — internal callers route through core_

Internal caller (recomposeAndUploadModel) now invokes
core_.composeInstanceFromPlacement; once recomposeAndUploadModel
itself moves into ViewportCore the call shortens back.

Pattern for the rest of #84: state moves, then method body moves,
then internal callers update. Each commit leaves desktop / bonsai /
web green and tests 100/100. This is one of many such steps.
This commit is contained in:
Dion Moult
2026-06-05 13:32:19 +10:00
parent 303f903a10
commit ad6822ac85
4 changed files with 63 additions and 36 deletions
+5 -3
View File
@@ -624,8 +624,9 @@ private:
// in double; the cast to float happens last so large IFC placements
// get cancelled by the federation false origin before precision is
// narrowed. Mirrors GL ViewportWindow::composeInstanceFromPlacement.
void composeInstanceFromPlacement(InstanceCpu& inst,
const ModelGpuData& m) const;
// Implementation lives in ViewportCore now (#84-d); this declaration
// stayed during the move and forwards to core_ — once every internal
// caller routes through ViewportCore directly the forwarder goes away.
// Walk every instance of `model_id`, recompose its transform from the
// current federation matrices, refresh per-chunk world AABBs, and
@@ -1120,7 +1121,8 @@ private:
// FederatedFalseOrigin matrix, in metres. Default identity. Stored
// but not yet applied to per-instance composed transforms — the
// recompose pass arrives with the federation-load OOM work.
Eigen::Matrix4d federated_false_origin_meters_ = Eigen::Matrix4d::Identity();
// Federation false-origin alias (storage in core_).
Eigen::Matrix4d& federated_false_origin_meters_;
// Per-frame LOD selection counts, mutated from cullModelCpuCompute
// and reset after the [frame] heartbeat prints them. Keeps an eye