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
+9
View File
@@ -40,10 +40,18 @@ public:
bool backfaceCulling() const;
void setBackfaceCulling(bool value);
// When true, the IFC/RocksDB file is kept open (and, on sidecar hits,
// opened in the background) so element properties can be queried.
// When false, only geometry is loaded — saves memory and avoids a
// second file read on sidecar hits, at the cost of no property panel.
bool loadDataSource() const;
void setLoadDataSource(bool value);
signals:
void geometryLibraryChanged(const QString& value);
void showStatsChanged(bool value);
void backfaceCullingChanged(bool value);
void loadDataSourceChanged(bool value);
private:
AppSettings();
@@ -53,6 +61,7 @@ private:
QString geometry_library_;
bool show_stats_ = false;
bool backface_culling_ = true;
bool load_data_source_ = true;
};
#endif // APPSETTINGS_H