ifcviewer: load rdb/ifc as property data source on sidecar hit

Sidecar hits skipped opening the underlying .rdb/.ifc, so ifcFile() was
null and the property panel only showed cached name/type/guid. Now, after
a sidecar hit, a background thread opens <stem>.rdb (preferred) or
<stem>.ifc and hands the file to GeometryStreamer via setIfcFile(), with
a dataSourceReady signal so the UI refreshes the current selection.

Gated behind a new AppSettings::loadDataSource toggle (default on) so
users can opt into geometry-only viewing; when off, the sidecar-hit
thread is skipped and the stream-path ifc_file_ is released after
the sidecar write completes.

Also adds *.ifcview to the Add Files dialog filter so a cache can be
opened directly without its source file present.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-04-24 13:45:04 +10:00
parent eea2398e07
commit 8f7c8dc1d2
10 changed files with 153 additions and 1 deletions
+14
View File
@@ -26,6 +26,7 @@ constexpr const char* kGeometryLibraryKey = "geometry/library";
constexpr const char* kGeometryLibraryDefault = "hybrid-cgal-simple-opencascade";
constexpr const char* kShowStatsKey = "viewport/show_stats";
constexpr const char* kBackfaceCullingKey = "viewport/backface_culling";
constexpr const char* kLoadDataSourceKey = "loading/load_data_source";
}
AppSettings& AppSettings::instance() {
@@ -70,11 +71,23 @@ void AppSettings::setBackfaceCulling(bool value) {
emit backfaceCullingChanged(value);
}
bool AppSettings::loadDataSource() const {
return load_data_source_;
}
void AppSettings::setLoadDataSource(bool value) {
if (load_data_source_ == value) return;
load_data_source_ = value;
persist();
emit loadDataSourceChanged(value);
}
void AppSettings::load() {
QSettings settings;
geometry_library_ = settings.value(kGeometryLibraryKey, kGeometryLibraryDefault).toString();
show_stats_ = settings.value(kShowStatsKey, false).toBool();
backface_culling_ = settings.value(kBackfaceCullingKey, true).toBool();
load_data_source_ = settings.value(kLoadDataSourceKey, true).toBool();
}
void AppSettings::persist() {
@@ -82,4 +95,5 @@ void AppSettings::persist() {
settings.setValue(kGeometryLibraryKey, geometry_library_);
settings.setValue(kShowStatsKey, show_stats_);
settings.setValue(kBackfaceCullingKey, backface_culling_);
settings.setValue(kLoadDataSourceKey, load_data_source_);
}