mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 03:19:53 +00:00
Clean up IfcViewerFull naming
Rename leftover interface-era namespaces, settings, and resource identifiers inside the IfcViewerFull source tree without changing the public target name. Generated with the assistance of an AI coding tool.
This commit is contained in:
@@ -27,8 +27,8 @@ set(IFCVIEWER_FULL_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ElementRegistry.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ElementRegistry.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/InterfaceSettings.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/InterfaceSettings.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ViewerSettings.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ViewerSettings.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/SessionState.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/SessionState.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/MainWindow.cpp
|
||||
@@ -84,7 +84,7 @@ set(IFCVIEWER_FULL_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/modules/viewport/Panel.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/modules/viewport/Controller.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/modules/viewport/Controller.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/interface_resources.qrc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ifcviewer_full_resources.qrc
|
||||
)
|
||||
|
||||
add_executable(IfcViewerFull ${IFCVIEWER_FULL_FILES})
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "../ifcviewer/SceneLoader.h"
|
||||
#include "../ifcviewer/SidecarCache.h"
|
||||
|
||||
namespace ifcinterface {
|
||||
namespace ifcviewerfull {
|
||||
|
||||
ElementRegistry::ElementRegistry(QObject* parent)
|
||||
: QObject(parent)
|
||||
@@ -123,4 +123,4 @@ void ElementRegistry::onStreamedElementsReady(uint32_t /*mid*/, std::vector<Elem
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ifcinterface
|
||||
} // namespace ifcviewerfull
|
||||
|
||||
@@ -33,7 +33,7 @@ class SceneLoader;
|
||||
struct PackedElementInfo;
|
||||
struct ElementInfo;
|
||||
|
||||
namespace ifcinterface {
|
||||
namespace ifcviewerfull {
|
||||
|
||||
struct BasicElementInfo {
|
||||
uint32_t object_id = 0;
|
||||
@@ -67,6 +67,6 @@ private:
|
||||
std::unordered_map<uint32_t, BasicElementInfo> elements_;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface
|
||||
} // namespace ifcviewerfull
|
||||
|
||||
#endif
|
||||
|
||||
@@ -57,27 +57,27 @@
|
||||
#include <QToolButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace ifcinterface::shell {
|
||||
namespace ifcviewerfull::shell {
|
||||
|
||||
MainWindow::MainWindow(QWidget* parent)
|
||||
: QMainWindow(parent)
|
||||
{
|
||||
federation_ = new Federation(this);
|
||||
element_registry_ = new ifcinterface::ElementRegistry(this);
|
||||
session_state_ = new ifcinterface::SessionState(this);
|
||||
element_registry_ = new ifcviewerfull::ElementRegistry(this);
|
||||
session_state_ = new ifcviewerfull::SessionState(this);
|
||||
session_state_->bindFederation(federation_);
|
||||
session_state_->bindElementRegistry(element_registry_);
|
||||
connect(federation_, &Federation::dirtyChanged, this, [this](bool dirty) {
|
||||
setWindowModified(dirty);
|
||||
updateWindowTitle();
|
||||
});
|
||||
connect(session_state_, &ifcinterface::SessionState::modelsChanged,
|
||||
connect(session_state_, &ifcviewerfull::SessionState::modelsChanged,
|
||||
this, &MainWindow::updateWindowTitle);
|
||||
connect(session_state_, &ifcinterface::SessionState::projectOpened,
|
||||
connect(session_state_, &ifcviewerfull::SessionState::projectOpened,
|
||||
this, [this](const QString&) { updateWindowTitle(); });
|
||||
connect(session_state_, &ifcinterface::SessionState::projectSaved,
|
||||
connect(session_state_, &ifcviewerfull::SessionState::projectSaved,
|
||||
this, [this](const QString&) { updateWindowTitle(); });
|
||||
connect(session_state_, &ifcinterface::SessionState::projectReset,
|
||||
connect(session_state_, &ifcviewerfull::SessionState::projectReset,
|
||||
this, &MainWindow::updateWindowTitle);
|
||||
setupChrome();
|
||||
setupViewport();
|
||||
@@ -448,7 +448,7 @@ void MainWindow::setupStatus() {
|
||||
status_perf_label_->setVisible(show);
|
||||
if (!show) status_perf_label_->clear();
|
||||
});
|
||||
connect(session_state_, &ifcinterface::SessionState::statusMessageChanged,
|
||||
connect(session_state_, &ifcviewerfull::SessionState::statusMessageChanged,
|
||||
this, [this](const QString& mode, const QString& detail) {
|
||||
status_mode_label_->setText(mode);
|
||||
status_selection_label_->setText(detail);
|
||||
@@ -528,4 +528,4 @@ void MainWindow::updateWindowTitle() {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::shell
|
||||
} // namespace ifcviewerfull::shell
|
||||
|
||||
@@ -32,21 +32,21 @@ class QStackedWidget;
|
||||
class QToolButton;
|
||||
class Federation;
|
||||
class SceneLoader;
|
||||
namespace ifcinterface { class ElementRegistry; }
|
||||
namespace ifcinterface { class SessionState; }
|
||||
namespace ifcinterface::components { class TabBar; }
|
||||
namespace ifcinterface::modules::models { class ModelsPanelController; }
|
||||
namespace ifcinterface::modules::models { class ModelsPanel; }
|
||||
namespace ifcinterface::modules::models { class ModelsPanelView; }
|
||||
namespace ifcinterface::modules::project { class ProjectController; }
|
||||
namespace ifcinterface::modules::spatial_hierarchy { class SpatialHierarchyPanel; }
|
||||
namespace ifcinterface::modules::spatial_hierarchy { class SpatialHierarchyPanelView; }
|
||||
namespace ifcinterface::modules::properties { class PropertiesPanel; }
|
||||
namespace ifcinterface::modules::properties { class PropertiesPanelView; }
|
||||
namespace ifcinterface::modules::viewport { class ViewportController; }
|
||||
namespace ifcinterface::modules::viewport { class ViewportPanel; }
|
||||
namespace ifcviewerfull { class ElementRegistry; }
|
||||
namespace ifcviewerfull { class SessionState; }
|
||||
namespace ifcviewerfull::components { class TabBar; }
|
||||
namespace ifcviewerfull::modules::models { class ModelsPanelController; }
|
||||
namespace ifcviewerfull::modules::models { class ModelsPanel; }
|
||||
namespace ifcviewerfull::modules::models { class ModelsPanelView; }
|
||||
namespace ifcviewerfull::modules::project { class ProjectController; }
|
||||
namespace ifcviewerfull::modules::spatial_hierarchy { class SpatialHierarchyPanel; }
|
||||
namespace ifcviewerfull::modules::spatial_hierarchy { class SpatialHierarchyPanelView; }
|
||||
namespace ifcviewerfull::modules::properties { class PropertiesPanel; }
|
||||
namespace ifcviewerfull::modules::properties { class PropertiesPanelView; }
|
||||
namespace ifcviewerfull::modules::viewport { class ViewportController; }
|
||||
namespace ifcviewerfull::modules::viewport { class ViewportPanel; }
|
||||
|
||||
namespace ifcinterface::shell {
|
||||
namespace ifcviewerfull::shell {
|
||||
|
||||
class MainWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
@@ -73,30 +73,30 @@ private:
|
||||
QLabel* status_selection_label_ = nullptr;
|
||||
QLabel* status_perf_label_ = nullptr;
|
||||
QProgressBar* status_progress_bar_ = nullptr;
|
||||
ifcinterface::components::TabBar* ribbon_tabs_ = nullptr;
|
||||
ifcviewerfull::components::TabBar* ribbon_tabs_ = nullptr;
|
||||
QStackedWidget* ribbon_pages_ = nullptr;
|
||||
ifcinterface::modules::viewport::ViewportPanel* viewport_widget_ = nullptr;
|
||||
ifcinterface::modules::viewport::ViewportController* viewport_controller_ = nullptr;
|
||||
ifcviewerfull::modules::viewport::ViewportPanel* viewport_widget_ = nullptr;
|
||||
ifcviewerfull::modules::viewport::ViewportController* viewport_controller_ = nullptr;
|
||||
SceneLoader* loader_ = nullptr;
|
||||
ifcinterface::ElementRegistry* element_registry_ = nullptr;
|
||||
ifcinterface::SessionState* session_state_ = nullptr;
|
||||
ifcinterface::modules::models::ModelsPanel* models_panel_ = nullptr;
|
||||
ifcinterface::modules::spatial_hierarchy::SpatialHierarchyPanel* spatial_panel_ = nullptr;
|
||||
ifcviewerfull::ElementRegistry* element_registry_ = nullptr;
|
||||
ifcviewerfull::SessionState* session_state_ = nullptr;
|
||||
ifcviewerfull::modules::models::ModelsPanel* models_panel_ = nullptr;
|
||||
ifcviewerfull::modules::spatial_hierarchy::SpatialHierarchyPanel* spatial_panel_ = nullptr;
|
||||
QDockWidget* layers_panel_ = nullptr;
|
||||
ifcinterface::modules::properties::PropertiesPanel* properties_panel_ = nullptr;
|
||||
ifcviewerfull::modules::properties::PropertiesPanel* properties_panel_ = nullptr;
|
||||
QDockWidget* stored_views_panel_ = nullptr;
|
||||
QDockWidget* search_panel_ = nullptr;
|
||||
QDockWidget* spreadsheet_panel_ = nullptr;
|
||||
QDockWidget* audit_panel_ = nullptr;
|
||||
QDockWidget* clash_panel_ = nullptr;
|
||||
QDockWidget* issues_panel_ = nullptr;
|
||||
ifcinterface::modules::models::ModelsPanelController* models_controller_ = nullptr;
|
||||
ifcinterface::modules::models::ModelsPanelView* models_view_ = nullptr;
|
||||
ifcinterface::modules::project::ProjectController* project_controller_ = nullptr;
|
||||
ifcinterface::modules::spatial_hierarchy::SpatialHierarchyPanelView* spatial_view_ = nullptr;
|
||||
ifcinterface::modules::properties::PropertiesPanelView* properties_view_ = nullptr;
|
||||
ifcviewerfull::modules::models::ModelsPanelController* models_controller_ = nullptr;
|
||||
ifcviewerfull::modules::models::ModelsPanelView* models_view_ = nullptr;
|
||||
ifcviewerfull::modules::project::ProjectController* project_controller_ = nullptr;
|
||||
ifcviewerfull::modules::spatial_hierarchy::SpatialHierarchyPanelView* spatial_view_ = nullptr;
|
||||
ifcviewerfull::modules::properties::PropertiesPanelView* properties_view_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::shell
|
||||
} // namespace ifcviewerfull::shell
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "../ifcviewer/Federation.h"
|
||||
|
||||
namespace ifcinterface {
|
||||
namespace ifcviewerfull {
|
||||
|
||||
SessionState::SessionState(QObject* parent)
|
||||
: QObject(parent)
|
||||
@@ -108,4 +108,4 @@ void SessionState::notifyProjectReset() {
|
||||
emit projectReset();
|
||||
}
|
||||
|
||||
} // namespace ifcinterface
|
||||
} // namespace ifcviewerfull
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
class Federation;
|
||||
class SceneLoader;
|
||||
|
||||
namespace ifcinterface {
|
||||
namespace ifcviewerfull {
|
||||
|
||||
class ElementRegistry;
|
||||
|
||||
@@ -88,6 +88,6 @@ private:
|
||||
QHash<uint32_t, QString> model_id_to_fed_id_;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface
|
||||
} // namespace ifcviewerfull
|
||||
|
||||
#endif
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* *
|
||||
********************************************************************************/
|
||||
|
||||
#include "InterfaceSettings.h"
|
||||
#include "ViewerSettings.h"
|
||||
|
||||
#include "components/Style.h"
|
||||
|
||||
@@ -30,45 +30,45 @@ namespace {
|
||||
constexpr const char* kThemeModeKey = "interface/theme/mode";
|
||||
constexpr const char* kThemeColorPrefix = "interface/theme/colors/";
|
||||
|
||||
using Spec = ifcinterface::InterfaceSettings::ThemeColorSpec;
|
||||
using Spec = ifcviewerfull::ViewerSettings::ThemeColorSpec;
|
||||
|
||||
const std::vector<Spec> kThemeColorSpecs = {
|
||||
{"app_background", "App Background", ifcinterface::components::style::palette::app_background, "#eef1f5"},
|
||||
{"border", "Border", ifcinterface::components::style::palette::border, "#c9d1dc"},
|
||||
{"selection_background", "Selection Background", ifcinterface::components::style::palette::selection_background,
|
||||
{"app_background", "App Background", ifcviewerfull::components::style::palette::app_background, "#eef1f5"},
|
||||
{"border", "Border", ifcviewerfull::components::style::palette::border, "#c9d1dc"},
|
||||
{"selection_background", "Selection Background", ifcviewerfull::components::style::palette::selection_background,
|
||||
"#2f9e44"},
|
||||
{"tab_bar_background", "Tab Bar Background", ifcinterface::components::style::palette::tab_bar_background,
|
||||
{"tab_bar_background", "Tab Bar Background", ifcviewerfull::components::style::palette::tab_bar_background,
|
||||
"#eef1f5"},
|
||||
{"tab_background", "Tab Background", ifcinterface::components::style::palette::tab_background, "#e3e8ef"},
|
||||
{"ribbon_background", "Ribbon Background", ifcinterface::components::style::palette::ribbon_background,
|
||||
{"tab_background", "Tab Background", ifcviewerfull::components::style::palette::tab_background, "#e3e8ef"},
|
||||
{"ribbon_background", "Ribbon Background", ifcviewerfull::components::style::palette::ribbon_background,
|
||||
"#e3e8ef"},
|
||||
{"ribbon_button_hover", "Ribbon Button Hover", ifcinterface::components::style::palette::ribbon_button_hover,
|
||||
{"ribbon_button_hover", "Ribbon Button Hover", ifcviewerfull::components::style::palette::ribbon_button_hover,
|
||||
"#d6dde7"},
|
||||
{"ribbon_button_pressed", "Ribbon Button Pressed", ifcinterface::components::style::palette::ribbon_button_pressed,
|
||||
{"ribbon_button_pressed", "Ribbon Button Pressed", ifcviewerfull::components::style::palette::ribbon_button_pressed,
|
||||
"#cad3df"},
|
||||
{"viewport_shell_background", "Viewport Shell Background",
|
||||
ifcinterface::components::style::palette::viewport_shell_background, "#dbe1e8"},
|
||||
{"viewport_background", "Viewport Background", ifcinterface::components::style::palette::viewport_background,
|
||||
ifcviewerfull::components::style::palette::viewport_shell_background, "#dbe1e8"},
|
||||
{"viewport_background", "Viewport Background", ifcviewerfull::components::style::palette::viewport_background,
|
||||
"#eef2f6"},
|
||||
{"panel_background", "Panel Background", ifcinterface::components::style::palette::panel_background, "#ffffff"},
|
||||
{"control_background", "Control Background", ifcinterface::components::style::palette::control_background,
|
||||
{"panel_background", "Panel Background", ifcviewerfull::components::style::palette::panel_background, "#ffffff"},
|
||||
{"control_background", "Control Background", ifcviewerfull::components::style::palette::control_background,
|
||||
"#f5f7fa"},
|
||||
{"control_border_focus", "Control Border Focus", ifcinterface::components::style::palette::control_border_focus,
|
||||
{"control_border_focus", "Control Border Focus", ifcviewerfull::components::style::palette::control_border_focus,
|
||||
"#7c8ca3"},
|
||||
{"box_background", "Box Background", ifcinterface::components::style::palette::box_background, "#f5f7fa"},
|
||||
{"scroll_handle", "Scroll Handle", ifcinterface::components::style::palette::scroll_handle, "#b1bac8"},
|
||||
{"scroll_handle_hover", "Scroll Handle Hover", ifcinterface::components::style::palette::scroll_handle_hover,
|
||||
{"box_background", "Box Background", ifcviewerfull::components::style::palette::box_background, "#f5f7fa"},
|
||||
{"scroll_handle", "Scroll Handle", ifcviewerfull::components::style::palette::scroll_handle, "#b1bac8"},
|
||||
{"scroll_handle_hover", "Scroll Handle Hover", ifcviewerfull::components::style::palette::scroll_handle_hover,
|
||||
"#929daf"},
|
||||
{"status_background", "Status Background", ifcinterface::components::style::palette::status_background,
|
||||
{"status_background", "Status Background", ifcviewerfull::components::style::palette::status_background,
|
||||
"#edf1f5"},
|
||||
{"section_header_background", "Section Header Background",
|
||||
ifcinterface::components::style::palette::section_header_background, "#eef2f6"},
|
||||
{"primary_text", "Primary Text", ifcinterface::components::style::palette::primary_text, "#1f2937"},
|
||||
{"secondary_text", "Secondary Text", ifcinterface::components::style::palette::secondary_text, "#5b6676"},
|
||||
{"disabled_text", "Disabled Text", ifcinterface::components::style::palette::disabled_text, "#8b95a3"},
|
||||
{"warning_text", "Warning Text", ifcinterface::components::style::palette::warning_text, "#b26b00"},
|
||||
{"selection_text", "Selection Text", ifcinterface::components::style::palette::selection_text, "#ffffff"},
|
||||
{"hover_text", "Hover Text", ifcinterface::components::style::palette::hover_text, "#0f172a"},
|
||||
ifcviewerfull::components::style::palette::section_header_background, "#eef2f6"},
|
||||
{"primary_text", "Primary Text", ifcviewerfull::components::style::palette::primary_text, "#1f2937"},
|
||||
{"secondary_text", "Secondary Text", ifcviewerfull::components::style::palette::secondary_text, "#5b6676"},
|
||||
{"disabled_text", "Disabled Text", ifcviewerfull::components::style::palette::disabled_text, "#8b95a3"},
|
||||
{"warning_text", "Warning Text", ifcviewerfull::components::style::palette::warning_text, "#b26b00"},
|
||||
{"selection_text", "Selection Text", ifcviewerfull::components::style::palette::selection_text, "#ffffff"},
|
||||
{"hover_text", "Hover Text", ifcviewerfull::components::style::palette::hover_text, "#0f172a"},
|
||||
{"icon_color", "Icon Color", "#e7ebf2", "#445066"},
|
||||
{"icon_active_color", "Icon Active Color", "#ffffff", "#101828"},
|
||||
{"icon_disabled_color", "Icon Disabled Color", "#6f7988", "#98a2b3"},
|
||||
@@ -93,27 +93,27 @@ QString normalizedColor(const QString& value, const QString& fallback) {
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace ifcinterface {
|
||||
namespace ifcviewerfull {
|
||||
|
||||
InterfaceSettings& InterfaceSettings::instance() {
|
||||
static InterfaceSettings inst;
|
||||
ViewerSettings& ViewerSettings::instance() {
|
||||
static ViewerSettings inst;
|
||||
return inst;
|
||||
}
|
||||
|
||||
const std::vector<InterfaceSettings::ThemeColorSpec>& InterfaceSettings::themeColorSpecs() {
|
||||
const std::vector<ViewerSettings::ThemeColorSpec>& ViewerSettings::themeColorSpecs() {
|
||||
return kThemeColorSpecs;
|
||||
}
|
||||
|
||||
InterfaceSettings::InterfaceSettings() {
|
||||
ViewerSettings::ViewerSettings() {
|
||||
custom_colors_.resize(kThemeColorSpecs.size());
|
||||
load();
|
||||
}
|
||||
|
||||
InterfaceSettings::ThemeMode InterfaceSettings::themeMode() const {
|
||||
ViewerSettings::ThemeMode ViewerSettings::themeMode() const {
|
||||
return theme_mode_;
|
||||
}
|
||||
|
||||
void InterfaceSettings::setThemeMode(ThemeMode mode) {
|
||||
void ViewerSettings::setThemeMode(ThemeMode mode) {
|
||||
if (theme_mode_ == mode) return;
|
||||
theme_mode_ = mode;
|
||||
persist();
|
||||
@@ -121,7 +121,7 @@ void InterfaceSettings::setThemeMode(ThemeMode mode) {
|
||||
emit themeChanged();
|
||||
}
|
||||
|
||||
QString InterfaceSettings::color(const QString& key) const {
|
||||
QString ViewerSettings::color(const QString& key) const {
|
||||
const int index = colorIndexForKey(key);
|
||||
if (index < 0) return {};
|
||||
|
||||
@@ -137,7 +137,7 @@ QString InterfaceSettings::color(const QString& key) const {
|
||||
return QString::fromUtf8(spec.dark_default);
|
||||
}
|
||||
|
||||
QString InterfaceSettings::customColor(const QString& key) const {
|
||||
QString ViewerSettings::customColor(const QString& key) const {
|
||||
const int index = colorIndexForKey(key);
|
||||
if (index < 0) return {};
|
||||
const auto& spec = kThemeColorSpecs[static_cast<size_t>(index)];
|
||||
@@ -145,7 +145,7 @@ QString InterfaceSettings::customColor(const QString& key) const {
|
||||
return stored.isEmpty() ? QString::fromUtf8(spec.dark_default) : stored;
|
||||
}
|
||||
|
||||
void InterfaceSettings::setCustomColor(const QString& key, const QString& value) {
|
||||
void ViewerSettings::setCustomColor(const QString& key, const QString& value) {
|
||||
const int index = colorIndexForKey(key);
|
||||
if (index < 0) return;
|
||||
|
||||
@@ -160,7 +160,7 @@ void InterfaceSettings::setCustomColor(const QString& key, const QString& value)
|
||||
}
|
||||
}
|
||||
|
||||
void InterfaceSettings::load() {
|
||||
void ViewerSettings::load() {
|
||||
QSettings settings;
|
||||
int raw_mode = settings.value(kThemeModeKey, static_cast<int>(ThemeMode::Dark)).toInt();
|
||||
if (raw_mode < static_cast<int>(ThemeMode::Dark) || raw_mode > static_cast<int>(ThemeMode::Custom)) {
|
||||
@@ -177,7 +177,7 @@ void InterfaceSettings::load() {
|
||||
}
|
||||
}
|
||||
|
||||
void InterfaceSettings::persist() const {
|
||||
void ViewerSettings::persist() const {
|
||||
QSettings settings;
|
||||
settings.setValue(kThemeModeKey, static_cast<int>(theme_mode_));
|
||||
for (size_t i = 0; i < kThemeColorSpecs.size(); ++i) {
|
||||
@@ -186,4 +186,4 @@ void InterfaceSettings::persist() const {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ifcinterface
|
||||
} // namespace ifcviewerfull
|
||||
@@ -25,9 +25,9 @@
|
||||
#include <QString>
|
||||
#include <vector>
|
||||
|
||||
namespace ifcinterface {
|
||||
namespace ifcviewerfull {
|
||||
|
||||
class InterfaceSettings : public QObject {
|
||||
class ViewerSettings : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum class ThemeMode {
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
const char* light_default;
|
||||
};
|
||||
|
||||
static InterfaceSettings& instance();
|
||||
static ViewerSettings& instance();
|
||||
static const std::vector<ThemeColorSpec>& themeColorSpecs();
|
||||
|
||||
ThemeMode themeMode() const;
|
||||
@@ -59,7 +59,7 @@ signals:
|
||||
void themeChanged();
|
||||
|
||||
private:
|
||||
InterfaceSettings();
|
||||
ViewerSettings();
|
||||
void load();
|
||||
void persist() const;
|
||||
|
||||
@@ -67,6 +67,6 @@ private:
|
||||
std::vector<QString> custom_colors_;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface
|
||||
} // namespace ifcviewerfull
|
||||
|
||||
#endif
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <QToolButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace ifcinterface::components::buttons {
|
||||
namespace ifcviewerfull::components::buttons {
|
||||
|
||||
QToolButton* makeButton(const QString& text,
|
||||
const QString& icon_path,
|
||||
@@ -74,4 +74,4 @@ QWidget* makeButtonGroup(const QString& title,
|
||||
return group;
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::components::buttons
|
||||
} // namespace ifcviewerfull::components::buttons
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
class QToolButton;
|
||||
class QWidget;
|
||||
|
||||
namespace ifcinterface::components::buttons {
|
||||
namespace ifcviewerfull::components::buttons {
|
||||
|
||||
QToolButton* makeButton(const QString& text,
|
||||
const QString& icon_path,
|
||||
@@ -38,6 +38,6 @@ QWidget* makeButtonGroup(const QString& title,
|
||||
bool trailing_separator = true,
|
||||
int vertical_spacing = 4);
|
||||
|
||||
} // namespace ifcinterface::components::buttons
|
||||
} // namespace ifcviewerfull::components::buttons
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <QScrollArea>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace ifcinterface::components {
|
||||
namespace ifcviewerfull::components {
|
||||
|
||||
Dialog::Dialog(QWidget* parent, bool scrollable)
|
||||
: QDialog(parent)
|
||||
@@ -140,4 +140,4 @@ void TabbedDialog::addFooterWidget(QWidget* widget) {
|
||||
footer_layout_->addWidget(widget);
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::components
|
||||
} // namespace ifcviewerfull::components
|
||||
|
||||
@@ -27,7 +27,7 @@ class QVBoxLayout;
|
||||
class QWidget;
|
||||
class QTabWidget;
|
||||
|
||||
namespace ifcinterface::components {
|
||||
namespace ifcviewerfull::components {
|
||||
|
||||
class Dialog : public QDialog {
|
||||
Q_OBJECT
|
||||
@@ -58,6 +58,6 @@ private:
|
||||
QVBoxLayout* footer_layout_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::components
|
||||
} // namespace ifcviewerfull::components
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
|
||||
namespace ifcinterface::components {
|
||||
namespace ifcviewerfull::components {
|
||||
|
||||
KeyValueTable::KeyValueTable(const QList<KeyValueTableRow>& rows, QWidget* parent)
|
||||
: QWidget(parent)
|
||||
@@ -69,4 +69,4 @@ KeyValueTable::KeyValueTable(const QList<KeyValueTableRow>& rows, QWidget* paren
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::components
|
||||
} // namespace ifcviewerfull::components
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
namespace ifcinterface::components {
|
||||
namespace ifcviewerfull::components {
|
||||
|
||||
struct KeyValueTableRow {
|
||||
QString key;
|
||||
@@ -42,6 +42,6 @@ public:
|
||||
explicit KeyValueTable(const QList<KeyValueTableRow>& rows, QWidget* parent = nullptr);
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::components
|
||||
} // namespace ifcviewerfull::components
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <QToolButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace ifcinterface::components {
|
||||
namespace ifcviewerfull::components {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -137,4 +137,4 @@ void Panel::clearBodyWidgets() {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::components
|
||||
} // namespace ifcviewerfull::components
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
class QWidget;
|
||||
class QVBoxLayout;
|
||||
|
||||
namespace ifcinterface::components {
|
||||
namespace ifcviewerfull::components {
|
||||
|
||||
class Panel : public QDockWidget {
|
||||
Q_OBJECT
|
||||
@@ -48,6 +48,6 @@ private:
|
||||
QVBoxLayout* body_layout_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::components
|
||||
} // namespace ifcviewerfull::components
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <QToolButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace ifcinterface::components {
|
||||
namespace ifcviewerfull::components {
|
||||
|
||||
Section::Section(const QString& title, SectionHeaderMode header_mode, QWidget* parent)
|
||||
: QWidget(parent)
|
||||
@@ -115,4 +115,4 @@ void Section::setBodyExpanding(bool expanding) {
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::components
|
||||
} // namespace ifcviewerfull::components
|
||||
|
||||
@@ -27,7 +27,7 @@ class QHBoxLayout;
|
||||
class QToolButton;
|
||||
class QVBoxLayout;
|
||||
|
||||
namespace ifcinterface::components {
|
||||
namespace ifcviewerfull::components {
|
||||
|
||||
enum class SectionHeaderMode {
|
||||
Visible,
|
||||
@@ -56,6 +56,6 @@ private:
|
||||
bool body_expanding_ = false;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::components
|
||||
} // namespace ifcviewerfull::components
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
|
||||
#include "Style.h"
|
||||
|
||||
#include "../InterfaceSettings.h"
|
||||
#include "../ViewerSettings.h"
|
||||
|
||||
namespace ifcinterface::components::style {
|
||||
namespace ifcviewerfull::components::style {
|
||||
|
||||
QString buildAppStyleSheet() {
|
||||
const auto& theme = ifcinterface::InterfaceSettings::instance();
|
||||
const auto& theme = ifcviewerfull::ViewerSettings::instance();
|
||||
QString stylesheet = QStringLiteral(R"(
|
||||
QMainWindow#appWindow {
|
||||
background: ${app_background};
|
||||
@@ -494,4 +494,4 @@ QString buildAppStyleSheet() {
|
||||
return stylesheet;
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::components::style
|
||||
} // namespace ifcviewerfull::components::style
|
||||
|
||||
@@ -23,22 +23,22 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace ifcinterface::components::style::metrics {
|
||||
namespace ifcviewerfull::components::style::metrics {
|
||||
|
||||
inline constexpr int padding = 6;
|
||||
inline constexpr int section_body_padding = 10;
|
||||
inline constexpr int section_header_padding = 2;
|
||||
inline constexpr int panel_radius = 3;
|
||||
|
||||
} // namespace ifcinterface::components::style::metrics
|
||||
} // namespace ifcviewerfull::components::style::metrics
|
||||
|
||||
namespace ifcinterface::components::style::typography {
|
||||
namespace ifcviewerfull::components::style::typography {
|
||||
|
||||
inline constexpr int small = 10;
|
||||
|
||||
} // namespace ifcinterface::components::style::typography
|
||||
} // namespace ifcviewerfull::components::style::typography
|
||||
|
||||
namespace ifcinterface::components::style::palette {
|
||||
namespace ifcviewerfull::components::style::palette {
|
||||
|
||||
inline constexpr auto app_background = "#26292f";
|
||||
inline constexpr auto border = "#3e444e";
|
||||
@@ -66,12 +66,12 @@ inline constexpr auto warning_text = "#e4b35a";
|
||||
inline constexpr auto selection_text = "#14161a";
|
||||
inline constexpr auto hover_text = "#ffffff";
|
||||
|
||||
} // namespace ifcinterface::components::style::palette
|
||||
} // namespace ifcviewerfull::components::style::palette
|
||||
|
||||
namespace ifcinterface::components::style {
|
||||
namespace ifcviewerfull::components::style {
|
||||
|
||||
QString buildAppStyleSheet();
|
||||
|
||||
} // namespace ifcinterface::components::style
|
||||
} // namespace ifcviewerfull::components::style
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
|
||||
#include "SvgIcon.h"
|
||||
|
||||
#include "../InterfaceSettings.h"
|
||||
#include "../ViewerSettings.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QPainter>
|
||||
#include <QRegularExpression>
|
||||
#include <QSvgRenderer>
|
||||
|
||||
namespace ifcinterface::components::icons {
|
||||
namespace ifcviewerfull::components::icons {
|
||||
|
||||
QPixmap renderTintedSvgPixmap(const QString& icon_path, const QString& color, const QSize& size) {
|
||||
QFile file(icon_path);
|
||||
@@ -64,7 +64,7 @@ QIcon makeTintedSvgIcon(const QString& icon_path, const QString& normal,
|
||||
}
|
||||
|
||||
QIcon makeAccentSvgIcon(const QString& icon_path) {
|
||||
const auto& theme = ifcinterface::InterfaceSettings::instance();
|
||||
const auto& theme = ifcviewerfull::ViewerSettings::instance();
|
||||
return makeTintedSvgIcon(icon_path,
|
||||
theme.color("icon_accent_color"),
|
||||
theme.color("icon_accent_active_color"),
|
||||
@@ -72,7 +72,7 @@ QIcon makeAccentSvgIcon(const QString& icon_path) {
|
||||
}
|
||||
|
||||
QIcon makeSvgIcon(const QString& icon_path) {
|
||||
const auto& theme = ifcinterface::InterfaceSettings::instance();
|
||||
const auto& theme = ifcviewerfull::ViewerSettings::instance();
|
||||
return makeTintedSvgIcon(icon_path,
|
||||
theme.color("icon_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) {
|
||||
return renderTintedSvgPixmap(icon_path, ifcinterface::InterfaceSettings::instance().color("icon_color"), size);
|
||||
return renderTintedSvgPixmap(icon_path, ifcviewerfull::ViewerSettings::instance().color("icon_color"), size);
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::components::icons
|
||||
} // namespace ifcviewerfull::components::icons
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <QString>
|
||||
#include <QSize>
|
||||
|
||||
namespace ifcinterface::components::icons {
|
||||
namespace ifcviewerfull::components::icons {
|
||||
|
||||
QPixmap renderTintedSvgPixmap(const QString& icon_path, const QString& color, const QSize& size);
|
||||
QIcon makeTintedSvgIcon(const QString& icon_path,
|
||||
@@ -37,6 +37,6 @@ QIcon makeAccentSvgIcon(const QString& icon_path);
|
||||
QIcon makeSvgIcon(const QString& icon_path);
|
||||
QPixmap makeSvgPixmap(const QString& icon_path, const QSize& size);
|
||||
|
||||
} // namespace ifcinterface::components::icons
|
||||
} // namespace ifcviewerfull::components::icons
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "Tabs.h"
|
||||
|
||||
namespace ifcinterface::components {
|
||||
namespace ifcviewerfull::components {
|
||||
|
||||
TabBar::TabBar(QWidget* parent)
|
||||
: QTabBar(parent)
|
||||
@@ -37,4 +37,4 @@ TabWidget::TabWidget(QWidget* parent)
|
||||
setTabBar(new TabBar(this));
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::components
|
||||
} // namespace ifcviewerfull::components
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <QTabBar>
|
||||
#include <QTabWidget>
|
||||
|
||||
namespace ifcinterface::components {
|
||||
namespace ifcviewerfull::components {
|
||||
|
||||
class TabBar : public QTabBar {
|
||||
Q_OBJECT
|
||||
@@ -40,6 +40,6 @@ public:
|
||||
explicit TabWidget(QWidget* parent = nullptr);
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::components
|
||||
} // namespace ifcviewerfull::components
|
||||
|
||||
#endif
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
********************************************************************************/
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "InterfaceSettings.h"
|
||||
#include "ViewerSettings.h"
|
||||
#include "components/Style.h"
|
||||
|
||||
#include <QApplication>
|
||||
@@ -67,15 +67,15 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
installUiFont();
|
||||
const auto applyStyle = [&app]() {
|
||||
app.setStyleSheet(ifcinterface::components::style::buildAppStyleSheet());
|
||||
app.setStyleSheet(ifcviewerfull::components::style::buildAppStyleSheet());
|
||||
};
|
||||
applyStyle();
|
||||
QObject::connect(&ifcinterface::InterfaceSettings::instance(),
|
||||
&ifcinterface::InterfaceSettings::themeChanged,
|
||||
QObject::connect(&ifcviewerfull::ViewerSettings::instance(),
|
||||
&ifcviewerfull::ViewerSettings::themeChanged,
|
||||
&app,
|
||||
applyStyle);
|
||||
|
||||
ifcinterface::shell::MainWindow window;
|
||||
ifcviewerfull::shell::MainWindow window;
|
||||
window.show();
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <QToolButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace ifcinterface::modules::models {
|
||||
namespace ifcviewerfull::modules::models {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -136,4 +136,4 @@ void AddModelDialog::setupUi() {
|
||||
addBodyWidget(choices_section);
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::models
|
||||
} // namespace ifcviewerfull::modules::models
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "../../components/Dialog.h"
|
||||
|
||||
namespace ifcinterface::modules::models {
|
||||
namespace ifcviewerfull::modules::models {
|
||||
|
||||
enum class SourceMode {
|
||||
None,
|
||||
@@ -45,6 +45,6 @@ private:
|
||||
SourceMode selected_mode_ = SourceMode::None;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::models
|
||||
} // namespace ifcviewerfull::modules::models
|
||||
|
||||
#endif
|
||||
|
||||
@@ -41,11 +41,11 @@
|
||||
|
||||
#include <Eigen/Dense>
|
||||
|
||||
namespace ifcinterface::modules::models {
|
||||
namespace ifcviewerfull::modules::models {
|
||||
|
||||
ModelsPanelController::ModelsPanelController(QWidget* host,
|
||||
ModelsPanel* widget,
|
||||
ifcinterface::SessionState* session_state,
|
||||
ifcviewerfull::SessionState* session_state,
|
||||
ViewportWindow* viewport,
|
||||
QObject* parent)
|
||||
: QObject(parent)
|
||||
@@ -315,4 +315,4 @@ void ModelsPanelController::writeSidecarForModel(SceneLoader* loader, uint32_t m
|
||||
qDebug(" Sidecar write: %lld ms (%s)", sidecar_timer.elapsed(), ok ? "ok" : "FAILED");
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::models
|
||||
} // namespace ifcviewerfull::modules::models
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
#include <QStringList>
|
||||
|
||||
class QWidget;
|
||||
namespace ifcinterface { class SessionState; }
|
||||
namespace ifcviewerfull { class SessionState; }
|
||||
class ViewportWindow;
|
||||
class SceneLoader;
|
||||
|
||||
namespace ifcinterface::modules::models {
|
||||
namespace ifcviewerfull::modules::models {
|
||||
|
||||
class ModelsPanel;
|
||||
|
||||
@@ -41,7 +41,7 @@ class ModelsPanelController : public QObject {
|
||||
public:
|
||||
explicit ModelsPanelController(QWidget* host,
|
||||
ModelsPanel* widget,
|
||||
ifcinterface::SessionState* session_state,
|
||||
ifcviewerfull::SessionState* session_state,
|
||||
ViewportWindow* viewport,
|
||||
QObject* parent = nullptr);
|
||||
|
||||
@@ -58,10 +58,10 @@ private:
|
||||
|
||||
QWidget* host_ = nullptr;
|
||||
ModelsPanel* widget_ = nullptr;
|
||||
ifcinterface::SessionState* session_state_ = nullptr;
|
||||
ifcviewerfull::SessionState* session_state_ = nullptr;
|
||||
ViewportWindow* viewport_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::models
|
||||
} // namespace ifcviewerfull::modules::models
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "Panel.h"
|
||||
|
||||
#include "../../InterfaceSettings.h"
|
||||
#include "../../ViewerSettings.h"
|
||||
#include "../../components/Section.h"
|
||||
#include "../../components/SvgIcon.h"
|
||||
|
||||
@@ -41,11 +41,11 @@
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace ifcinterface::modules::models {
|
||||
namespace ifcviewerfull::modules::models {
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr auto kDragMimeType = "application/x-ifcinterface-model-items";
|
||||
constexpr auto kDragMimeType = "application/x-ifcviewerfull-model-items";
|
||||
|
||||
class ModelsTreeWidget : public QTreeWidget {
|
||||
public:
|
||||
@@ -434,7 +434,7 @@ void ModelsPanel::addNode(QTreeWidgetItem* parent, const TreeNode& node) {
|
||||
|
||||
if (!node.visible) {
|
||||
const QBrush disabled_brush(
|
||||
QColor(ifcinterface::InterfaceSettings::instance().color("disabled_text")));
|
||||
QColor(ifcviewerfull::ViewerSettings::instance().color("disabled_text")));
|
||||
item->setForeground(0, disabled_brush);
|
||||
item->setForeground(1, disabled_brush);
|
||||
}
|
||||
@@ -444,4 +444,4 @@ void ModelsPanel::addNode(QTreeWidgetItem* parent, const TreeNode& node) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::models
|
||||
} // namespace ifcviewerfull::modules::models
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
class QTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
|
||||
namespace ifcinterface::modules::models {
|
||||
namespace ifcviewerfull::modules::models {
|
||||
|
||||
class ModelsPanel : public components::Panel {
|
||||
Q_OBJECT
|
||||
@@ -52,6 +52,6 @@ private:
|
||||
QTreeWidget* tree_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::models
|
||||
} // namespace ifcviewerfull::modules::models
|
||||
|
||||
#endif
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include <QTableWidgetItem>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace ifcinterface::modules::models {
|
||||
namespace ifcviewerfull::modules::models {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -124,7 +124,7 @@ QLabel* makeReadOnlyValue(QWidget* parent) {
|
||||
|
||||
} // namespace
|
||||
|
||||
SettingsDialog::SettingsDialog(ifcinterface::SessionState* session_state, QWidget* parent)
|
||||
SettingsDialog::SettingsDialog(ifcviewerfull::SessionState* session_state, QWidget* parent)
|
||||
: components::TabbedDialog(parent)
|
||||
, session_state_(session_state)
|
||||
, federation_(session_state ? session_state->federation() : nullptr)
|
||||
@@ -479,4 +479,4 @@ void SettingsDialog::onAccepted() {
|
||||
accept();
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::models
|
||||
} // namespace ifcviewerfull::modules::models
|
||||
|
||||
@@ -36,18 +36,18 @@ class QShowEvent;
|
||||
class QTableWidget;
|
||||
class QTableWidgetItem;
|
||||
|
||||
namespace ifcinterface {
|
||||
namespace ifcviewerfull {
|
||||
class SessionState;
|
||||
}
|
||||
|
||||
namespace ifcinterface::modules::models {
|
||||
namespace ifcviewerfull::modules::models {
|
||||
|
||||
class SettingsView;
|
||||
|
||||
class SettingsDialog : public components::TabbedDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SettingsDialog(ifcinterface::SessionState* session_state, QWidget* parent = nullptr);
|
||||
explicit SettingsDialog(ifcviewerfull::SessionState* session_state, QWidget* parent = nullptr);
|
||||
void renderSelectedModelGeoref(const SelectedModelGeorefState& state);
|
||||
|
||||
protected:
|
||||
@@ -69,7 +69,7 @@ private:
|
||||
void updateSelectedModelGeoref();
|
||||
void onAccepted();
|
||||
|
||||
ifcinterface::SessionState* session_state_ = nullptr;
|
||||
ifcviewerfull::SessionState* session_state_ = nullptr;
|
||||
Federation* federation_ = nullptr;
|
||||
SceneLoader* loader_ = nullptr;
|
||||
|
||||
@@ -100,6 +100,6 @@ private:
|
||||
SettingsView* settings_view_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::models
|
||||
} // namespace ifcviewerfull::modules::models
|
||||
|
||||
#endif
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace ifcinterface::modules::models {
|
||||
namespace ifcviewerfull::modules::models {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -203,7 +203,7 @@ SelectedModelGeorefState stateFromCachedGeoref(const ModelGeoref& georef) {
|
||||
} // namespace
|
||||
|
||||
SettingsView::SettingsView(SettingsDialog* widget,
|
||||
ifcinterface::SessionState* session_state)
|
||||
ifcviewerfull::SessionState* session_state)
|
||||
: widget_(widget), session_state_(session_state)
|
||||
{
|
||||
}
|
||||
@@ -243,4 +243,4 @@ void SettingsView::refresh(const QString& fed_id) const {
|
||||
widget_->renderSelectedModelGeoref(stateFromCachedGeoref(*georef));
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::models
|
||||
} // namespace ifcviewerfull::modules::models
|
||||
|
||||
@@ -23,26 +23,26 @@
|
||||
|
||||
#include "Types.h"
|
||||
|
||||
namespace ifcinterface {
|
||||
namespace ifcviewerfull {
|
||||
class SessionState;
|
||||
}
|
||||
|
||||
namespace ifcinterface::modules::models {
|
||||
namespace ifcviewerfull::modules::models {
|
||||
|
||||
class SettingsDialog;
|
||||
|
||||
class SettingsView {
|
||||
public:
|
||||
explicit SettingsView(SettingsDialog* widget,
|
||||
ifcinterface::SessionState* session_state);
|
||||
ifcviewerfull::SessionState* session_state);
|
||||
|
||||
void refresh(const QString& fed_id) const;
|
||||
|
||||
private:
|
||||
SettingsDialog* widget_ = nullptr;
|
||||
ifcinterface::SessionState* session_state_ = nullptr;
|
||||
ifcviewerfull::SessionState* session_state_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::models
|
||||
} // namespace ifcviewerfull::modules::models
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
namespace ifcinterface::modules::models {
|
||||
namespace ifcviewerfull::modules::models {
|
||||
|
||||
enum class ItemKind {
|
||||
Group,
|
||||
@@ -57,6 +57,6 @@ struct SelectedModelGeorefState {
|
||||
QString factor_z;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::models
|
||||
} // namespace ifcviewerfull::modules::models
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
#include "Panel.h"
|
||||
|
||||
#include "../../InterfaceSettings.h"
|
||||
#include "../../ViewerSettings.h"
|
||||
#include "../../SessionState.h"
|
||||
#include "../../../ifcviewer/Federation.h"
|
||||
|
||||
namespace ifcinterface::modules::models {
|
||||
namespace ifcviewerfull::modules::models {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -57,22 +57,22 @@ TreeNode makeGroupNode(const Federation* federation, const Federation::Group* gr
|
||||
} // namespace
|
||||
|
||||
ModelsPanelView::ModelsPanelView(ModelsPanel* widget,
|
||||
ifcinterface::SessionState* session_state,
|
||||
ifcviewerfull::SessionState* session_state,
|
||||
QObject* parent)
|
||||
: QObject(parent), widget_(widget), session_state_(session_state)
|
||||
{
|
||||
connect(session_state_, &ifcinterface::SessionState::modelsChanged,
|
||||
connect(session_state_, &ifcviewerfull::SessionState::modelsChanged,
|
||||
this, [this]() { reload(); });
|
||||
connect(session_state_, &ifcinterface::SessionState::federationStructureChanged,
|
||||
connect(session_state_, &ifcviewerfull::SessionState::federationStructureChanged,
|
||||
this, [this]() { reload(); });
|
||||
connect(session_state_, &ifcinterface::SessionState::visibilityChanged,
|
||||
connect(session_state_, &ifcviewerfull::SessionState::visibilityChanged,
|
||||
this, [this]() { reload(); });
|
||||
connect(session_state_, &ifcinterface::SessionState::projectReset,
|
||||
connect(session_state_, &ifcviewerfull::SessionState::projectReset,
|
||||
this, [this]() { reload(); });
|
||||
connect(session_state_, &ifcinterface::SessionState::projectOpened,
|
||||
connect(session_state_, &ifcviewerfull::SessionState::projectOpened,
|
||||
this, [this](const QString&) { reload(); });
|
||||
connect(&ifcinterface::InterfaceSettings::instance(),
|
||||
&ifcinterface::InterfaceSettings::themeChanged,
|
||||
connect(&ifcviewerfull::ViewerSettings::instance(),
|
||||
&ifcviewerfull::ViewerSettings::themeChanged,
|
||||
this, [this]() { reload(); });
|
||||
|
||||
reload();
|
||||
@@ -97,4 +97,4 @@ void ModelsPanelView::reload() {
|
||||
widget_->setNodes(nodes);
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::models
|
||||
} // namespace ifcviewerfull::modules::models
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace ifcinterface { class SessionState; }
|
||||
namespace ifcviewerfull { class SessionState; }
|
||||
|
||||
namespace ifcinterface::modules::models {
|
||||
namespace ifcviewerfull::modules::models {
|
||||
|
||||
class ModelsPanel;
|
||||
|
||||
@@ -35,16 +35,16 @@ class ModelsPanelView : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ModelsPanelView(ModelsPanel* widget,
|
||||
ifcinterface::SessionState* session_state,
|
||||
ifcviewerfull::SessionState* session_state,
|
||||
QObject* parent = nullptr);
|
||||
|
||||
private:
|
||||
void reload();
|
||||
|
||||
ModelsPanel* widget_ = nullptr;
|
||||
ifcinterface::SessionState* session_state_ = nullptr;
|
||||
ifcviewerfull::SessionState* session_state_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::models
|
||||
} // namespace ifcviewerfull::modules::models
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,15 +32,15 @@
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
|
||||
namespace ifcinterface::modules::project {
|
||||
namespace ifcviewerfull::modules::project {
|
||||
|
||||
ProjectController::ProjectController(QWidget* host,
|
||||
Federation* federation,
|
||||
ifcinterface::SessionState* session_state,
|
||||
ifcinterface::ElementRegistry* element_registry,
|
||||
ifcviewerfull::SessionState* session_state,
|
||||
ifcviewerfull::ElementRegistry* element_registry,
|
||||
ViewportWindow* viewport,
|
||||
ifcinterface::modules::models::ModelsPanelController* models_controller,
|
||||
ifcinterface::modules::viewport::ViewportController* viewport_controller,
|
||||
ifcviewerfull::modules::models::ModelsPanelController* models_controller,
|
||||
ifcviewerfull::modules::viewport::ViewportController* viewport_controller,
|
||||
QObject* parent)
|
||||
: QObject(parent)
|
||||
, host_(host)
|
||||
@@ -204,4 +204,4 @@ bool ProjectController::confirmDiscardIfDirty() {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::project
|
||||
} // namespace ifcviewerfull::modules::project
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
class QWidget;
|
||||
class Federation;
|
||||
class ViewportWindow;
|
||||
namespace ifcinterface { class ElementRegistry; }
|
||||
namespace ifcinterface { class SessionState; }
|
||||
namespace ifcinterface::modules::models { class ModelsPanelController; }
|
||||
namespace ifcinterface::modules::viewport { class ViewportController; }
|
||||
namespace ifcviewerfull { class ElementRegistry; }
|
||||
namespace ifcviewerfull { class SessionState; }
|
||||
namespace ifcviewerfull::modules::models { class ModelsPanelController; }
|
||||
namespace ifcviewerfull::modules::viewport { class ViewportController; }
|
||||
|
||||
namespace ifcinterface::modules::project {
|
||||
namespace ifcviewerfull::modules::project {
|
||||
|
||||
class ProjectController : public QObject {
|
||||
Q_OBJECT
|
||||
@@ -39,11 +39,11 @@ class ProjectController : public QObject {
|
||||
public:
|
||||
explicit ProjectController(QWidget* host,
|
||||
Federation* federation,
|
||||
ifcinterface::SessionState* session_state,
|
||||
ifcinterface::ElementRegistry* element_registry,
|
||||
ifcviewerfull::SessionState* session_state,
|
||||
ifcviewerfull::ElementRegistry* element_registry,
|
||||
ViewportWindow* viewport,
|
||||
ifcinterface::modules::models::ModelsPanelController* models_controller,
|
||||
ifcinterface::modules::viewport::ViewportController* viewport_controller,
|
||||
ifcviewerfull::modules::models::ModelsPanelController* models_controller,
|
||||
ifcviewerfull::modules::viewport::ViewportController* viewport_controller,
|
||||
QObject* parent = nullptr);
|
||||
|
||||
bool newProject();
|
||||
@@ -59,13 +59,13 @@ private:
|
||||
|
||||
QWidget* host_ = nullptr;
|
||||
Federation* federation_ = nullptr;
|
||||
ifcinterface::SessionState* session_state_ = nullptr;
|
||||
ifcinterface::ElementRegistry* element_registry_ = nullptr;
|
||||
ifcviewerfull::SessionState* session_state_ = nullptr;
|
||||
ifcviewerfull::ElementRegistry* element_registry_ = nullptr;
|
||||
ViewportWindow* viewport_ = nullptr;
|
||||
ifcinterface::modules::models::ModelsPanelController* models_controller_ = nullptr;
|
||||
ifcinterface::modules::viewport::ViewportController* viewport_controller_ = nullptr;
|
||||
ifcviewerfull::modules::models::ModelsPanelController* models_controller_ = nullptr;
|
||||
ifcviewerfull::modules::viewport::ViewportController* viewport_controller_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::project
|
||||
} // namespace ifcviewerfull::modules::project
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,31 +35,31 @@
|
||||
|
||||
namespace {
|
||||
|
||||
QWidget* makePropertySetPanel(const ifcinterface::modules::properties::PropertySet& property_set, QWidget* parent = nullptr) {
|
||||
QWidget* makePropertySetPanel(const ifcviewerfull::modules::properties::PropertySet& property_set, QWidget* parent = nullptr) {
|
||||
auto* group = new QGroupBox(property_set.title, parent);
|
||||
group->setObjectName("propertySetBox");
|
||||
auto* layout = new QVBoxLayout(group);
|
||||
layout->setContentsMargins(10, 10, 10, 10);
|
||||
layout->setSpacing(0);
|
||||
|
||||
QList<ifcinterface::components::KeyValueTableRow> rows;
|
||||
QList<ifcviewerfull::components::KeyValueTableRow> rows;
|
||||
for (const auto& row : property_set.rows) {
|
||||
rows.append({row.key, row.value, "keyValueValueLabel", "", "", 0});
|
||||
}
|
||||
layout->addWidget(new ifcinterface::components::KeyValueTable(rows, group));
|
||||
layout->addWidget(new ifcviewerfull::components::KeyValueTable(rows, group));
|
||||
return group;
|
||||
}
|
||||
|
||||
QWidget* makeAttributeList(const QList<ifcinterface::modules::properties::KeyValueRow>& rows, QWidget* parent = nullptr) {
|
||||
QList<ifcinterface::components::KeyValueTableRow> table_rows;
|
||||
QWidget* makeAttributeList(const QList<ifcviewerfull::modules::properties::KeyValueRow>& rows, QWidget* parent = nullptr) {
|
||||
QList<ifcviewerfull::components::KeyValueTableRow> table_rows;
|
||||
for (const auto& row : rows) {
|
||||
table_rows.append({row.key, row.value, "keyValueValueLabel", "", "", 0});
|
||||
}
|
||||
return new ifcinterface::components::KeyValueTable(table_rows, parent);
|
||||
return new ifcviewerfull::components::KeyValueTable(table_rows, parent);
|
||||
}
|
||||
|
||||
QWidget* makeRelationshipList(const QList<ifcinterface::modules::properties::RelationshipRow>& rows, QWidget* parent = nullptr) {
|
||||
QList<ifcinterface::components::KeyValueTableRow> table_rows;
|
||||
QWidget* makeRelationshipList(const QList<ifcviewerfull::modules::properties::RelationshipRow>& rows, QWidget* parent = nullptr) {
|
||||
QList<ifcviewerfull::components::KeyValueTableRow> table_rows;
|
||||
for (const auto& row_data : rows) {
|
||||
table_rows.append({row_data.key,
|
||||
row_data.value,
|
||||
@@ -68,22 +68,22 @@ QWidget* makeRelationshipList(const QList<ifcinterface::modules::properties::Rel
|
||||
"keyValueTrailingIconLabel",
|
||||
72});
|
||||
}
|
||||
return new ifcinterface::components::KeyValueTable(table_rows, parent);
|
||||
return new ifcviewerfull::components::KeyValueTable(table_rows, parent);
|
||||
}
|
||||
|
||||
QWidget* makeFilterWrapper(QLineEdit** field_out, QWidget* parent = nullptr) {
|
||||
auto* wrapper = new QWidget(parent);
|
||||
wrapper->setObjectName("panelSectionFilterWrapper");
|
||||
auto* layout = new QVBoxLayout(wrapper);
|
||||
layout->setContentsMargins(ifcinterface::components::style::metrics::section_body_padding,
|
||||
layout->setContentsMargins(ifcviewerfull::components::style::metrics::section_body_padding,
|
||||
0,
|
||||
ifcinterface::components::style::metrics::section_body_padding,
|
||||
ifcviewerfull::components::style::metrics::section_body_padding,
|
||||
0);
|
||||
layout->setSpacing(0);
|
||||
|
||||
auto* field = new QLineEdit(wrapper);
|
||||
field->setClearButtonEnabled(true);
|
||||
field->addAction(ifcinterface::components::icons::makeSvgIcon(":/icons/filter.svg"), QLineEdit::LeadingPosition);
|
||||
field->addAction(ifcviewerfull::components::icons::makeSvgIcon(":/icons/filter.svg"), QLineEdit::LeadingPosition);
|
||||
field->setVisible(false);
|
||||
layout->addWidget(field);
|
||||
|
||||
@@ -91,7 +91,7 @@ QWidget* makeFilterWrapper(QLineEdit** field_out, QWidget* parent = nullptr) {
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
QFrame* makeEntityBox(const ifcinterface::modules::properties::EntitySummary& entity, QWidget* parent = nullptr) {
|
||||
QFrame* makeEntityBox(const ifcviewerfull::modules::properties::EntitySummary& entity, QWidget* parent = nullptr) {
|
||||
auto* entity_box = new QFrame(parent);
|
||||
entity_box->setObjectName("entityClassBox");
|
||||
auto* entity_layout = new QHBoxLayout(entity_box);
|
||||
@@ -99,7 +99,7 @@ QFrame* makeEntityBox(const ifcinterface::modules::properties::EntitySummary& en
|
||||
entity_layout->setSpacing(10);
|
||||
|
||||
auto* entity_icon = new QLabel(entity_box);
|
||||
entity_icon->setPixmap(ifcinterface::components::icons::makeSvgPixmap(":/icons/cube-dots.svg", QSize(28, 28)));
|
||||
entity_icon->setPixmap(ifcviewerfull::components::icons::makeSvgPixmap(":/icons/cube-dots.svg", QSize(28, 28)));
|
||||
entity_icon->setAlignment(Qt::AlignCenter);
|
||||
|
||||
auto* entity_text = new QWidget(entity_box);
|
||||
@@ -121,7 +121,7 @@ QFrame* makeEntityBox(const ifcinterface::modules::properties::EntitySummary& en
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace ifcinterface::modules::properties {
|
||||
namespace ifcviewerfull::modules::properties {
|
||||
|
||||
PropertiesPanel::PropertiesPanel(QWidget* parent)
|
||||
: components::Panel("Properties", nullptr, parent, false, true)
|
||||
@@ -234,4 +234,4 @@ void PropertiesPanel::render(const PropertiesPanelState& state) {
|
||||
addBodyWidget(quantities_section);
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::properties
|
||||
} // namespace ifcviewerfull::modules::properties
|
||||
|
||||
@@ -31,7 +31,7 @@ class QLabel;
|
||||
class QLineEdit;
|
||||
class QToolButton;
|
||||
|
||||
namespace ifcinterface::modules::properties {
|
||||
namespace ifcviewerfull::modules::properties {
|
||||
|
||||
class PropertiesPanel : public components::Panel {
|
||||
Q_OBJECT
|
||||
@@ -51,6 +51,6 @@ private:
|
||||
QString quantities_filter_text_;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::properties
|
||||
} // namespace ifcviewerfull::modules::properties
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <QPair>
|
||||
#include <QString>
|
||||
|
||||
namespace ifcinterface::modules::properties {
|
||||
namespace ifcviewerfull::modules::properties {
|
||||
|
||||
struct KeyValueRow {
|
||||
QString key;
|
||||
@@ -55,6 +55,6 @@ struct PropertiesPanelState {
|
||||
QList<PropertySet> quantity_sets;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::properties
|
||||
} // namespace ifcviewerfull::modules::properties
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,17 +25,17 @@
|
||||
#include "../../ElementRegistry.h"
|
||||
#include "../../SessionState.h"
|
||||
|
||||
namespace ifcinterface::modules::properties {
|
||||
namespace ifcviewerfull::modules::properties {
|
||||
|
||||
PropertiesPanelView::PropertiesPanelView(PropertiesPanel* widget,
|
||||
ifcinterface::SessionState* session_state,
|
||||
ifcviewerfull::SessionState* session_state,
|
||||
QObject* parent)
|
||||
: QObject(parent), widget_(widget), session_state_(session_state)
|
||||
{
|
||||
connect(session_state_, &ifcinterface::SessionState::selectionChanged, this, [this](uint32_t object_id) {
|
||||
connect(session_state_, &ifcviewerfull::SessionState::selectionChanged, this, [this](uint32_t object_id) {
|
||||
refresh(object_id);
|
||||
});
|
||||
connect(session_state_, &ifcinterface::SessionState::projectReset, this, [this]() {
|
||||
connect(session_state_, &ifcviewerfull::SessionState::projectReset, this, [this]() {
|
||||
refresh(0);
|
||||
});
|
||||
refresh(0);
|
||||
@@ -118,4 +118,4 @@ void PropertiesPanelView::refresh(uint32_t object_id) {
|
||||
widget_->render(state);
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::properties
|
||||
} // namespace ifcviewerfull::modules::properties
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace ifcinterface { class SessionState; }
|
||||
namespace ifcinterface::modules::properties {
|
||||
namespace ifcviewerfull { class SessionState; }
|
||||
namespace ifcviewerfull::modules::properties {
|
||||
|
||||
class PropertiesPanel;
|
||||
|
||||
@@ -34,16 +34,16 @@ class PropertiesPanelView : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PropertiesPanelView(PropertiesPanel* widget,
|
||||
ifcinterface::SessionState* session_state,
|
||||
ifcviewerfull::SessionState* session_state,
|
||||
QObject* parent = nullptr);
|
||||
|
||||
private:
|
||||
void refresh(uint32_t object_id);
|
||||
|
||||
PropertiesPanel* widget_ = nullptr;
|
||||
ifcinterface::SessionState* session_state_ = nullptr;
|
||||
ifcviewerfull::SessionState* session_state_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::properties
|
||||
} // namespace ifcviewerfull::modules::properties
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "Dialog.h"
|
||||
|
||||
#include "../../InterfaceSettings.h"
|
||||
#include "../../ViewerSettings.h"
|
||||
#include "../../../ifcviewer/AppSettings.h"
|
||||
#include "../../components/Dialog.h"
|
||||
#include "../../components/Section.h"
|
||||
@@ -42,7 +42,7 @@
|
||||
#include <QSpinBox>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace ifcinterface::modules::settings {
|
||||
namespace ifcviewerfull::modules::settings {
|
||||
|
||||
SettingsDialog::SettingsDialog(QWidget* parent)
|
||||
: components::TabbedDialog(parent)
|
||||
@@ -202,9 +202,9 @@ void SettingsDialog::setupUi() {
|
||||
theme_form->setVerticalSpacing(10);
|
||||
|
||||
theme_mode_combo_ = new QComboBox(theme_body);
|
||||
theme_mode_combo_->addItem("Dark", static_cast<int>(ifcinterface::InterfaceSettings::ThemeMode::Dark));
|
||||
theme_mode_combo_->addItem("Light", static_cast<int>(ifcinterface::InterfaceSettings::ThemeMode::Light));
|
||||
theme_mode_combo_->addItem("Custom", static_cast<int>(ifcinterface::InterfaceSettings::ThemeMode::Custom));
|
||||
theme_mode_combo_->addItem("Dark", static_cast<int>(ifcviewerfull::ViewerSettings::ThemeMode::Dark));
|
||||
theme_mode_combo_->addItem("Light", static_cast<int>(ifcviewerfull::ViewerSettings::ThemeMode::Light));
|
||||
theme_mode_combo_->addItem("Custom", static_cast<int>(ifcviewerfull::ViewerSettings::ThemeMode::Custom));
|
||||
theme_form->addRow("Preset", theme_mode_combo_);
|
||||
|
||||
theme_custom_body_ = new QWidget(theme_body);
|
||||
@@ -214,7 +214,7 @@ void SettingsDialog::setupUi() {
|
||||
custom_grid->setVerticalSpacing(8);
|
||||
|
||||
int row = 0;
|
||||
for (const auto& spec : ifcinterface::InterfaceSettings::themeColorSpecs()) {
|
||||
for (const auto& spec : ifcviewerfull::ViewerSettings::themeColorSpecs()) {
|
||||
auto* label = new QLabel(QString::fromUtf8(spec.label), theme_custom_body_);
|
||||
auto* edit = new QLineEdit(theme_custom_body_);
|
||||
edit->setPlaceholderText("#000000");
|
||||
@@ -302,7 +302,7 @@ void SettingsDialog::syncFromSettings() {
|
||||
}
|
||||
|
||||
void SettingsDialog::syncThemeSettings() {
|
||||
const auto& settings = ifcinterface::InterfaceSettings::instance();
|
||||
const auto& settings = ifcviewerfull::ViewerSettings::instance();
|
||||
const int idx = theme_mode_combo_->findData(static_cast<int>(settings.themeMode()));
|
||||
theme_mode_combo_->setCurrentIndex(idx >= 0 ? idx : 0);
|
||||
for (auto& editor : theme_color_editors_) {
|
||||
@@ -314,8 +314,8 @@ void SettingsDialog::syncThemeSettings() {
|
||||
void SettingsDialog::updateThemeEditorEnabled() {
|
||||
if (!theme_mode_combo_ || !theme_custom_body_) return;
|
||||
const auto mode =
|
||||
static_cast<ifcinterface::InterfaceSettings::ThemeMode>(theme_mode_combo_->currentData().toInt());
|
||||
const bool is_custom = mode == ifcinterface::InterfaceSettings::ThemeMode::Custom;
|
||||
static_cast<ifcviewerfull::ViewerSettings::ThemeMode>(theme_mode_combo_->currentData().toInt());
|
||||
const bool is_custom = mode == ifcviewerfull::ViewerSettings::ThemeMode::Custom;
|
||||
theme_custom_body_->setVisible(is_custom);
|
||||
theme_custom_body_->setEnabled(is_custom);
|
||||
}
|
||||
@@ -345,13 +345,13 @@ void SettingsDialog::onAccepted() {
|
||||
AppSettings::instance().setHizResolution(hiz_resolution_spin_->value());
|
||||
AppSettings::instance().setNavPreset(
|
||||
static_cast<AppSettings::NavPreset>(nav_preset_combo_->currentIndex()));
|
||||
auto& interface_settings = ifcinterface::InterfaceSettings::instance();
|
||||
auto& interface_settings = ifcviewerfull::ViewerSettings::instance();
|
||||
interface_settings.setThemeMode(
|
||||
static_cast<ifcinterface::InterfaceSettings::ThemeMode>(theme_mode_combo_->currentData().toInt()));
|
||||
static_cast<ifcviewerfull::ViewerSettings::ThemeMode>(theme_mode_combo_->currentData().toInt()));
|
||||
for (const auto& editor : theme_color_editors_) {
|
||||
interface_settings.setCustomColor(editor.key, editor.edit->text());
|
||||
}
|
||||
accept();
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::settings
|
||||
} // namespace ifcviewerfull::modules::settings
|
||||
|
||||
@@ -34,7 +34,7 @@ class QShowEvent;
|
||||
class QSpinBox;
|
||||
class QWidget;
|
||||
|
||||
namespace ifcinterface::modules::settings {
|
||||
namespace ifcviewerfull::modules::settings {
|
||||
|
||||
class SettingsDialog : public components::TabbedDialog {
|
||||
Q_OBJECT
|
||||
@@ -74,6 +74,6 @@ private:
|
||||
std::vector<ThemeColorEditor> theme_color_editors_;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::settings
|
||||
} // namespace ifcviewerfull::modules::settings
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <QTreeWidget>
|
||||
#include <QTreeWidgetItem>
|
||||
|
||||
namespace ifcinterface::modules::spatial_hierarchy {
|
||||
namespace ifcviewerfull::modules::spatial_hierarchy {
|
||||
|
||||
SpatialHierarchyPanel::SpatialHierarchyPanel(QWidget* parent)
|
||||
: components::Panel("Spatial Hierarchy", nullptr, parent)
|
||||
@@ -92,4 +92,4 @@ QString SpatialHierarchyPanel::iconPath(ItemKind kind) const {
|
||||
return ":/icons/frame-alt.svg";
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::spatial_hierarchy
|
||||
} // namespace ifcviewerfull::modules::spatial_hierarchy
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
class QTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
|
||||
namespace ifcinterface::modules::spatial_hierarchy {
|
||||
namespace ifcviewerfull::modules::spatial_hierarchy {
|
||||
|
||||
class SpatialHierarchyPanel : public components::Panel {
|
||||
Q_OBJECT
|
||||
@@ -48,6 +48,6 @@ private:
|
||||
QTreeWidget* tree_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::spatial_hierarchy
|
||||
} // namespace ifcviewerfull::modules::spatial_hierarchy
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
namespace ifcinterface::modules::spatial_hierarchy {
|
||||
namespace ifcviewerfull::modules::spatial_hierarchy {
|
||||
|
||||
enum class ItemKind {
|
||||
Site,
|
||||
@@ -43,6 +43,6 @@ struct TreeNode {
|
||||
|
||||
using NodePath = QStringList;
|
||||
|
||||
} // namespace ifcinterface::modules::spatial_hierarchy
|
||||
} // namespace ifcviewerfull::modules::spatial_hierarchy
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "../../SessionState.h"
|
||||
|
||||
namespace ifcinterface::modules::spatial_hierarchy {
|
||||
namespace ifcviewerfull::modules::spatial_hierarchy {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -40,7 +40,7 @@ TreeNode* findNodeRecursive(QList<TreeNode>& nodes, const NodePath& path, int de
|
||||
} // namespace
|
||||
|
||||
SpatialHierarchyPanelView::SpatialHierarchyPanelView(SpatialHierarchyPanel* widget,
|
||||
ifcinterface::SessionState* session_state,
|
||||
ifcviewerfull::SessionState* session_state,
|
||||
QObject* parent)
|
||||
: QObject(parent), widget_(widget), session_state_(session_state)
|
||||
{
|
||||
@@ -72,4 +72,4 @@ TreeNode* SpatialHierarchyPanelView::findNode(const NodePath& path) {
|
||||
return findNodeRecursive(nodes_, path, 0);
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::spatial_hierarchy
|
||||
} // namespace ifcviewerfull::modules::spatial_hierarchy
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace ifcinterface { class SessionState; }
|
||||
namespace ifcinterface::modules::spatial_hierarchy {
|
||||
namespace ifcviewerfull { class SessionState; }
|
||||
namespace ifcviewerfull::modules::spatial_hierarchy {
|
||||
|
||||
class SpatialHierarchyPanel;
|
||||
|
||||
@@ -34,7 +34,7 @@ class SpatialHierarchyPanelView : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SpatialHierarchyPanelView(SpatialHierarchyPanel* widget,
|
||||
ifcinterface::SessionState* session_state,
|
||||
ifcviewerfull::SessionState* session_state,
|
||||
QObject* parent = nullptr);
|
||||
|
||||
private:
|
||||
@@ -42,10 +42,10 @@ private:
|
||||
TreeNode* findNode(const NodePath& path);
|
||||
|
||||
SpatialHierarchyPanel* widget_ = nullptr;
|
||||
ifcinterface::SessionState* session_state_ = nullptr;
|
||||
ifcviewerfull::SessionState* session_state_ = nullptr;
|
||||
QList<TreeNode> nodes_;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::spatial_hierarchy
|
||||
} // namespace ifcviewerfull::modules::spatial_hierarchy
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace ifcinterface::modules::todo {
|
||||
namespace ifcviewerfull::modules::todo {
|
||||
|
||||
TodoPanel::TodoPanel(const QString& title, QWidget* parent)
|
||||
: QWidget(parent)
|
||||
@@ -56,4 +56,4 @@ TodoPanel::TodoPanel(const QString& title, QWidget* parent)
|
||||
layout->addWidget(section);
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::todo
|
||||
} // namespace ifcviewerfull::modules::todo
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace ifcinterface::modules::todo {
|
||||
namespace ifcviewerfull::modules::todo {
|
||||
|
||||
class TodoPanel : public QWidget {
|
||||
Q_OBJECT
|
||||
@@ -31,6 +31,6 @@ public:
|
||||
explicit TodoPanel(const QString& title, QWidget* parent = nullptr);
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::todo
|
||||
} // namespace ifcviewerfull::modules::todo
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "Controller.h"
|
||||
|
||||
#include "../../InterfaceSettings.h"
|
||||
#include "../../ViewerSettings.h"
|
||||
#include "../../SessionState.h"
|
||||
#include "../../../ifcviewer/AppSettings.h"
|
||||
#include "../../../ifcviewer/Federation.h"
|
||||
@@ -34,9 +34,9 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace ifcinterface::modules::viewport {
|
||||
namespace ifcviewerfull::modules::viewport {
|
||||
|
||||
ViewportController::ViewportController(ifcinterface::SessionState* session_state,
|
||||
ViewportController::ViewportController(ifcviewerfull::SessionState* session_state,
|
||||
ViewportWindow* viewport,
|
||||
QObject* parent)
|
||||
: QObject(parent)
|
||||
@@ -47,12 +47,12 @@ ViewportController::ViewportController(ifcinterface::SessionState* session_state
|
||||
{
|
||||
Federation* federation = session_state_->federation();
|
||||
SceneLoader* loader = session_state_->loader();
|
||||
connect(&ifcinterface::InterfaceSettings::instance(),
|
||||
&ifcinterface::InterfaceSettings::themeChanged,
|
||||
connect(&ifcviewerfull::ViewerSettings::instance(),
|
||||
&ifcviewerfull::ViewerSettings::themeChanged,
|
||||
this, [this]() {
|
||||
viewport_->setBackgroundColor(QColor(ifcinterface::InterfaceSettings::instance().color("viewport_background")));
|
||||
viewport_->setBackgroundColor(QColor(ifcviewerfull::ViewerSettings::instance().color("viewport_background")));
|
||||
});
|
||||
viewport_->setBackgroundColor(QColor(ifcinterface::InterfaceSettings::instance().color("viewport_background")));
|
||||
viewport_->setBackgroundColor(QColor(ifcviewerfull::ViewerSettings::instance().color("viewport_background")));
|
||||
connect(federation, &Federation::federatedFalseOriginChanged,
|
||||
this, &ViewportController::applyFederatedFalseOrigin);
|
||||
connect(federation, &Federation::configChanged, this, [this]() {
|
||||
@@ -334,4 +334,4 @@ void ViewportController::maybeGuessFederatedFalseOrigin(uint32_t mid) {
|
||||
*placement, *georef, federation->config()));
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::viewport
|
||||
} // namespace ifcviewerfull::modules::viewport
|
||||
|
||||
@@ -24,18 +24,18 @@
|
||||
#include <QObject>
|
||||
#include <memory>
|
||||
|
||||
namespace ifcinterface { class SessionState; }
|
||||
namespace ifcviewerfull { class SessionState; }
|
||||
class ViewportWindow;
|
||||
class AreaMeasurement;
|
||||
class LengthMeasurement;
|
||||
|
||||
namespace ifcinterface::modules::viewport {
|
||||
namespace ifcviewerfull::modules::viewport {
|
||||
|
||||
class ViewportController : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ViewportController(ifcinterface::SessionState* session_state,
|
||||
explicit ViewportController(ifcviewerfull::SessionState* session_state,
|
||||
ViewportWindow* viewport,
|
||||
QObject* parent = nullptr);
|
||||
~ViewportController() override;
|
||||
@@ -62,12 +62,12 @@ private:
|
||||
void maybeGuessFederatedFalseOrigin(uint32_t mid);
|
||||
void updateVolumeReadout();
|
||||
|
||||
ifcinterface::SessionState* session_state_ = nullptr;
|
||||
ifcviewerfull::SessionState* session_state_ = nullptr;
|
||||
ViewportWindow* viewport_ = nullptr;
|
||||
std::unique_ptr<AreaMeasurement> area_measurement_;
|
||||
std::unique_ptr<LengthMeasurement> length_measurement_;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::viewport
|
||||
} // namespace ifcviewerfull::modules::viewport
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
namespace ifcinterface::modules::viewport {
|
||||
namespace ifcviewerfull::modules::viewport {
|
||||
|
||||
ViewportPanel::ViewportPanel(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
@@ -57,4 +57,4 @@ ViewportPanel::ViewportPanel(QWidget* parent)
|
||||
root->addWidget(shell);
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::modules::viewport
|
||||
} // namespace ifcviewerfull::modules::viewport
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
class ViewportWindow;
|
||||
|
||||
namespace ifcinterface::modules::viewport {
|
||||
namespace ifcviewerfull::modules::viewport {
|
||||
|
||||
class ViewportPanel : public QWidget {
|
||||
Q_OBJECT
|
||||
@@ -40,6 +40,6 @@ private:
|
||||
QWidget* viewport_container_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ifcinterface::modules::viewport
|
||||
} // namespace ifcviewerfull::modules::viewport
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user