mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
ifcviewer: gate CoordinateOperation on a settings toggle
AppSettings.applyCoordinateOperation (default false, persisted via
QSettings) controls whether each loaded model's IfcCoordinateOperation
is applied at upload time. Off keeps models in their local engineering
frame (current behaviour). On lifts each model into map coordinates
via the stage-2 georef matrix cached on SceneLoader.
MainWindow:
- applyCoordinateOperationToViewport(mid) reads the toggle, fetches
the model's ModelGeoref, and pushes either the
coordinate_operation_meters matrix or identity to the viewport.
- Called from onLoadedFromStream (streamer path) and onDataSourceReady
(sidecar-hit path, where the IFC arrives asynchronously).
- Subscribed to AppSettings::applyCoordinateOperationChanged: a
runtime toggle walks every loaded model and re-applies, so users
can flip georef on/off without reloading.
SettingsWindow gains a "Apply Coordinate Operation" checkbox alongside
the existing per-load toggles.
Default-off so the change is opt-in — users with georeferenced models
(UTM coords etc.) can flip the toggle to see them in their map frame
once they're ready. Visual verification on a real georeferenced
model still pending.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,14 @@ void SettingsWindow::setupUi() {
|
||||
"and, on sidecar hits, avoids a second file read.");
|
||||
form->addRow("Load Property Data Source", load_data_source_check_);
|
||||
|
||||
apply_coordinate_operation_check_ = new QCheckBox(this);
|
||||
apply_coordinate_operation_check_->setToolTip(
|
||||
"Apply each model's IfcCoordinateOperation (e.g. IfcMapConversion) "
|
||||
"after load so it lands in georeferenced map coordinates. "
|
||||
"Disable to keep models in their local engineering frame.");
|
||||
form->addRow("Apply Coordinate Operation",
|
||||
apply_coordinate_operation_check_);
|
||||
|
||||
void_limit_spin_ = new QSpinBox(this);
|
||||
void_limit_spin_->setRange(0, 100000);
|
||||
void_limit_spin_->setToolTip(
|
||||
@@ -109,6 +117,8 @@ void SettingsWindow::syncFromSettings() {
|
||||
show_stats_check_->setChecked(AppSettings::instance().showStats());
|
||||
backface_culling_check_->setChecked(AppSettings::instance().backfaceCulling());
|
||||
load_data_source_check_->setChecked(AppSettings::instance().loadDataSource());
|
||||
apply_coordinate_operation_check_->setChecked(
|
||||
AppSettings::instance().applyCoordinateOperation());
|
||||
void_limit_spin_->setValue(AppSettings::instance().voidLimit());
|
||||
deflection_tolerance_spin_->setValue(AppSettings::instance().deflectionTolerance());
|
||||
angular_tolerance_spin_->setValue(AppSettings::instance().angularTolerance());
|
||||
@@ -119,6 +129,8 @@ void SettingsWindow::onAccepted() {
|
||||
AppSettings::instance().setShowStats(show_stats_check_->isChecked());
|
||||
AppSettings::instance().setBackfaceCulling(backface_culling_check_->isChecked());
|
||||
AppSettings::instance().setLoadDataSource(load_data_source_check_->isChecked());
|
||||
AppSettings::instance().setApplyCoordinateOperation(
|
||||
apply_coordinate_operation_check_->isChecked());
|
||||
AppSettings::instance().setVoidLimit(void_limit_spin_->value());
|
||||
AppSettings::instance().setDeflectionTolerance(deflection_tolerance_spin_->value());
|
||||
AppSettings::instance().setAngularTolerance(angular_tolerance_spin_->value());
|
||||
|
||||
Reference in New Issue
Block a user