ifcviewer: load RocksDB-backed IFC models

The viewer can now open a .rdb directory (as produced by
RocksDbSerializer / convert_path_to_rocksdb) anywhere it accepts an
.ifc file. The full GUI gets an "Add Database..." File menu entry
that opens a directory chooser; the streamer lets the file
constructor autodetect the format and opens the store read-only so
multiple viewers can share a database without taking the exclusive
RocksDB lock.

Parallel mapping on RocksDB-backed files still produces
non-deterministic shape counts (the race is outside the instance
cache), so force num_threads=1 for the iterator when the storage is
RocksDB. Serial RocksDB (~2.6s) and parallel SPF (~0.7s) both
produce 107 shapes on AC20-FZK-Haus; @todo in-source points at the
remaining thread-safety work.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-04-22 16:22:48 +10:00
parent 4f929e90a7
commit 35be7f4190
3 changed files with 23 additions and 2 deletions
+10
View File
@@ -132,6 +132,7 @@ void MainWindow::setupMenus() {
auto* file_menu = menuBar()->addMenu("&File");
auto* open_action = file_menu->addAction("&Add Files...", this, &MainWindow::onFileOpen);
open_action->setShortcut(QKeySequence::Open);
file_menu->addAction("Add &Database...", this, &MainWindow::onDatabaseOpen);
file_menu->addAction("&Settings...", this, &MainWindow::onFileSettings);
file_menu->addSeparator();
file_menu->addAction("&Quit", QKeySequence::Quit, qApp, &QApplication::quit);
@@ -146,6 +147,15 @@ void MainWindow::onFileOpen() {
}
}
void MainWindow::onDatabaseOpen() {
QString path = QFileDialog::getExistingDirectory(
this, "Add IFC Database", QString(),
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
if (!path.isEmpty()) {
addFiles({ path });
}
}
void MainWindow::onFileSettings() {
if (settings_ == nullptr) {
settings_ = new SettingsWindow(this);