mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
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:
@@ -103,6 +103,16 @@ private:
|
||||
// or its IFC file isn't available (sidecar-hit before data-source
|
||||
// load); the call retries on onDataSourceReady.
|
||||
void applyCoordinateOperationToViewport(uint32_t mid);
|
||||
|
||||
// Push a model's ModelTransformation (stage 4) matrix to the viewport,
|
||||
// composed from the federation's authoring intent + the model's units
|
||||
// + the active CoordinateOperation matrix. Identity when the model is
|
||||
// not in the federation.
|
||||
void applyModelTransformationToViewport(uint32_t mid);
|
||||
|
||||
// Push the federation-wide FederatedFalseOrigin (stage 3) matrix to
|
||||
// the viewport. Affects every loaded model.
|
||||
void applyFederatedFalseOriginToViewport();
|
||||
QString formatElapsed(qint64 ms) const;
|
||||
|
||||
ViewportWindow* viewport_ = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user