Rename IfcViewerFull to Bonsai Viewer

Directory src/ifcviewer-full -> src/bonsaiviewer, CMake target
IfcViewerFull -> BonsaiViewer, namespace ifcviewerfull -> bonsaiviewer,
QApplication / window titles / connector path now use the new brand.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-05-20 09:38:10 +10:00
parent fcae3d90af
commit 59e5b2b1b8
125 changed files with 308 additions and 308 deletions
+1 -1
View File
@@ -687,7 +687,7 @@ if(BUILD_IFCVIEWER)
add_subdirectory(../src/ifcviewer ifcviewer) add_subdirectory(../src/ifcviewer ifcviewer)
add_subdirectory(../src/ifcviewer-minimal ifcviewer-minimal) add_subdirectory(../src/ifcviewer-minimal ifcviewer-minimal)
add_subdirectory(../src/ifcviewer-full ifcviewer-full) add_subdirectory(../src/bonsaiviewer bonsaiviewer)
endif() endif()
# Cmake uninstall target # Cmake uninstall target
@@ -18,12 +18,12 @@
# # # #
################################################################################ ################################################################################
message("Running CMakeLists.txt in /src/ifcviewer-full") message("Running CMakeLists.txt in /src/bonsaiviewer")
set(QT_VERSION 6 CACHE STRING "Qt version") set(QT_VERSION 6 CACHE STRING "Qt version")
find_package(Qt${QT_VERSION} COMPONENTS Core CorePrivate Gui Widgets Svg REQUIRED PATHS ${QT_DIR}) find_package(Qt${QT_VERSION} COMPONENTS Core CorePrivate Gui Widgets Svg REQUIRED PATHS ${QT_DIR})
set(IFCVIEWER_FULL_FILES set(BONSAIVIEWER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ElementRegistry.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ElementRegistry.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ElementRegistry.h ${CMAKE_CURRENT_SOURCE_DIR}/ElementRegistry.h
@@ -98,19 +98,19 @@ set(IFCVIEWER_FULL_FILES
${CMAKE_CURRENT_SOURCE_DIR}/modules/viewport/Commands.h ${CMAKE_CURRENT_SOURCE_DIR}/modules/viewport/Commands.h
${CMAKE_CURRENT_SOURCE_DIR}/modules/viewport/View.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/viewport/View.cpp
${CMAKE_CURRENT_SOURCE_DIR}/modules/viewport/View.h ${CMAKE_CURRENT_SOURCE_DIR}/modules/viewport/View.h
${CMAKE_CURRENT_SOURCE_DIR}/ifcviewer_full_resources.qrc ${CMAKE_CURRENT_SOURCE_DIR}/bonsaiviewer_resources.qrc
) )
add_executable(IfcViewerFull ${IFCVIEWER_FULL_FILES}) add_executable(BonsaiViewer ${BONSAIVIEWER_FILES})
set_target_properties(IfcViewerFull PROPERTIES set_target_properties(BonsaiViewer PROPERTIES
AUTOMOC ON AUTOMOC ON
AUTORCC ON AUTORCC ON
WIN32_EXECUTABLE ON WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON MACOSX_BUNDLE ON
) )
target_link_libraries(IfcViewerFull PRIVATE target_link_libraries(BonsaiViewer PRIVATE
IfcViewer IfcViewer
Qt${QT_VERSION}::Core Qt${QT_VERSION}::Core
Qt${QT_VERSION}::CorePrivate Qt${QT_VERSION}::CorePrivate
@@ -119,5 +119,5 @@ target_link_libraries(IfcViewerFull PRIVATE
Qt${QT_VERSION}::Widgets Qt${QT_VERSION}::Widgets
) )
install(TARGETS IfcViewerFull EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}) install(TARGETS BonsaiViewer EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
ifcopenshell_deploy_qt_runtime(IfcViewerFull) ifcopenshell_deploy_qt_runtime(BonsaiViewer)
@@ -24,7 +24,7 @@
#include "../ifcviewer/SceneLoader.h" #include "../ifcviewer/SceneLoader.h"
#include "../ifcviewer/SidecarCache.h" #include "../ifcviewer/SidecarCache.h"
namespace ifcviewerfull { namespace bonsaiviewer {
ElementRegistry::ElementRegistry(QObject* parent) ElementRegistry::ElementRegistry(QObject* parent)
: QObject(parent) : QObject(parent)
@@ -123,4 +123,4 @@ void ElementRegistry::onStreamedElementsReady(uint32_t /*mid*/, std::vector<Elem
} }
} }
} // namespace ifcviewerfull } // namespace bonsaiviewer
@@ -33,7 +33,7 @@ class SceneLoader;
struct PackedElementInfo; struct PackedElementInfo;
struct ElementInfo; struct ElementInfo;
namespace ifcviewerfull { namespace bonsaiviewer {
struct BasicElementInfo { struct BasicElementInfo {
uint32_t object_id = 0; uint32_t object_id = 0;
@@ -67,6 +67,6 @@ private:
std::unordered_map<uint32_t, BasicElementInfo> elements_; std::unordered_map<uint32_t, BasicElementInfo> elements_;
}; };
} // namespace ifcviewerfull } // namespace bonsaiviewer
#endif #endif
@@ -56,12 +56,12 @@
#include <QToolButton> #include <QToolButton>
#include <QVBoxLayout> #include <QVBoxLayout>
namespace ifcviewerfull::shell { namespace bonsaiviewer::shell {
MainWindow::MainWindow(QWidget* parent) MainWindow::MainWindow(QWidget* parent)
: QMainWindow(parent) : QMainWindow(parent)
{ {
session_state_ = new ifcviewerfull::SessionState(this); session_state_ = new bonsaiviewer::SessionState(this);
auto on_mutated = [this]() { auto on_mutated = [this]() {
setWindowModified(true); setWindowModified(true);
updateWindowTitle(); updateWindowTitle();
@@ -70,11 +70,11 @@ MainWindow::MainWindow(QWidget* parent)
setWindowModified(false); setWindowModified(false);
updateWindowTitle(); updateWindowTitle();
}; };
connect(session_state_, &ifcviewerfull::SessionState::federationChanged, this, on_mutated); connect(session_state_, &bonsaiviewer::SessionState::federationChanged, this, on_mutated);
connect(session_state_, &ifcviewerfull::SessionState::modelsChanged, this, on_mutated); connect(session_state_, &bonsaiviewer::SessionState::modelsChanged, this, on_mutated);
connect(session_state_, &ifcviewerfull::SessionState::projectReset, this, on_clean_state); connect(session_state_, &bonsaiviewer::SessionState::projectReset, this, on_clean_state);
connect(session_state_, &ifcviewerfull::SessionState::projectOpened, this, on_clean_state); connect(session_state_, &bonsaiviewer::SessionState::projectOpened, this, on_clean_state);
connect(session_state_, &ifcviewerfull::SessionState::projectSaved, this, on_clean_state); connect(session_state_, &bonsaiviewer::SessionState::projectSaved, this, on_clean_state);
setupChrome(); setupChrome();
setupViewport(); setupViewport();
setupPanels(); setupPanels();
@@ -443,22 +443,22 @@ void MainWindow::setupStatus() {
status_perf_label_->setVisible(show); status_perf_label_->setVisible(show);
if (!show) status_perf_label_->clear(); if (!show) status_perf_label_->clear();
}); });
connect(session_state_, &ifcviewerfull::SessionState::statusMessageChanged, connect(session_state_, &bonsaiviewer::SessionState::statusMessageChanged,
this, [this](const QString& mode, const QString& detail) { this, [this](const QString& mode, const QString& detail) {
status_mode_label_->setText(mode); status_mode_label_->setText(mode);
status_selection_label_->setText(detail); status_selection_label_->setText(detail);
}); });
connect(session_state_, &ifcviewerfull::SessionState::progressBegan, this, [this](const QString&) { connect(session_state_, &bonsaiviewer::SessionState::progressBegan, this, [this](const QString&) {
// Start in indeterminate mode (spinning bar). The first concrete // Start in indeterminate mode (spinning bar). The first concrete
// setProgress(...) call below switches it to a determinate 0-100 bar. // setProgress(...) call below switches it to a determinate 0-100 bar.
status_progress_bar_->setRange(0, 0); status_progress_bar_->setRange(0, 0);
status_progress_bar_->setVisible(true); status_progress_bar_->setVisible(true);
}); });
connect(session_state_, &ifcviewerfull::SessionState::progressChanged, this, [this](int percent) { connect(session_state_, &bonsaiviewer::SessionState::progressChanged, this, [this](int percent) {
if (status_progress_bar_->maximum() == 0) status_progress_bar_->setRange(0, 100); if (status_progress_bar_->maximum() == 0) status_progress_bar_->setRange(0, 100);
status_progress_bar_->setValue(percent); status_progress_bar_->setValue(percent);
}); });
connect(session_state_, &ifcviewerfull::SessionState::progressEnded, this, [this]() { connect(session_state_, &bonsaiviewer::SessionState::progressEnded, this, [this]() {
status_progress_bar_->setVisible(false); status_progress_bar_->setVisible(false);
}); });
session_state_->setStatusMessage("Ready", "No selection"); session_state_->setStatusMessage("Ready", "No selection");
@@ -471,9 +471,9 @@ void MainWindow::setupLoader() {
// Load errors surface through SessionState as a session-level signal; the // Load errors surface through SessionState as a session-level signal; the
// status text + progress are already cleared there, we only show the modal. // status text + progress are already cleared there, we only show the modal.
connect(session_state_, &ifcviewerfull::SessionState::loadError, this, connect(session_state_, &bonsaiviewer::SessionState::loadError, this,
[this](const QString& message) { [this](const QString& message) {
QMessageBox::warning(this, "IfcViewer", message); QMessageBox::warning(this, "Bonsai Viewer", message);
}); });
connect(viewport_widget_->viewport(), &ViewportWindow::frameStatsUpdated, this, connect(viewport_widget_->viewport(), &ViewportWindow::frameStatsUpdated, this,
@@ -500,12 +500,12 @@ void MainWindow::updateWindowTitle() {
auto* federation = session_state_->federation(); auto* federation = session_state_->federation();
const QString project_path = federation->filePath(); const QString project_path = federation->filePath();
if (project_path.isEmpty() && federation->models().empty()) { if (project_path.isEmpty() && federation->models().empty()) {
setWindowTitle("IfcOpenShell Interface"); setWindowTitle("Bonsai Viewer");
} else if (project_path.isEmpty()) { } else if (project_path.isEmpty()) {
setWindowTitle("untitled[*] - IfcOpenShell Interface"); setWindowTitle("untitled[*] - Bonsai Viewer");
} else { } else {
setWindowTitle(QFileInfo(project_path).fileName() + "[*] - IfcOpenShell Interface"); setWindowTitle(QFileInfo(project_path).fileName() + "[*] - Bonsai Viewer");
} }
} }
} // namespace ifcviewerfull::shell } // namespace bonsaiviewer::shell
@@ -30,18 +30,18 @@ class QDockWidget;
class QProgressBar; class QProgressBar;
class QStackedWidget; class QStackedWidget;
class QToolButton; class QToolButton;
namespace ifcviewerfull { class SessionState; } namespace bonsaiviewer { class SessionState; }
namespace ifcviewerfull::components { class TabBar; } namespace bonsaiviewer::components { class TabBar; }
namespace ifcviewerfull::modules::models { class ModelsPanel; } namespace bonsaiviewer::modules::models { class ModelsPanel; }
namespace ifcviewerfull::modules::models { class ModelsPanelView; } namespace bonsaiviewer::modules::models { class ModelsPanelView; }
namespace ifcviewerfull::modules::spatial_hierarchy { class SpatialHierarchyPanel; } namespace bonsaiviewer::modules::spatial_hierarchy { class SpatialHierarchyPanel; }
namespace ifcviewerfull::modules::spatial_hierarchy { class SpatialHierarchyPanelView; } namespace bonsaiviewer::modules::spatial_hierarchy { class SpatialHierarchyPanelView; }
namespace ifcviewerfull::modules::properties { class PropertiesPanel; } namespace bonsaiviewer::modules::properties { class PropertiesPanel; }
namespace ifcviewerfull::modules::properties { class PropertiesPanelView; } namespace bonsaiviewer::modules::properties { class PropertiesPanelView; }
namespace ifcviewerfull::modules::viewport { class ViewportView; } namespace bonsaiviewer::modules::viewport { class ViewportView; }
namespace ifcviewerfull::modules::viewport { class ViewportPanel; } namespace bonsaiviewer::modules::viewport { class ViewportPanel; }
namespace ifcviewerfull::shell { namespace bonsaiviewer::shell {
class MainWindow : public QMainWindow { class MainWindow : public QMainWindow {
Q_OBJECT Q_OBJECT
@@ -67,26 +67,26 @@ private:
QLabel* status_selection_label_ = nullptr; QLabel* status_selection_label_ = nullptr;
QLabel* status_perf_label_ = nullptr; QLabel* status_perf_label_ = nullptr;
QProgressBar* status_progress_bar_ = nullptr; QProgressBar* status_progress_bar_ = nullptr;
ifcviewerfull::components::TabBar* ribbon_tabs_ = nullptr; bonsaiviewer::components::TabBar* ribbon_tabs_ = nullptr;
QStackedWidget* ribbon_pages_ = nullptr; QStackedWidget* ribbon_pages_ = nullptr;
ifcviewerfull::modules::viewport::ViewportPanel* viewport_widget_ = nullptr; bonsaiviewer::modules::viewport::ViewportPanel* viewport_widget_ = nullptr;
ifcviewerfull::modules::viewport::ViewportView* viewport_view_ = nullptr; bonsaiviewer::modules::viewport::ViewportView* viewport_view_ = nullptr;
ifcviewerfull::SessionState* session_state_ = nullptr; bonsaiviewer::SessionState* session_state_ = nullptr;
ifcviewerfull::modules::models::ModelsPanel* models_panel_ = nullptr; bonsaiviewer::modules::models::ModelsPanel* models_panel_ = nullptr;
ifcviewerfull::modules::spatial_hierarchy::SpatialHierarchyPanel* spatial_panel_ = nullptr; bonsaiviewer::modules::spatial_hierarchy::SpatialHierarchyPanel* spatial_panel_ = nullptr;
QDockWidget* layers_panel_ = nullptr; QDockWidget* layers_panel_ = nullptr;
ifcviewerfull::modules::properties::PropertiesPanel* properties_panel_ = nullptr; bonsaiviewer::modules::properties::PropertiesPanel* properties_panel_ = nullptr;
QDockWidget* stored_views_panel_ = nullptr; QDockWidget* stored_views_panel_ = nullptr;
QDockWidget* search_panel_ = nullptr; QDockWidget* search_panel_ = nullptr;
QDockWidget* spreadsheet_panel_ = nullptr; QDockWidget* spreadsheet_panel_ = nullptr;
QDockWidget* audit_panel_ = nullptr; QDockWidget* audit_panel_ = nullptr;
QDockWidget* clash_panel_ = nullptr; QDockWidget* clash_panel_ = nullptr;
QDockWidget* issues_panel_ = nullptr; QDockWidget* issues_panel_ = nullptr;
ifcviewerfull::modules::models::ModelsPanelView* models_view_ = nullptr; bonsaiviewer::modules::models::ModelsPanelView* models_view_ = nullptr;
ifcviewerfull::modules::spatial_hierarchy::SpatialHierarchyPanelView* spatial_view_ = nullptr; bonsaiviewer::modules::spatial_hierarchy::SpatialHierarchyPanelView* spatial_view_ = nullptr;
ifcviewerfull::modules::properties::PropertiesPanelView* properties_view_ = nullptr; bonsaiviewer::modules::properties::PropertiesPanelView* properties_view_ = nullptr;
}; };
} // namespace ifcviewerfull::shell } // namespace bonsaiviewer::shell
#endif #endif
@@ -25,7 +25,7 @@
#include "../ifcviewer/Federation.h" #include "../ifcviewer/Federation.h"
#include "../ifcviewer/SceneLoader.h" #include "../ifcviewer/SceneLoader.h"
namespace ifcviewerfull { namespace bonsaiviewer {
SessionState::SessionState(QObject* parent) SessionState::SessionState(QObject* parent)
: QObject(parent) : QObject(parent)
@@ -183,4 +183,4 @@ void SessionState::notifyProjectReset() {
emit projectReset(); emit projectReset();
} }
} // namespace ifcviewerfull } // namespace bonsaiviewer
@@ -30,7 +30,7 @@ class Federation;
class SceneLoader; class SceneLoader;
class ViewportWindow; class ViewportWindow;
namespace ifcviewerfull { namespace bonsaiviewer {
class ElementRegistry; class ElementRegistry;
@@ -124,6 +124,6 @@ private:
QHash<QString, QVariantMap> cloud_metadata_; QHash<QString, QVariantMap> cloud_metadata_;
}; };
} // namespace ifcviewerfull } // namespace bonsaiviewer
#endif #endif
@@ -30,45 +30,45 @@ namespace {
constexpr const char* kThemeModeKey = "interface/theme/mode"; constexpr const char* kThemeModeKey = "interface/theme/mode";
constexpr const char* kThemeColorPrefix = "interface/theme/colors/"; constexpr const char* kThemeColorPrefix = "interface/theme/colors/";
using Spec = ifcviewerfull::ViewerSettings::ThemeColorSpec; using Spec = bonsaiviewer::ViewerSettings::ThemeColorSpec;
const std::vector<Spec> kThemeColorSpecs = { const std::vector<Spec> kThemeColorSpecs = {
{"app_background", "App Background", ifcviewerfull::components::style::palette::app_background, "#eef1f5"}, {"app_background", "App Background", bonsaiviewer::components::style::palette::app_background, "#eef1f5"},
{"border", "Border", ifcviewerfull::components::style::palette::border, "#c9d1dc"}, {"border", "Border", bonsaiviewer::components::style::palette::border, "#c9d1dc"},
{"selection_background", "Selection Background", ifcviewerfull::components::style::palette::selection_background, {"selection_background", "Selection Background", bonsaiviewer::components::style::palette::selection_background,
"#2f9e44"}, "#2f9e44"},
{"tab_bar_background", "Tab Bar Background", ifcviewerfull::components::style::palette::tab_bar_background, {"tab_bar_background", "Tab Bar Background", bonsaiviewer::components::style::palette::tab_bar_background,
"#eef1f5"}, "#eef1f5"},
{"tab_background", "Tab Background", ifcviewerfull::components::style::palette::tab_background, "#e3e8ef"}, {"tab_background", "Tab Background", bonsaiviewer::components::style::palette::tab_background, "#e3e8ef"},
{"ribbon_background", "Ribbon Background", ifcviewerfull::components::style::palette::ribbon_background, {"ribbon_background", "Ribbon Background", bonsaiviewer::components::style::palette::ribbon_background,
"#e3e8ef"}, "#e3e8ef"},
{"ribbon_button_hover", "Ribbon Button Hover", ifcviewerfull::components::style::palette::ribbon_button_hover, {"ribbon_button_hover", "Ribbon Button Hover", bonsaiviewer::components::style::palette::ribbon_button_hover,
"#d6dde7"}, "#d6dde7"},
{"ribbon_button_pressed", "Ribbon Button Pressed", ifcviewerfull::components::style::palette::ribbon_button_pressed, {"ribbon_button_pressed", "Ribbon Button Pressed", bonsaiviewer::components::style::palette::ribbon_button_pressed,
"#cad3df"}, "#cad3df"},
{"viewport_shell_background", "Viewport Shell Background", {"viewport_shell_background", "Viewport Shell Background",
ifcviewerfull::components::style::palette::viewport_shell_background, "#dbe1e8"}, bonsaiviewer::components::style::palette::viewport_shell_background, "#dbe1e8"},
{"viewport_background", "Viewport Background", ifcviewerfull::components::style::palette::viewport_background, {"viewport_background", "Viewport Background", bonsaiviewer::components::style::palette::viewport_background,
"#eef2f6"}, "#eef2f6"},
{"panel_background", "Panel Background", ifcviewerfull::components::style::palette::panel_background, "#ffffff"}, {"panel_background", "Panel Background", bonsaiviewer::components::style::palette::panel_background, "#ffffff"},
{"control_background", "Control Background", ifcviewerfull::components::style::palette::control_background, {"control_background", "Control Background", bonsaiviewer::components::style::palette::control_background,
"#f5f7fa"}, "#f5f7fa"},
{"control_border_focus", "Control Border Focus", ifcviewerfull::components::style::palette::control_border_focus, {"control_border_focus", "Control Border Focus", bonsaiviewer::components::style::palette::control_border_focus,
"#7c8ca3"}, "#7c8ca3"},
{"box_background", "Box Background", ifcviewerfull::components::style::palette::box_background, "#f5f7fa"}, {"box_background", "Box Background", bonsaiviewer::components::style::palette::box_background, "#f5f7fa"},
{"scroll_handle", "Scroll Handle", ifcviewerfull::components::style::palette::scroll_handle, "#b1bac8"}, {"scroll_handle", "Scroll Handle", bonsaiviewer::components::style::palette::scroll_handle, "#b1bac8"},
{"scroll_handle_hover", "Scroll Handle Hover", ifcviewerfull::components::style::palette::scroll_handle_hover, {"scroll_handle_hover", "Scroll Handle Hover", bonsaiviewer::components::style::palette::scroll_handle_hover,
"#929daf"}, "#929daf"},
{"status_background", "Status Background", ifcviewerfull::components::style::palette::status_background, {"status_background", "Status Background", bonsaiviewer::components::style::palette::status_background,
"#edf1f5"}, "#edf1f5"},
{"section_header_background", "Section Header Background", {"section_header_background", "Section Header Background",
ifcviewerfull::components::style::palette::section_header_background, "#eef2f6"}, bonsaiviewer::components::style::palette::section_header_background, "#eef2f6"},
{"primary_text", "Primary Text", ifcviewerfull::components::style::palette::primary_text, "#1f2937"}, {"primary_text", "Primary Text", bonsaiviewer::components::style::palette::primary_text, "#1f2937"},
{"secondary_text", "Secondary Text", ifcviewerfull::components::style::palette::secondary_text, "#5b6676"}, {"secondary_text", "Secondary Text", bonsaiviewer::components::style::palette::secondary_text, "#5b6676"},
{"disabled_text", "Disabled Text", ifcviewerfull::components::style::palette::disabled_text, "#8b95a3"}, {"disabled_text", "Disabled Text", bonsaiviewer::components::style::palette::disabled_text, "#8b95a3"},
{"warning_text", "Warning Text", ifcviewerfull::components::style::palette::warning_text, "#b26b00"}, {"warning_text", "Warning Text", bonsaiviewer::components::style::palette::warning_text, "#b26b00"},
{"selection_text", "Selection Text", ifcviewerfull::components::style::palette::selection_text, "#ffffff"}, {"selection_text", "Selection Text", bonsaiviewer::components::style::palette::selection_text, "#ffffff"},
{"hover_text", "Hover Text", ifcviewerfull::components::style::palette::hover_text, "#0f172a"}, {"hover_text", "Hover Text", bonsaiviewer::components::style::palette::hover_text, "#0f172a"},
{"icon_color", "Icon Color", "#e7ebf2", "#445066"}, {"icon_color", "Icon Color", "#e7ebf2", "#445066"},
{"icon_active_color", "Icon Active Color", "#ffffff", "#101828"}, {"icon_active_color", "Icon Active Color", "#ffffff", "#101828"},
{"icon_disabled_color", "Icon Disabled Color", "#6f7988", "#98a2b3"}, {"icon_disabled_color", "Icon Disabled Color", "#6f7988", "#98a2b3"},
@@ -93,7 +93,7 @@ QString normalizedColor(const QString& value, const QString& fallback) {
} // namespace } // namespace
namespace ifcviewerfull { namespace bonsaiviewer {
ViewerSettings& ViewerSettings::instance() { ViewerSettings& ViewerSettings::instance() {
static ViewerSettings inst; static ViewerSettings inst;
@@ -186,4 +186,4 @@ void ViewerSettings::persist() const {
} }
} }
} // namespace ifcviewerfull } // namespace bonsaiviewer
@@ -25,7 +25,7 @@
#include <QString> #include <QString>
#include <vector> #include <vector>
namespace ifcviewerfull { namespace bonsaiviewer {
class ViewerSettings : public QObject { class ViewerSettings : public QObject {
Q_OBJECT Q_OBJECT
@@ -67,6 +67,6 @@ private:
std::vector<QString> custom_colors_; std::vector<QString> custom_colors_;
}; };
} // namespace ifcviewerfull } // namespace bonsaiviewer
#endif #endif
@@ -28,7 +28,7 @@
#include <QToolButton> #include <QToolButton>
#include <QVBoxLayout> #include <QVBoxLayout>
namespace ifcviewerfull::components::buttons { namespace bonsaiviewer::components::buttons {
QToolButton* makeButton(const QString& text, QToolButton* makeButton(const QString& text,
const QString& icon_path, const QString& icon_path,
@@ -74,4 +74,4 @@ QWidget* makeButtonGroup(const QString& title,
return group; return group;
} }
} // namespace ifcviewerfull::components::buttons } // namespace bonsaiviewer::components::buttons
@@ -26,7 +26,7 @@
class QToolButton; class QToolButton;
class QWidget; class QWidget;
namespace ifcviewerfull::components::buttons { namespace bonsaiviewer::components::buttons {
QToolButton* makeButton(const QString& text, QToolButton* makeButton(const QString& text,
const QString& icon_path, const QString& icon_path,
@@ -38,6 +38,6 @@ QWidget* makeButtonGroup(const QString& title,
bool trailing_separator = true, bool trailing_separator = true,
int vertical_spacing = 4); int vertical_spacing = 4);
} // namespace ifcviewerfull::components::buttons } // namespace bonsaiviewer::components::buttons
#endif #endif
@@ -28,7 +28,7 @@
#include <QScrollArea> #include <QScrollArea>
#include <QVBoxLayout> #include <QVBoxLayout>
namespace ifcviewerfull::components { namespace bonsaiviewer::components {
Dialog::Dialog(QWidget* parent, bool scrollable) Dialog::Dialog(QWidget* parent, bool scrollable)
: QDialog(parent) : QDialog(parent)
@@ -140,4 +140,4 @@ void TabbedDialog::addFooterWidget(QWidget* widget) {
footer_layout_->addWidget(widget); footer_layout_->addWidget(widget);
} }
} // namespace ifcviewerfull::components } // namespace bonsaiviewer::components
@@ -27,7 +27,7 @@ class QVBoxLayout;
class QWidget; class QWidget;
class QTabWidget; class QTabWidget;
namespace ifcviewerfull::components { namespace bonsaiviewer::components {
class Dialog : public QDialog { class Dialog : public QDialog {
Q_OBJECT Q_OBJECT
@@ -58,6 +58,6 @@ private:
QVBoxLayout* footer_layout_ = nullptr; QVBoxLayout* footer_layout_ = nullptr;
}; };
} // namespace ifcviewerfull::components } // namespace bonsaiviewer::components
#endif #endif
@@ -25,7 +25,7 @@
#include <QGridLayout> #include <QGridLayout>
#include <QLabel> #include <QLabel>
namespace ifcviewerfull::components { namespace bonsaiviewer::components {
KeyValueTable::KeyValueTable(const QList<KeyValueTableRow>& rows, QWidget* parent) KeyValueTable::KeyValueTable(const QList<KeyValueTableRow>& rows, QWidget* parent)
: QWidget(parent) : QWidget(parent)
@@ -69,4 +69,4 @@ KeyValueTable::KeyValueTable(const QList<KeyValueTableRow>& rows, QWidget* paren
} }
} }
} // namespace ifcviewerfull::components } // namespace bonsaiviewer::components
@@ -25,7 +25,7 @@
#include <QString> #include <QString>
#include <QWidget> #include <QWidget>
namespace ifcviewerfull::components { namespace bonsaiviewer::components {
struct KeyValueTableRow { struct KeyValueTableRow {
QString key; QString key;
@@ -42,6 +42,6 @@ public:
explicit KeyValueTable(const QList<KeyValueTableRow>& rows, QWidget* parent = nullptr); explicit KeyValueTable(const QList<KeyValueTableRow>& rows, QWidget* parent = nullptr);
}; };
} // namespace ifcviewerfull::components } // namespace bonsaiviewer::components
#endif #endif
@@ -32,7 +32,7 @@
#include <QToolButton> #include <QToolButton>
#include <QVBoxLayout> #include <QVBoxLayout>
namespace ifcviewerfull::components { namespace bonsaiviewer::components {
namespace { namespace {
@@ -137,4 +137,4 @@ void Panel::clearBodyWidgets() {
} }
} }
} // namespace ifcviewerfull::components } // namespace bonsaiviewer::components
@@ -26,7 +26,7 @@
class QWidget; class QWidget;
class QVBoxLayout; class QVBoxLayout;
namespace ifcviewerfull::components { namespace bonsaiviewer::components {
class Panel : public QDockWidget { class Panel : public QDockWidget {
Q_OBJECT Q_OBJECT
@@ -48,6 +48,6 @@ private:
QVBoxLayout* body_layout_ = nullptr; QVBoxLayout* body_layout_ = nullptr;
}; };
} // namespace ifcviewerfull::components } // namespace bonsaiviewer::components
#endif #endif
@@ -28,7 +28,7 @@
#include <QToolButton> #include <QToolButton>
#include <QVBoxLayout> #include <QVBoxLayout>
namespace ifcviewerfull::components { namespace bonsaiviewer::components {
Section::Section(const QString& title, SectionHeaderMode header_mode, QWidget* parent) Section::Section(const QString& title, SectionHeaderMode header_mode, QWidget* parent)
: QWidget(parent) : QWidget(parent)
@@ -115,4 +115,4 @@ void Section::setBodyExpanding(bool expanding) {
updateGeometry(); updateGeometry();
} }
} // namespace ifcviewerfull::components } // namespace bonsaiviewer::components
@@ -27,7 +27,7 @@ class QHBoxLayout;
class QToolButton; class QToolButton;
class QVBoxLayout; class QVBoxLayout;
namespace ifcviewerfull::components { namespace bonsaiviewer::components {
enum class SectionHeaderMode { enum class SectionHeaderMode {
Visible, Visible,
@@ -56,6 +56,6 @@ private:
bool body_expanding_ = false; bool body_expanding_ = false;
}; };
} // namespace ifcviewerfull::components } // namespace bonsaiviewer::components
#endif #endif
@@ -22,10 +22,10 @@
#include "../ViewerSettings.h" #include "../ViewerSettings.h"
namespace ifcviewerfull::components::style { namespace bonsaiviewer::components::style {
QString buildAppStyleSheet() { QString buildAppStyleSheet() {
const auto& theme = ifcviewerfull::ViewerSettings::instance(); const auto& theme = bonsaiviewer::ViewerSettings::instance();
QString stylesheet = QStringLiteral(R"( QString stylesheet = QStringLiteral(R"(
QMainWindow#appWindow { QMainWindow#appWindow {
background: ${app_background}; background: ${app_background};
@@ -494,4 +494,4 @@ QString buildAppStyleSheet() {
return stylesheet; return stylesheet;
} }
} // namespace ifcviewerfull::components::style } // namespace bonsaiviewer::components::style
@@ -23,22 +23,22 @@
#include <QString> #include <QString>
namespace ifcviewerfull::components::style::metrics { namespace bonsaiviewer::components::style::metrics {
inline constexpr int padding = 6; inline constexpr int padding = 6;
inline constexpr int section_body_padding = 10; inline constexpr int section_body_padding = 10;
inline constexpr int section_header_padding = 2; inline constexpr int section_header_padding = 2;
inline constexpr int panel_radius = 3; inline constexpr int panel_radius = 3;
} // namespace ifcviewerfull::components::style::metrics } // namespace bonsaiviewer::components::style::metrics
namespace ifcviewerfull::components::style::typography { namespace bonsaiviewer::components::style::typography {
inline constexpr int small = 10; inline constexpr int small = 10;
} // namespace ifcviewerfull::components::style::typography } // namespace bonsaiviewer::components::style::typography
namespace ifcviewerfull::components::style::palette { namespace bonsaiviewer::components::style::palette {
inline constexpr auto app_background = "#26292f"; inline constexpr auto app_background = "#26292f";
inline constexpr auto border = "#3e444e"; inline constexpr auto border = "#3e444e";
@@ -66,12 +66,12 @@ inline constexpr auto warning_text = "#e4b35a";
inline constexpr auto selection_text = "#14161a"; inline constexpr auto selection_text = "#14161a";
inline constexpr auto hover_text = "#ffffff"; inline constexpr auto hover_text = "#ffffff";
} // namespace ifcviewerfull::components::style::palette } // namespace bonsaiviewer::components::style::palette
namespace ifcviewerfull::components::style { namespace bonsaiviewer::components::style {
QString buildAppStyleSheet(); QString buildAppStyleSheet();
} // namespace ifcviewerfull::components::style } // namespace bonsaiviewer::components::style
#endif #endif
@@ -27,7 +27,7 @@
#include <QRegularExpression> #include <QRegularExpression>
#include <QSvgRenderer> #include <QSvgRenderer>
namespace ifcviewerfull::components::icons { namespace bonsaiviewer::components::icons {
QPixmap renderTintedSvgPixmap(const QString& icon_path, const QString& color, const QSize& size) { QPixmap renderTintedSvgPixmap(const QString& icon_path, const QString& color, const QSize& size) {
QFile file(icon_path); QFile file(icon_path);
@@ -64,7 +64,7 @@ QIcon makeTintedSvgIcon(const QString& icon_path, const QString& normal,
} }
QIcon makeAccentSvgIcon(const QString& icon_path) { QIcon makeAccentSvgIcon(const QString& icon_path) {
const auto& theme = ifcviewerfull::ViewerSettings::instance(); const auto& theme = bonsaiviewer::ViewerSettings::instance();
return makeTintedSvgIcon(icon_path, return makeTintedSvgIcon(icon_path,
theme.color("icon_accent_color"), theme.color("icon_accent_color"),
theme.color("icon_accent_active_color"), theme.color("icon_accent_active_color"),
@@ -72,7 +72,7 @@ QIcon makeAccentSvgIcon(const QString& icon_path) {
} }
QIcon makeSvgIcon(const QString& icon_path) { QIcon makeSvgIcon(const QString& icon_path) {
const auto& theme = ifcviewerfull::ViewerSettings::instance(); const auto& theme = bonsaiviewer::ViewerSettings::instance();
return makeTintedSvgIcon(icon_path, return makeTintedSvgIcon(icon_path,
theme.color("icon_color"), theme.color("icon_color"),
theme.color("icon_active_color"), theme.color("icon_active_color"),
@@ -80,7 +80,7 @@ QIcon makeSvgIcon(const QString& icon_path) {
} }
QPixmap makeSvgPixmap(const QString& icon_path, const QSize& size) { QPixmap makeSvgPixmap(const QString& icon_path, const QSize& size) {
return renderTintedSvgPixmap(icon_path, ifcviewerfull::ViewerSettings::instance().color("icon_color"), size); return renderTintedSvgPixmap(icon_path, bonsaiviewer::ViewerSettings::instance().color("icon_color"), size);
} }
} // namespace ifcviewerfull::components::icons } // namespace bonsaiviewer::components::icons
@@ -26,7 +26,7 @@
#include <QString> #include <QString>
#include <QSize> #include <QSize>
namespace ifcviewerfull::components::icons { namespace bonsaiviewer::components::icons {
QPixmap renderTintedSvgPixmap(const QString& icon_path, const QString& color, const QSize& size); QPixmap renderTintedSvgPixmap(const QString& icon_path, const QString& color, const QSize& size);
QIcon makeTintedSvgIcon(const QString& icon_path, QIcon makeTintedSvgIcon(const QString& icon_path,
@@ -37,6 +37,6 @@ QIcon makeAccentSvgIcon(const QString& icon_path);
QIcon makeSvgIcon(const QString& icon_path); QIcon makeSvgIcon(const QString& icon_path);
QPixmap makeSvgPixmap(const QString& icon_path, const QSize& size); QPixmap makeSvgPixmap(const QString& icon_path, const QSize& size);
} // namespace ifcviewerfull::components::icons } // namespace bonsaiviewer::components::icons
#endif #endif
@@ -20,7 +20,7 @@
#include "Tabs.h" #include "Tabs.h"
namespace ifcviewerfull::components { namespace bonsaiviewer::components {
TabBar::TabBar(QWidget* parent) TabBar::TabBar(QWidget* parent)
: QTabBar(parent) : QTabBar(parent)
@@ -37,4 +37,4 @@ TabWidget::TabWidget(QWidget* parent)
setTabBar(new TabBar(this)); setTabBar(new TabBar(this));
} }
} // namespace ifcviewerfull::components } // namespace bonsaiviewer::components
@@ -24,7 +24,7 @@
#include <QTabBar> #include <QTabBar>
#include <QTabWidget> #include <QTabWidget>
namespace ifcviewerfull::components { namespace bonsaiviewer::components {
class TabBar : public QTabBar { class TabBar : public QTabBar {
Q_OBJECT Q_OBJECT
@@ -40,6 +40,6 @@ public:
explicit TabWidget(QWidget* parent = nullptr); explicit TabWidget(QWidget* parent = nullptr);
}; };
} // namespace ifcviewerfull::components } // namespace bonsaiviewer::components
#endif #endif

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 1005 B

After

Width:  |  Height:  |  Size: 1005 B

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 644 B

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 227 B

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 562 B

After

Width:  |  Height:  |  Size: 562 B

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 556 B

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 834 B

After

Width:  |  Height:  |  Size: 834 B

Before

Width:  |  Height:  |  Size: 437 B

After

Width:  |  Height:  |  Size: 437 B

Before

Width:  |  Height:  |  Size: 611 B

After

Width:  |  Height:  |  Size: 611 B

Before

Width:  |  Height:  |  Size: 688 B

After

Width:  |  Height:  |  Size: 688 B

Before

Width:  |  Height:  |  Size: 528 B

After

Width:  |  Height:  |  Size: 528 B

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 532 B

After

Width:  |  Height:  |  Size: 532 B

Before

Width:  |  Height:  |  Size: 465 B

After

Width:  |  Height:  |  Size: 465 B

Before

Width:  |  Height:  |  Size: 426 B

After

Width:  |  Height:  |  Size: 426 B

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Before

Width:  |  Height:  |  Size: 674 B

After

Width:  |  Height:  |  Size: 674 B

Before

Width:  |  Height:  |  Size: 942 B

After

Width:  |  Height:  |  Size: 942 B

Before

Width:  |  Height:  |  Size: 691 B

After

Width:  |  Height:  |  Size: 691 B

Before

Width:  |  Height:  |  Size: 632 B

After

Width:  |  Height:  |  Size: 632 B

Before

Width:  |  Height:  |  Size: 651 B

After

Width:  |  Height:  |  Size: 651 B

Before

Width:  |  Height:  |  Size: 460 B

After

Width:  |  Height:  |  Size: 460 B

Before

Width:  |  Height:  |  Size: 700 B

After

Width:  |  Height:  |  Size: 700 B

Before

Width:  |  Height:  |  Size: 579 B

After

Width:  |  Height:  |  Size: 579 B

Before

Width:  |  Height:  |  Size: 426 B

After

Width:  |  Height:  |  Size: 426 B

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 435 B

After

Width:  |  Height:  |  Size: 435 B

Before

Width:  |  Height:  |  Size: 795 B

After

Width:  |  Height:  |  Size: 795 B

Before

Width:  |  Height:  |  Size: 995 B

After

Width:  |  Height:  |  Size: 995 B

Before

Width:  |  Height:  |  Size: 458 B

After

Width:  |  Height:  |  Size: 458 B

Before

Width:  |  Height:  |  Size: 717 B

After

Width:  |  Height:  |  Size: 717 B

Before

Width:  |  Height:  |  Size: 1020 B

After

Width:  |  Height:  |  Size: 1020 B

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 875 B

After

Width:  |  Height:  |  Size: 875 B

Before

Width:  |  Height:  |  Size: 786 B

After

Width:  |  Height:  |  Size: 786 B

Before

Width:  |  Height:  |  Size: 533 B

After

Width:  |  Height:  |  Size: 533 B

Before

Width:  |  Height:  |  Size: 516 B

After

Width:  |  Height:  |  Size: 516 B

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

@@ -49,7 +49,7 @@ void installUiFont() {
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
QApplication app(argc, argv); QApplication app(argc, argv);
app.setApplicationName("IfcViewer"); app.setApplicationName("Bonsai Viewer");
app.setOrganizationName("IfcOpenShell"); app.setOrganizationName("IfcOpenShell");
QSurfaceFormat fmt; QSurfaceFormat fmt;
@@ -61,21 +61,21 @@ int main(int argc, char* argv[]) {
QSurfaceFormat::setDefaultFormat(fmt); QSurfaceFormat::setDefaultFormat(fmt);
QCommandLineParser parser; QCommandLineParser parser;
parser.setApplicationDescription("IfcOpenShell IFC viewer"); parser.setApplicationDescription("Bonsai Viewer — IfcOpenShell IFC viewer");
parser.addHelpOption(); parser.addHelpOption();
parser.process(app); parser.process(app);
installUiFont(); installUiFont();
const auto applyStyle = [&app]() { const auto applyStyle = [&app]() {
app.setStyleSheet(ifcviewerfull::components::style::buildAppStyleSheet()); app.setStyleSheet(bonsaiviewer::components::style::buildAppStyleSheet());
}; };
applyStyle(); applyStyle();
QObject::connect(&ifcviewerfull::ViewerSettings::instance(), QObject::connect(&bonsaiviewer::ViewerSettings::instance(),
&ifcviewerfull::ViewerSettings::themeChanged, &bonsaiviewer::ViewerSettings::themeChanged,
&app, &app,
applyStyle); applyStyle);
ifcviewerfull::shell::MainWindow window; bonsaiviewer::shell::MainWindow window;
window.show(); window.show();
return app.exec(); return app.exec();
} }
@@ -29,7 +29,7 @@
#include <QSet> #include <QSet>
#include <QStandardPaths> #include <QStandardPaths>
namespace ifcviewerfull::modules::connectors { namespace bonsaiviewer::modules::connectors {
namespace { namespace {
@@ -85,7 +85,7 @@ QString userConnectorsDir() {
// Win -> %APPDATA% (Roaming) // Win -> %APPDATA% (Roaming)
// matching CLOUD_SYNC_PROTOCOL.md's listed locations. // matching CLOUD_SYNC_PROTOCOL.md's listed locations.
const QString base = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); const QString base = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
return QDir(base).filePath("IfcOpenShell/IfcViewer/connectors"); return QDir(base).filePath("IfcOpenShell/BonsaiViewer/connectors");
} }
std::vector<ConnectorManifest> discoverConnectors() { std::vector<ConnectorManifest> discoverConnectors() {
@@ -111,4 +111,4 @@ std::vector<ConnectorManifest> discoverConnectors() {
return result; return result;
} }
} // namespace ifcviewerfull::modules::connectors } // namespace bonsaiviewer::modules::connectors
@@ -24,7 +24,7 @@
#include <QString> #include <QString>
#include <vector> #include <vector>
namespace ifcviewerfull::modules::connectors { namespace bonsaiviewer::modules::connectors {
struct ConnectorManifest { struct ConnectorManifest {
QString id; // from connector.json; stable identifier QString id; // from connector.json; stable identifier
@@ -45,6 +45,6 @@ std::vector<ConnectorManifest> discoverConnectors();
// for "open user connectors dir" affordances. // for "open user connectors dir" affordances.
QString userConnectorsDir(); QString userConnectorsDir();
} // namespace ifcviewerfull::modules::connectors } // namespace bonsaiviewer::modules::connectors
#endif #endif
@@ -29,7 +29,7 @@
#include <QToolButton> #include <QToolButton>
#include <QVBoxLayout> #include <QVBoxLayout>
namespace ifcviewerfull::modules::connectors { namespace bonsaiviewer::modules::connectors {
ConnectorPickerDialog::ConnectorPickerDialog(const std::vector<ConnectorManifest>& manifests, ConnectorPickerDialog::ConnectorPickerDialog(const std::vector<ConnectorManifest>& manifests,
const QString& title, const QString& title,
@@ -76,4 +76,4 @@ ConnectorPickerDialog::ConnectorPickerDialog(const std::vector<ConnectorManifest
addBodyWidget(choices_section); addBodyWidget(choices_section);
} }
} // namespace ifcviewerfull::modules::connectors } // namespace bonsaiviewer::modules::connectors
@@ -28,7 +28,7 @@
#include <QString> #include <QString>
#include <vector> #include <vector>
namespace ifcviewerfull::modules::connectors { namespace bonsaiviewer::modules::connectors {
// Connector chooser, modelled on AddModelDialog: one button per available // Connector chooser, modelled on AddModelDialog: one button per available
// connector. Always shown (even when only one connector is installed), per // connector. Always shown (even when only one connector is installed), per
@@ -49,6 +49,6 @@ private:
QString selected_id_; QString selected_id_;
}; };
} // namespace ifcviewerfull::modules::connectors } // namespace bonsaiviewer::modules::connectors
#endif #endif
@@ -26,7 +26,7 @@
#include <QStringList> #include <QStringList>
#include <QTimer> #include <QTimer>
namespace ifcviewerfull::modules::connectors { namespace bonsaiviewer::modules::connectors {
namespace { namespace {
@@ -194,4 +194,4 @@ void ConnectorProcess::failPendingAndClear(int code, const QString& message) {
} }
} }
} // namespace ifcviewerfull::modules::connectors } // namespace bonsaiviewer::modules::connectors
@@ -31,7 +31,7 @@
#include <QString> #include <QString>
#include <functional> #include <functional>
namespace ifcviewerfull::modules::connectors { namespace bonsaiviewer::modules::connectors {
// One running connector subprocess. Owns the QProcess, frames stdio as // One running connector subprocess. Owns the QProcess, frames stdio as
// newline-delimited JSON-RPC 2.0, and routes responses back to per-call // newline-delimited JSON-RPC 2.0, and routes responses back to per-call
@@ -93,6 +93,6 @@ private:
QHash<QString, Pending> pending_; QHash<QString, Pending> pending_;
}; };
} // namespace ifcviewerfull::modules::connectors } // namespace bonsaiviewer::modules::connectors
#endif #endif
@@ -24,7 +24,7 @@
#include <QDebug> #include <QDebug>
namespace ifcviewerfull::modules::connectors { namespace bonsaiviewer::modules::connectors {
ConnectorRegistry::ConnectorRegistry(QObject* parent) ConnectorRegistry::ConnectorRegistry(QObject* parent)
: QObject(parent) : QObject(parent)
@@ -106,4 +106,4 @@ void ConnectorRegistry::shutdownAll() {
} }
} }
} // namespace ifcviewerfull::modules::connectors } // namespace bonsaiviewer::modules::connectors
@@ -28,7 +28,7 @@
#include <QString> #include <QString>
#include <vector> #include <vector>
namespace ifcviewerfull::modules::connectors { namespace bonsaiviewer::modules::connectors {
class ConnectorProcess; class ConnectorProcess;
@@ -69,6 +69,6 @@ private:
QString last_error_; QString last_error_;
}; };
} // namespace ifcviewerfull::modules::connectors } // namespace bonsaiviewer::modules::connectors
#endif #endif
@@ -31,7 +31,7 @@
#include <QToolButton> #include <QToolButton>
#include <QVBoxLayout> #include <QVBoxLayout>
namespace ifcviewerfull::modules::models { namespace bonsaiviewer::modules::models {
namespace { namespace {
@@ -157,4 +157,4 @@ void AddModelDialog::setupUi() {
addBodyWidget(choices_section); addBodyWidget(choices_section);
} }
} // namespace ifcviewerfull::modules::models } // namespace bonsaiviewer::modules::models
@@ -23,7 +23,7 @@
#include "../../components/Dialog.h" #include "../../components/Dialog.h"
namespace ifcviewerfull::modules::models { namespace bonsaiviewer::modules::models {
enum class SourceMode { enum class SourceMode {
None, None,
@@ -48,6 +48,6 @@ private:
SourceMode selected_mode_ = SourceMode::None; SourceMode selected_mode_ = SourceMode::None;
}; };
} // namespace ifcviewerfull::modules::models } // namespace bonsaiviewer::modules::models
#endif #endif
@@ -61,7 +61,7 @@
#include <memory> #include <memory>
namespace ifcviewerfull::modules::models::commands { namespace bonsaiviewer::modules::models::commands {
namespace { namespace {
@@ -749,4 +749,4 @@ void openSettings(SessionState& s, QWidget& host) {
dialog.exec(); dialog.exec();
} }
} // namespace ifcviewerfull::modules::models::commands } // namespace bonsaiviewer::modules::models::commands
@@ -29,9 +29,9 @@
class QWidget; class QWidget;
class ViewportWindow; class ViewportWindow;
namespace ifcviewerfull { class SessionState; } namespace bonsaiviewer { class SessionState; }
namespace ifcviewerfull::modules::models::commands { namespace bonsaiviewer::modules::models::commands {
// User-facing commands. Each one is responsible for emitting any notify() // User-facing commands. Each one is responsible for emitting any notify()
// signals exactly once, at the end of its execution. // signals exactly once, at the end of its execution.
@@ -67,6 +67,6 @@ void loadModels(SessionState& s, const QStringList& paths, const QStringList& fe
} // namespace detail } // namespace detail
} // namespace ifcviewerfull::modules::models::commands } // namespace bonsaiviewer::modules::models::commands
#endif #endif
@@ -27,7 +27,7 @@
#include <QBrush> #include <QBrush>
#include <QColor> #include <QColor>
namespace ifcviewerfull::modules::models { namespace bonsaiviewer::modules::models {
namespace { namespace {
@@ -113,7 +113,7 @@ void FederationItemModel::styleRowVisibility(QStandardItem* name_item, bool visi
name_item->setData(QVariant(), Qt::ForegroundRole); name_item->setData(QVariant(), Qt::ForegroundRole);
if (vis_item) vis_item->setData(QVariant(), Qt::ForegroundRole); if (vis_item) vis_item->setData(QVariant(), Qt::ForegroundRole);
} else { } else {
const QBrush disabled(QColor(ifcviewerfull::ViewerSettings::instance().color("disabled_text"))); const QBrush disabled(QColor(bonsaiviewer::ViewerSettings::instance().color("disabled_text")));
name_item->setForeground(disabled); name_item->setForeground(disabled);
if (vis_item) vis_item->setForeground(disabled); if (vis_item) vis_item->setForeground(disabled);
} }
@@ -271,4 +271,4 @@ void FederationItemModel::onModelGroupChanged(const QString& fed_id, const QStri
refreshSubtreeVisibility(taken.first()); refreshSubtreeVisibility(taken.first());
} }
} // namespace ifcviewerfull::modules::models } // namespace bonsaiviewer::modules::models
@@ -28,7 +28,7 @@
class Federation; class Federation;
namespace ifcviewerfull::modules::models { namespace bonsaiviewer::modules::models {
// QStandardItemModel that mirrors the Federation tree (groups + models in // QStandardItemModel that mirrors the Federation tree (groups + models in
// two columns: name + visibility icon). Subscribes directly to Federation's // two columns: name + visibility icon). Subscribes directly to Federation's
@@ -81,6 +81,6 @@ private:
QHash<QString, QStandardItem*> id_to_name_item_; // both group_ids and fed_ids QHash<QString, QStandardItem*> id_to_name_item_; // both group_ids and fed_ids
}; };
} // namespace ifcviewerfull::modules::models } // namespace bonsaiviewer::modules::models
#endif #endif
@@ -40,11 +40,11 @@
#include <QSizePolicy> #include <QSizePolicy>
#include <QTreeView> #include <QTreeView>
namespace ifcviewerfull::modules::models { namespace bonsaiviewer::modules::models {
namespace { namespace {
constexpr auto kDragMimeType = "application/x-ifcviewerfull-model-items"; constexpr auto kDragMimeType = "application/x-bonsaiviewer-model-items";
QString idOf(const QModelIndex& index) { QString idOf(const QModelIndex& index) {
return index.sibling(index.row(), 0).data(FederationItemModel::IdRole).toString(); return index.sibling(index.row(), 0).data(FederationItemModel::IdRole).toString();
@@ -85,7 +85,7 @@ constexpr int kVisibilityColumnWidth = 28;
// messages happen the same way as menu-driven moves. // messages happen the same way as menu-driven moves.
class ModelsTreeView : public QTreeView { class ModelsTreeView : public QTreeView {
public: public:
explicit ModelsTreeView(ifcviewerfull::SessionState* session_state, QWidget* parent) explicit ModelsTreeView(bonsaiviewer::SessionState* session_state, QWidget* parent)
: QTreeView(parent), session_state_(session_state) {} : QTreeView(parent), session_state_(session_state) {}
protected: protected:
@@ -223,12 +223,12 @@ private:
return false; return false;
} }
ifcviewerfull::SessionState* session_state_; bonsaiviewer::SessionState* session_state_;
}; };
} // namespace } // namespace
ModelsPanel::ModelsPanel(ifcviewerfull::SessionState* session_state, ModelsPanel::ModelsPanel(bonsaiviewer::SessionState* session_state,
ViewportWindow* viewport, ViewportWindow* viewport,
QWidget* parent) QWidget* parent)
: components::Panel("Models", nullptr, parent, true) : components::Panel("Models", nullptr, parent, true)
@@ -392,4 +392,4 @@ void ModelsPanel::setModel(FederationItemModel* model) {
tree_->expandAll(); tree_->expandAll();
} }
} // namespace ifcviewerfull::modules::models } // namespace bonsaiviewer::modules::models
@@ -27,9 +27,9 @@
class QTreeView; class QTreeView;
class ViewportWindow; class ViewportWindow;
namespace ifcviewerfull { class SessionState; } namespace bonsaiviewer { class SessionState; }
namespace ifcviewerfull::modules::models { namespace bonsaiviewer::modules::models {
class FederationItemModel; class FederationItemModel;
@@ -40,7 +40,7 @@ class FederationItemModel;
class ModelsPanel : public components::Panel { class ModelsPanel : public components::Panel {
Q_OBJECT Q_OBJECT
public: public:
explicit ModelsPanel(ifcviewerfull::SessionState* session_state, explicit ModelsPanel(bonsaiviewer::SessionState* session_state,
ViewportWindow* viewport, ViewportWindow* viewport,
QWidget* parent = nullptr); QWidget* parent = nullptr);
@@ -49,12 +49,12 @@ public:
void setModel(FederationItemModel* model); void setModel(FederationItemModel* model);
private: private:
ifcviewerfull::SessionState* session_state_ = nullptr; bonsaiviewer::SessionState* session_state_ = nullptr;
ViewportWindow* viewport_ = nullptr; ViewportWindow* viewport_ = nullptr;
QTreeView* tree_ = nullptr; QTreeView* tree_ = nullptr;
FederationItemModel* model_ = nullptr; FederationItemModel* model_ = nullptr;
}; };
} // namespace ifcviewerfull::modules::models } // namespace bonsaiviewer::modules::models
#endif #endif
@@ -46,7 +46,7 @@
#include <QTableWidgetItem> #include <QTableWidgetItem>
#include <QVBoxLayout> #include <QVBoxLayout>
namespace ifcviewerfull::modules::models { namespace bonsaiviewer::modules::models {
namespace { namespace {
@@ -124,7 +124,7 @@ QLabel* makeReadOnlyValue(QWidget* parent) {
} // namespace } // namespace
SettingsDialog::SettingsDialog(ifcviewerfull::SessionState* session_state, QWidget* parent) SettingsDialog::SettingsDialog(bonsaiviewer::SessionState* session_state, QWidget* parent)
: components::TabbedDialog(parent) : components::TabbedDialog(parent)
, session_state_(session_state) , session_state_(session_state)
, federation_(session_state ? session_state->federation() : nullptr) , federation_(session_state ? session_state->federation() : nullptr)
@@ -482,4 +482,4 @@ void SettingsDialog::onAccepted() {
accept(); accept();
} }
} // namespace ifcviewerfull::modules::models } // namespace bonsaiviewer::modules::models
@@ -36,18 +36,18 @@ class QShowEvent;
class QTableWidget; class QTableWidget;
class QTableWidgetItem; class QTableWidgetItem;
namespace ifcviewerfull { namespace bonsaiviewer {
class SessionState; class SessionState;
} }
namespace ifcviewerfull::modules::models { namespace bonsaiviewer::modules::models {
class SettingsView; class SettingsView;
class SettingsDialog : public components::TabbedDialog { class SettingsDialog : public components::TabbedDialog {
Q_OBJECT Q_OBJECT
public: public:
explicit SettingsDialog(ifcviewerfull::SessionState* session_state, QWidget* parent = nullptr); explicit SettingsDialog(bonsaiviewer::SessionState* session_state, QWidget* parent = nullptr);
void renderSelectedModelGeoref(const SelectedModelGeorefState& state); void renderSelectedModelGeoref(const SelectedModelGeorefState& state);
protected: protected:
@@ -69,7 +69,7 @@ private:
void updateSelectedModelGeoref(); void updateSelectedModelGeoref();
void onAccepted(); void onAccepted();
ifcviewerfull::SessionState* session_state_ = nullptr; bonsaiviewer::SessionState* session_state_ = nullptr;
Federation* federation_ = nullptr; Federation* federation_ = nullptr;
SceneLoader* loader_ = nullptr; SceneLoader* loader_ = nullptr;
@@ -100,6 +100,6 @@ private:
SettingsView* settings_view_ = nullptr; SettingsView* settings_view_ = nullptr;
}; };
} // namespace ifcviewerfull::modules::models } // namespace bonsaiviewer::modules::models
#endif #endif
@@ -29,7 +29,7 @@
#include <cmath> #include <cmath>
namespace ifcviewerfull::modules::models { namespace bonsaiviewer::modules::models {
namespace { namespace {
@@ -203,7 +203,7 @@ SelectedModelGeorefState stateFromCachedGeoref(const ModelGeoref& georef) {
} // namespace } // namespace
SettingsView::SettingsView(SettingsDialog* widget, SettingsView::SettingsView(SettingsDialog* widget,
ifcviewerfull::SessionState* session_state) bonsaiviewer::SessionState* session_state)
: widget_(widget), session_state_(session_state) : widget_(widget), session_state_(session_state)
{ {
} }
@@ -243,4 +243,4 @@ void SettingsView::refresh(const QString& fed_id) const {
widget_->renderSelectedModelGeoref(stateFromCachedGeoref(*georef)); widget_->renderSelectedModelGeoref(stateFromCachedGeoref(*georef));
} }
} // namespace ifcviewerfull::modules::models } // namespace bonsaiviewer::modules::models
@@ -23,26 +23,26 @@
#include "Types.h" #include "Types.h"
namespace ifcviewerfull { namespace bonsaiviewer {
class SessionState; class SessionState;
} }
namespace ifcviewerfull::modules::models { namespace bonsaiviewer::modules::models {
class SettingsDialog; class SettingsDialog;
class SettingsView { class SettingsView {
public: public:
explicit SettingsView(SettingsDialog* widget, explicit SettingsView(SettingsDialog* widget,
ifcviewerfull::SessionState* session_state); bonsaiviewer::SessionState* session_state);
void refresh(const QString& fed_id) const; void refresh(const QString& fed_id) const;
private: private:
SettingsDialog* widget_ = nullptr; SettingsDialog* widget_ = nullptr;
ifcviewerfull::SessionState* session_state_ = nullptr; bonsaiviewer::SessionState* session_state_ = nullptr;
}; };
} // namespace ifcviewerfull::modules::models } // namespace bonsaiviewer::modules::models
#endif #endif
@@ -24,7 +24,7 @@
#include <QList> #include <QList>
#include <QString> #include <QString>
namespace ifcviewerfull::modules::models { namespace bonsaiviewer::modules::models {
enum class ItemKind { enum class ItemKind {
Group, Group,
@@ -64,6 +64,6 @@ struct SelectedModelGeorefState {
QString factor_z; QString factor_z;
}; };
} // namespace ifcviewerfull::modules::models } // namespace bonsaiviewer::modules::models
#endif #endif
@@ -27,7 +27,7 @@
#include "../../SessionState.h" #include "../../SessionState.h"
#include "../../../ifcviewer/Federation.h" #include "../../../ifcviewer/Federation.h"
namespace ifcviewerfull::modules::models { namespace bonsaiviewer::modules::models {
namespace { namespace {
@@ -53,7 +53,7 @@ QList<GroupOption> validMoveTargets(const Federation& federation,
} }
ModelsPanelView::ModelsPanelView(ModelsPanel* widget, ModelsPanelView::ModelsPanelView(ModelsPanel* widget,
ifcviewerfull::SessionState* session_state, bonsaiviewer::SessionState* session_state,
QObject* parent) QObject* parent)
: QObject(parent) : QObject(parent)
, widget_(widget) , widget_(widget)
@@ -67,9 +67,9 @@ ModelsPanelView::ModelsPanelView(ModelsPanel* widget,
auto rebuild = [this]() { model_->rebuildAll(); }; auto rebuild = [this]() { model_->rebuildAll(); };
connect(session_state_, &SessionState::projectReset, this, rebuild); connect(session_state_, &SessionState::projectReset, this, rebuild);
connect(session_state_, &SessionState::projectOpened, this, rebuild); connect(session_state_, &SessionState::projectOpened, this, rebuild);
connect(&ifcviewerfull::ViewerSettings::instance(), connect(&bonsaiviewer::ViewerSettings::instance(),
&ifcviewerfull::ViewerSettings::themeChanged, &bonsaiviewer::ViewerSettings::themeChanged,
this, rebuild); this, rebuild);
} }
} // namespace ifcviewerfull::modules::models } // namespace bonsaiviewer::modules::models
@@ -26,9 +26,9 @@
#include <QObject> #include <QObject>
class Federation; class Federation;
namespace ifcviewerfull { class SessionState; } namespace bonsaiviewer { class SessionState; }
namespace ifcviewerfull::modules::models { namespace bonsaiviewer::modules::models {
class FederationItemModel; class FederationItemModel;
class ModelsPanel; class ModelsPanel;
@@ -49,15 +49,15 @@ class ModelsPanelView : public QObject {
Q_OBJECT Q_OBJECT
public: public:
explicit ModelsPanelView(ModelsPanel* widget, explicit ModelsPanelView(ModelsPanel* widget,
ifcviewerfull::SessionState* session_state, bonsaiviewer::SessionState* session_state,
QObject* parent = nullptr); QObject* parent = nullptr);
private: private:
ModelsPanel* widget_ = nullptr; ModelsPanel* widget_ = nullptr;
ifcviewerfull::SessionState* session_state_ = nullptr; bonsaiviewer::SessionState* session_state_ = nullptr;
FederationItemModel* model_ = nullptr; FederationItemModel* model_ = nullptr;
}; };
} // namespace ifcviewerfull::modules::models } // namespace bonsaiviewer::modules::models
#endif #endif
@@ -46,7 +46,7 @@
#include <memory> #include <memory>
namespace ifcviewerfull::modules::project::commands { namespace bonsaiviewer::modules::project::commands {
namespace { namespace {
@@ -668,4 +668,4 @@ bool saveProjectDialog(SessionState& s, QWidget& host) {
return false; return false;
} }
} // namespace ifcviewerfull::modules::project::commands } // namespace bonsaiviewer::modules::project::commands
@@ -25,9 +25,9 @@
class QWidget; class QWidget;
class ViewportWindow; class ViewportWindow;
namespace ifcviewerfull { class SessionState; } namespace bonsaiviewer { class SessionState; }
namespace ifcviewerfull::modules::project::commands { namespace bonsaiviewer::modules::project::commands {
// User-facing commands. Each owns its own dialogs and confirmations; each // User-facing commands. Each owns its own dialogs and confirmations; each
// emits exactly one notify() at the end (projectReset / projectOpened / // emits exactly one notify() at the end (projectReset / projectOpened /
@@ -58,6 +58,6 @@ bool saveAsCloudProject(SessionState& s, QWidget& host);
// Project" ribbon button is wired to. // Project" ribbon button is wired to.
bool saveProjectDialog(SessionState& s, QWidget& host); bool saveProjectDialog(SessionState& s, QWidget& host);
} // namespace ifcviewerfull::modules::project::commands } // namespace bonsaiviewer::modules::project::commands
#endif #endif

Some files were not shown because too many files have changed in this diff Show More