ifcviewer: wire FederatedFalseOrigin / ModelTransformation to viewport

Federation grows three granular signals so consumers can recompose only
what's affected:
  - configChanged()                        — federation unit changed
  - federatedFalseOriginChanged()          — stage 3 changed
  - modelTransformationChanged(fed_id)     — stage 4 changed for one model

Emitted from setConfig / setFederatedFalseOrigin / setModelTransformation
in addition to the existing dirtyChanged.

MainWindow gains applyFederatedFalseOriginToViewport and
applyModelTransformationToViewport helpers.  Each composes the matrix
from the current federation state (using composeFederatedFalseOrigin /
composeModelTransformation, which already exist on Federation.h) and
pushes to the viewport's setFederatedFalseOrigin /
setModelTransformation.  ModelTransformation reads ModelUnits and the
active CoordinateOperation matrix from SceneLoader::modelGeoref so
ModelLocal-frame `a` lifts correctly through stage 2 when authored.

Wiring:
  - federation.federatedFalseOriginChanged -> applyFederatedFalseOriginToViewport
  - federation.configChanged               -> stage 3 + walk all models for stage 4
  - federation.modelTransformationChanged  -> stage 4 for that one model
  - applyCoordinateOperationToViewport now also re-pushes stage 4 (the
    compose result depends on the active stage 2 when a_frame is ModelLocal)
  - openFederation() pushes the loaded FederatedFalseOrigin once load
    completes; per-model stage 4 falls out of the existing
    onLoadedFromStream / onDataSourceReady path.

End-to-end pipeline is now active under the AppSettings toggle: edit
the federation in memory and the viewport recomposes immediately.  UI
for editing (form-based dialog) still pending.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-05-02 07:58:26 +10:00
parent e9d577890e
commit 4a9af13626
4 changed files with 82 additions and 0 deletions
+3
View File
@@ -202,6 +202,7 @@ void Federation::setConfig(const FederationConfig& c) {
return;
config_ = c;
setDirty(true);
emit configChanged();
}
void Federation::setFederatedFalseOrigin(const FederatedFalseOrigin& o) {
@@ -209,6 +210,7 @@ void Federation::setFederatedFalseOrigin(const FederatedFalseOrigin& o) {
federated_false_origin_.rz_deg == o.rz_deg) return;
federated_false_origin_ = o;
setDirty(true);
emit federatedFalseOriginChanged();
}
void Federation::setModelTransformation(const QString& fed_id,
@@ -217,6 +219,7 @@ void Federation::setModelTransformation(const QString& fed_id,
if (m.id != fed_id) continue;
m.model_transformation = xf;
setDirty(true);
emit modelTransformationChanged(fed_id);
return;
}
}