mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 10:33:20 +00:00
Interface mockup 10
This commit is contained in:
@@ -33,12 +33,20 @@ set(INTERFACE_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/SvgIcon.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/Style.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/Style.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/Dialog.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/Dialog.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/Tabs.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/Tabs.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/KeyValueTable.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/KeyValueTable.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/Buttons.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/Buttons.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/Section.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/Section.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/Panel.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/components/Panel.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/panels/add_model/Dialog.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/panels/add_model/Dialog.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/panels/models/Types.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/panels/models/Widget.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/panels/models/Widget.h
|
||||
|
||||
@@ -348,23 +348,20 @@ void MainWindow::setupViewport() {
|
||||
}
|
||||
|
||||
void MainWindow::setupPanels() {
|
||||
auto* models_widget = new panels::models::ModelsPanelWidget(this);
|
||||
auto* spatial_widget = new panels::spatial_hierarchy::SpatialHierarchyPanelWidget(this);
|
||||
auto* properties_widget = new panels::properties::PropertiesPanelWidget(this);
|
||||
models_panel_ = new panels::models::ModelsPanelWidget(this);
|
||||
spatial_panel_ = new panels::spatial_hierarchy::SpatialHierarchyPanelWidget(this);
|
||||
properties_panel_ = new panels::properties::PropertiesPanelWidget(this);
|
||||
|
||||
models_view_ = new panels::models::ModelsPanelView(models_widget, this);
|
||||
spatial_view_ = new panels::spatial_hierarchy::SpatialHierarchyPanelView(spatial_widget, this);
|
||||
models_view_ = new panels::models::ModelsPanelView(models_panel_, this);
|
||||
spatial_view_ = new panels::spatial_hierarchy::SpatialHierarchyPanelView(spatial_panel_, this);
|
||||
properties_view_ = new panels::properties::PropertiesPanelView(
|
||||
properties_widget, viewport_, element_registry_, this);
|
||||
properties_panel_, viewport_, element_registry_, this);
|
||||
|
||||
connect(models_view_, &panels::models::ModelsPanelView::statusMessageRequested,
|
||||
this, &MainWindow::setStatusMessage);
|
||||
connect(spatial_view_, &panels::spatial_hierarchy::SpatialHierarchyPanelView::statusMessageRequested,
|
||||
this, &MainWindow::setStatusMessage);
|
||||
|
||||
models_panel_ = new components::Panel("Models", models_widget, this, true);
|
||||
spatial_panel_ = new components::Panel("Spatial Hierarchy", spatial_widget, this);
|
||||
properties_panel_ = new components::Panel("Properties", properties_widget, this, false, true);
|
||||
layers_panel_ = new components::Panel("Layers", new panels::todo::TodoPanelWidget("Layers", this), this);
|
||||
stored_views_panel_ = new components::Panel(
|
||||
"Stored Views", new panels::todo::TodoPanelWidget("Stored Views", this), this);
|
||||
|
||||
@@ -34,8 +34,11 @@ class ViewportWindow;
|
||||
class SceneLoader;
|
||||
namespace ifcinterface { class ElementRegistry; }
|
||||
namespace ifcinterface::components { class TabBar; }
|
||||
namespace ifcinterface::panels::models { class ModelsPanelWidget; }
|
||||
namespace ifcinterface::panels::models { class ModelsPanelView; }
|
||||
namespace ifcinterface::panels::spatial_hierarchy { class SpatialHierarchyPanelWidget; }
|
||||
namespace ifcinterface::panels::spatial_hierarchy { class SpatialHierarchyPanelView; }
|
||||
namespace ifcinterface::panels::properties { class PropertiesPanelWidget; }
|
||||
namespace ifcinterface::panels::properties { class PropertiesPanelView; }
|
||||
|
||||
namespace ifcinterface::shell {
|
||||
@@ -94,10 +97,10 @@ private:
|
||||
SceneLoader* loader_ = nullptr;
|
||||
ifcinterface::ElementRegistry* element_registry_ = nullptr;
|
||||
QWidget* viewport_container_ = nullptr;
|
||||
QDockWidget* models_panel_ = nullptr;
|
||||
QDockWidget* spatial_panel_ = nullptr;
|
||||
ifcinterface::panels::models::ModelsPanelWidget* models_panel_ = nullptr;
|
||||
ifcinterface::panels::spatial_hierarchy::SpatialHierarchyPanelWidget* spatial_panel_ = nullptr;
|
||||
QDockWidget* layers_panel_ = nullptr;
|
||||
QDockWidget* properties_panel_ = nullptr;
|
||||
ifcinterface::panels::properties::PropertiesPanelWidget* properties_panel_ = nullptr;
|
||||
QDockWidget* stored_views_panel_ = nullptr;
|
||||
QDockWidget* search_panel_ = nullptr;
|
||||
QDockWidget* spreadsheet_panel_ = nullptr;
|
||||
|
||||
@@ -57,7 +57,7 @@ Dialog::Dialog(QWidget* parent, bool scrollable)
|
||||
scroll_body->setObjectName("panelScrollBody");
|
||||
body_layout_ = new QVBoxLayout(scroll_body);
|
||||
body_layout_->setContentsMargins(0, 0, 0, 0);
|
||||
body_layout_->setSpacing(0);
|
||||
body_layout_->setSpacing(style::metrics::section_body_padding);
|
||||
|
||||
scroll->setWidget(scroll_body);
|
||||
frame_layout->addWidget(scroll);
|
||||
@@ -65,7 +65,7 @@ Dialog::Dialog(QWidget* parent, bool scrollable)
|
||||
auto* body = new QWidget(frame);
|
||||
body_layout_ = new QVBoxLayout(body);
|
||||
body_layout_->setContentsMargins(0, 0, 0, 0);
|
||||
body_layout_->setSpacing(0);
|
||||
body_layout_->setSpacing(style::metrics::section_body_padding);
|
||||
frame_layout->addWidget(body);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ Panel::Panel(const QString& title, QWidget* content, QWidget* parent, bool has_s
|
||||
scroll_body->setObjectName("panelScrollBody");
|
||||
body_layout_ = new QVBoxLayout(scroll_body);
|
||||
body_layout_->setContentsMargins(0, 0, 0, 0);
|
||||
body_layout_->setSpacing(0);
|
||||
body_layout_->setSpacing(style::metrics::section_body_padding);
|
||||
|
||||
scroll->setWidget(scroll_body);
|
||||
frame_layout->addWidget(scroll);
|
||||
@@ -105,7 +105,7 @@ Panel::Panel(const QString& title, QWidget* content, QWidget* parent, bool has_s
|
||||
auto* body = new QWidget(frame);
|
||||
body_layout_ = new QVBoxLayout(body);
|
||||
body_layout_->setContentsMargins(0, 0, 0, 0);
|
||||
body_layout_->setSpacing(0);
|
||||
body_layout_->setSpacing(style::metrics::section_body_padding);
|
||||
frame_layout->addWidget(body);
|
||||
}
|
||||
|
||||
@@ -126,4 +126,11 @@ void Panel::addBodyWidget(QWidget* widget) {
|
||||
body_layout_->addWidget(widget);
|
||||
}
|
||||
|
||||
void Panel::clearBodyWidgets() {
|
||||
while (auto* item = body_layout_->takeAt(0)) {
|
||||
if (auto* widget = item->widget()) widget->deleteLater();
|
||||
delete item;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::components
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
bool scrollable = false);
|
||||
|
||||
void addBodyWidget(QWidget* widget);
|
||||
void clearBodyWidgets();
|
||||
|
||||
private:
|
||||
QVBoxLayout* body_layout_ = nullptr;
|
||||
|
||||
@@ -34,6 +34,12 @@ QString buildAppStyleSheet() {
|
||||
background: ${app_background};
|
||||
color: ${primary_text};
|
||||
}
|
||||
QMessageBox,
|
||||
QMessageBox QWidget,
|
||||
QMessageBox QLabel {
|
||||
background: ${app_background};
|
||||
color: ${primary_text};
|
||||
}
|
||||
QFileDialog,
|
||||
QFileDialog QWidget,
|
||||
QFileDialog QStackedWidget,
|
||||
|
||||
@@ -35,13 +35,6 @@
|
||||
|
||||
namespace {
|
||||
|
||||
void clearLayout(QVBoxLayout* layout) {
|
||||
while (auto* item = layout->takeAt(0)) {
|
||||
if (auto* widget = item->widget()) widget->deleteLater();
|
||||
delete item;
|
||||
}
|
||||
}
|
||||
|
||||
QWidget* makePropertySetPanel(const ifcinterface::panels::properties::PropertySet& property_set, QWidget* parent = nullptr) {
|
||||
auto* group = new QGroupBox(property_set.title, parent);
|
||||
group->setObjectName("propertySetBox");
|
||||
@@ -131,15 +124,12 @@ QFrame* makeEntityBox(const ifcinterface::panels::properties::EntitySummary& ent
|
||||
namespace ifcinterface::panels::properties {
|
||||
|
||||
PropertiesPanelWidget::PropertiesPanelWidget(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
: components::Panel("Properties", nullptr, parent, false, true)
|
||||
{
|
||||
content_layout_ = new QVBoxLayout(this);
|
||||
content_layout_->setContentsMargins(0, 0, 0, 0);
|
||||
content_layout_->setSpacing(12);
|
||||
}
|
||||
|
||||
void PropertiesPanelWidget::render(const PropertiesPanelState& state) {
|
||||
clearLayout(content_layout_);
|
||||
clearBodyWidgets();
|
||||
|
||||
QList<QWidget*> property_set_widgets;
|
||||
for (const auto& property_set : state.property_sets) {
|
||||
@@ -237,12 +227,11 @@ void PropertiesPanelWidget::render(const PropertiesPanelState& state) {
|
||||
});
|
||||
}
|
||||
|
||||
content_layout_->addWidget(entity_section);
|
||||
content_layout_->addWidget(attributes_section);
|
||||
content_layout_->addWidget(relationships_section);
|
||||
content_layout_->addWidget(properties_section);
|
||||
content_layout_->addWidget(quantities_section);
|
||||
content_layout_->addStretch(1);
|
||||
addBodyWidget(entity_section);
|
||||
addBodyWidget(attributes_section);
|
||||
addBodyWidget(relationships_section);
|
||||
addBodyWidget(properties_section);
|
||||
addBodyWidget(quantities_section);
|
||||
}
|
||||
|
||||
} // namespace ifcinterface::panels::properties
|
||||
|
||||
@@ -23,18 +23,17 @@
|
||||
|
||||
#include "Types.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
#include "../../components/Panel.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
class QVBoxLayout;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QToolButton;
|
||||
namespace ifcinterface::components { class Section; }
|
||||
|
||||
namespace ifcinterface::panels::properties {
|
||||
|
||||
class PropertiesPanelWidget : public QWidget {
|
||||
class PropertiesPanelWidget : public components::Panel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PropertiesPanelWidget(QWidget* parent = nullptr);
|
||||
@@ -42,7 +41,6 @@ public:
|
||||
void render(const PropertiesPanelState& state);
|
||||
|
||||
private:
|
||||
QVBoxLayout* content_layout_ = nullptr;
|
||||
bool attributes_expanded_ = true;
|
||||
bool relationships_expanded_ = true;
|
||||
bool properties_expanded_ = true;
|
||||
|
||||
@@ -26,17 +26,12 @@
|
||||
#include <QHeaderView>
|
||||
#include <QTreeWidget>
|
||||
#include <QTreeWidgetItem>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace ifcinterface::panels::spatial_hierarchy {
|
||||
|
||||
SpatialHierarchyPanelWidget::SpatialHierarchyPanelWidget(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
: components::Panel("Spatial Hierarchy", nullptr, parent)
|
||||
{
|
||||
auto* layout = new QVBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
|
||||
auto* section = new components::Section("", components::SectionHeaderMode::Hidden, this);
|
||||
|
||||
tree_ = new QTreeWidget(section);
|
||||
@@ -51,7 +46,7 @@ SpatialHierarchyPanelWidget::SpatialHierarchyPanelWidget(QWidget* parent)
|
||||
tree_->header()->resizeSection(1, 28);
|
||||
tree_->header()->hide();
|
||||
section->addBodyWidget(tree_);
|
||||
layout->addWidget(section);
|
||||
addBodyWidget(section);
|
||||
|
||||
connect(tree_, &QTreeWidget::itemClicked, this, [this](QTreeWidgetItem* item, int column) {
|
||||
if (!item || column != 1) return;
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
|
||||
#include "Types.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include "../../components/Panel.h"
|
||||
|
||||
class QTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
|
||||
namespace ifcinterface::panels::spatial_hierarchy {
|
||||
|
||||
class SpatialHierarchyPanelWidget : public QWidget {
|
||||
class SpatialHierarchyPanelWidget : public components::Panel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SpatialHierarchyPanelWidget(QWidget* parent = nullptr);
|
||||
|
||||
Reference in New Issue
Block a user