mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 14:31:39 +00:00
ifcviewer: auto-guess FederatedFalseOrigin on first model added
When the user adds a model into a fresh, untitled federation that still
has the default (0,0,0, no rotation) FederatedFalseOrigin, derive an
origin from the first instance's placement_transformation (lifted
through CoordinateOperation when enabled) and the helmert grid-north
baked into ModelGeoref::coordinate_operation_meters. Multi-file batches
naturally settle: whichever load finishes first anchors the federation,
the rest see a non-default origin and skip. Saved .ifcfeds keep their
authoritative origin.
Adds Placement.{h,cpp} (port of util/placement.py — a2p,
get_axis2placement, get_local_placement) so Geolocation no longer needs
its own anonymous getAxis2Placement, and xaxis2angleDeg in Geolocation
mirroring util/geolocation.xaxis2angle.
SceneLoader captures the first instance's placement_transformation from
either the sidecar's InstanceCpu[0] or the streamer's first
InstanceChunk, so the guess works on both load paths without re-reading
the IFC.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -117,6 +117,15 @@ private:
|
||||
// Push the federation-wide FederatedFalseOrigin (stage 3) matrix to
|
||||
// the viewport. Affects every loaded model.
|
||||
void applyFederatedFalseOriginToViewport();
|
||||
|
||||
// For an untitled federation whose FederatedFalseOrigin is still at
|
||||
// its default, derive a sensible origin from `mid`'s first instance
|
||||
// placement + georef and push it via Federation. Idempotent: a
|
||||
// non-default origin (user-edited, already guessed by a sibling load
|
||||
// in the same batch, or loaded from a saved .ifcfed) is left
|
||||
// untouched, so multi-file batches naturally anchor on whichever
|
||||
// model finishes first.
|
||||
void maybeGuessFederatedFalseOrigin(uint32_t mid);
|
||||
QString formatElapsed(qint64 ms) const;
|
||||
|
||||
ViewportWindow* viewport_ = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user