ifcviewer: promote runtime perf knobs, drop always-on settings

Promotes five env-var-driven knobs to AppSettings + the settings dialog
(min pixel radius, motion min pixel radius, LOD1 pixel threshold, HiZ
resolution, HiZ on/off).  Defaults: motion min pixel radius is now 10
(was 0/disabled) and IFC_HIZ_MOTION is on by default — the strict
view-projection gate reverts via env var =0 when chasing HiZ
correctness bugs.  ViewportWindow connects each *Changed signal so
changes invalidate cached cull state and take effect on the next
frame.

Removes "Load Property Data Source" and "Apply Coordinate Operation"
from the settings dialog: both are now hardcoded on.  The basic-info
property fallback (used when there's no live IFC source for an object,
e.g. .ifcview without a sibling) now triggers organically when
ElementRegistry::findEntity returns null instead of being gated on a
user toggle.  Federation::guessFederatedFalseOrigin lost its
apply_coordinate_operation parameter and now uses
georef.has_coordinate_operation directly.

src/ifcviewer/settings.rst documents the remaining diagnostic env vars
(IFC_HIZ_MOTION, IFC_CULL_THREADS, IFC_SKIP_MDI, IFC_MAX_SUBDRAWS,
IFC_FPS_HITCH_MS, IFC_SUBDRAW_DIAG, IFC_LOD_*) plus a cross-walk from
the old promoted-knob env-var names to their new QSettings keys.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-05-10 19:37:20 +10:00
parent 0a297babea
commit a900f2c437
14 changed files with 324 additions and 185 deletions
+5 -19
View File
@@ -182,16 +182,6 @@ MainWindow::MainWindow(QWidget* parent)
if (!show) stats_label_->clear();
});
// Toggling the CoordinateOperation setting walks every loaded model
// and pushes either its georef matrix or identity to the viewport.
connect(&AppSettings::instance(),
&AppSettings::applyCoordinateOperationChanged,
this, [this](bool /*enabled*/) {
for (const auto& kv : fed_id_to_model_id_) {
applyCoordinateOperationToViewport(kv.second);
}
});
updateWindowTitle();
resize(1400, 900);
}
@@ -707,11 +697,9 @@ void MainWindow::onDataSourceReady(uint32_t mid) {
void MainWindow::applyCoordinateOperationToViewport(uint32_t mid) {
Eigen::Matrix4d M = Eigen::Matrix4d::Identity();
if (AppSettings::instance().applyCoordinateOperation()) {
if (const ModelGeoref* gr = loader_->modelGeoref(mid)) {
if (gr->has_coordinate_operation) {
M = gr->coordinate_operation_meters;
}
if (const ModelGeoref* gr = loader_->modelGeoref(mid)) {
if (gr->has_coordinate_operation) {
M = gr->coordinate_operation_meters;
}
}
viewport_->setModelCoordinateOperation(mid, M);
@@ -733,8 +721,7 @@ void MainWindow::applyModelTransformationToViewport(uint32_t mid) {
Eigen::Matrix4d coord_op = Eigen::Matrix4d::Identity();
if (const ModelGeoref* gr = loader_->modelGeoref(mid)) {
units = gr->units;
if (AppSettings::instance().applyCoordinateOperation() &&
gr->has_coordinate_operation) {
if (gr->has_coordinate_operation) {
coord_op = gr->coordinate_operation_meters;
}
}
@@ -771,8 +758,7 @@ void MainWindow::maybeGuessFederatedFalseOrigin(uint32_t mid) {
if (placement == nullptr || gr == nullptr) return;
const FederatedFalseOrigin guess = guessFederatedFalseOrigin(
*placement, *gr, federation_->config(),
AppSettings::instance().applyCoordinateOperation());
*placement, *gr, federation_->config());
federation_->setFederatedFalseOrigin(guess);
}