mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-30 16:43:00 +00:00
ifcviewer: cache per-model georef in SceneLoader
Adds ModelGeoref { ModelUnits units; Eigen::Matrix4d stage2_meters; bool
has_stage2; } and computeModelGeoref(file*) in Federation.{h,cpp}. The
helper reads the project length unit, IfcProjectedCRS.MapUnit, helmert
parameters and WCS, and reduces them to a metres-in/metres-out stage 2
matrix using the existing Geolocation + Unit primitives. When the model
has no IfcMapConversion it returns an identity stage_2 with has_stage2
== false, so the upload pipeline can branch cheaply.
SceneLoader::Model gains a cached ModelGeoref; SceneLoader::modelGeoref
(uint32_t mid) computes lazily on first call (returns nullptr when the
IFC file isn't available yet — happens on the sidecar-hit path before
the data-source thread populates the streamer) and serves from cache
afterwards.
Not yet consumed by the upload pipeline; that's the next commit.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -58,10 +58,13 @@ find_package(Eigen3 REQUIRED)
|
||||
add_executable(test_federation
|
||||
test_federation.cpp
|
||||
${IFCVIEWER_SRC}/Federation.cpp
|
||||
# Federation pulls in Unit::convert for federation_unit_to_meters; compile
|
||||
# Unit.cpp directly so the test doesn't have to link the whole IfcViewer
|
||||
# library (which would drag in Qt6::OpenGL, OpenCASCADE, etc.).
|
||||
# Federation pulls in Unit::convert for federationUnitToMeters and
|
||||
# Geolocation helpers (helmertMetersFromParameters, getWcs, getMapUnit)
|
||||
# for computeModelGeoref; compile both directly so the test doesn't
|
||||
# have to link the whole IfcViewer library (which would drag in
|
||||
# Qt6::OpenGL, OpenCASCADE, etc.).
|
||||
${IFCVIEWER_SRC}/Unit.cpp
|
||||
${IFCVIEWER_SRC}/Geolocation.cpp
|
||||
)
|
||||
set_target_properties(test_federation PROPERTIES AUTOMOC ON)
|
||||
target_include_directories(test_federation PRIVATE ${IFCVIEWER_SRC})
|
||||
|
||||
Reference in New Issue
Block a user