mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 02:49:12 +00:00
Interface mockup 12
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
|
||||
#include "Widget.h"
|
||||
|
||||
#include "../../SessionState.h"
|
||||
|
||||
namespace ifcinterface::panels::spatial_hierarchy {
|
||||
|
||||
namespace {
|
||||
@@ -37,8 +39,10 @@ TreeNode* findNodeRecursive(QList<TreeNode>& nodes, const NodePath& path, int de
|
||||
|
||||
} // namespace
|
||||
|
||||
SpatialHierarchyPanelView::SpatialHierarchyPanelView(SpatialHierarchyPanelWidget* widget, QObject* parent)
|
||||
: QObject(parent), widget_(widget)
|
||||
SpatialHierarchyPanelView::SpatialHierarchyPanelView(SpatialHierarchyPanelWidget* widget,
|
||||
ifcinterface::SessionState* session_state,
|
||||
QObject* parent)
|
||||
: QObject(parent), widget_(widget), session_state_(session_state)
|
||||
{
|
||||
nodes_ = {
|
||||
{"Site A", ItemKind::Site, true,
|
||||
@@ -52,7 +56,7 @@ SpatialHierarchyPanelView::SpatialHierarchyPanelView(SpatialHierarchyPanelWidget
|
||||
if (auto* node = findNode(path)) {
|
||||
node->visible = !node->visible;
|
||||
reload();
|
||||
emit statusMessageRequested("Spatial", node->visible ? "Item shown" : "Item hidden");
|
||||
session_state_->setStatusMessage("Spatial", node->visible ? "Item shown" : "Item hidden");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace ifcinterface { class SessionState; }
|
||||
namespace ifcinterface::panels::spatial_hierarchy {
|
||||
|
||||
class SpatialHierarchyPanelWidget;
|
||||
@@ -32,16 +33,16 @@ class SpatialHierarchyPanelWidget;
|
||||
class SpatialHierarchyPanelView : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SpatialHierarchyPanelView(SpatialHierarchyPanelWidget* widget, QObject* parent = nullptr);
|
||||
|
||||
signals:
|
||||
void statusMessageRequested(const QString& mode, const QString& detail);
|
||||
explicit SpatialHierarchyPanelView(SpatialHierarchyPanelWidget* widget,
|
||||
ifcinterface::SessionState* session_state,
|
||||
QObject* parent = nullptr);
|
||||
|
||||
private:
|
||||
void reload();
|
||||
TreeNode* findNode(const NodePath& path);
|
||||
|
||||
SpatialHierarchyPanelWidget* widget_ = nullptr;
|
||||
ifcinterface::SessionState* session_state_ = nullptr;
|
||||
QList<TreeNode> nodes_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user