Files
IfcOpenShell/src/interface/MainWindow.h
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

123 lines
5.5 KiB
C++
Raw Normal View History

2026-05-05 07:29:32 +10:00
// This file was generated with the assistance of an AI coding tool.
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
2026-05-05 18:02:02 +10:00
#ifndef IFCINTERFACE_SHELL_MAINWINDOW_H
#define IFCINTERFACE_SHELL_MAINWINDOW_H
2026-05-05 07:29:32 +10:00
2026-05-07 12:21:55 +10:00
#include <QHash>
2026-05-05 07:29:32 +10:00
#include <QMainWindow>
#include <QStringList>
class QLabel;
class QDockWidget;
class QStackedWidget;
class QToolButton;
2026-05-07 12:21:55 +10:00
class Federation;
2026-05-05 07:29:32 +10:00
class SceneLoader;
2026-05-06 10:47:03 +10:00
namespace ifcinterface { class ElementRegistry; }
2026-05-07 12:21:55 +10:00
namespace ifcinterface::components { class TabBar; }
2026-05-07 14:12:27 +10:00
namespace ifcinterface::panels::models { class ModelsPanelWidget; }
2026-05-05 09:40:58 +10:00
namespace ifcinterface::panels::models { class ModelsPanelView; }
2026-05-07 14:12:27 +10:00
namespace ifcinterface::panels::spatial_hierarchy { class SpatialHierarchyPanelWidget; }
2026-05-05 09:40:58 +10:00
namespace ifcinterface::panels::spatial_hierarchy { class SpatialHierarchyPanelView; }
2026-05-07 14:12:27 +10:00
namespace ifcinterface::panels::properties { class PropertiesPanelWidget; }
2026-05-05 09:40:58 +10:00
namespace ifcinterface::panels::properties { class PropertiesPanelView; }
2026-05-07 14:45:23 +10:00
namespace ifcinterface::panels::viewport { class ViewportController; }
namespace ifcinterface::panels::viewport { class ViewportWidget; }
2026-05-05 07:29:32 +10:00
2026-05-05 18:02:02 +10:00
namespace ifcinterface::shell {
class MainWindow : public QMainWindow {
2026-05-05 07:29:32 +10:00
Q_OBJECT
public:
2026-05-05 18:02:02 +10:00
explicit MainWindow(QWidget* parent = nullptr);
2026-05-05 07:29:32 +10:00
private:
void setupChrome();
void setupRibbon();
void setupViewport();
2026-05-06 10:47:03 +10:00
void setupPanels();
2026-05-05 07:29:32 +10:00
void setupStatus();
void setupLoader();
QWidget* buildHomeRibbonPage();
QWidget* buildNavigateRibbonPage();
QWidget* buildInspectRibbonPage();
QWidget* buildPanelsRibbonPage();
2026-05-07 12:21:55 +10:00
void clearScene();
bool confirmDiscardIfDirty();
void loadModelsFromPaths(const QStringList& paths, const QStringList& fed_ids);
bool openProject(const QString& path);
bool saveProject();
bool saveProjectAs();
void updateWindowTitle();
2026-05-05 07:29:32 +10:00
QToolButton* makeRibbonAction(const QString& text, const QString& icon_path);
QWidget* makeRibbonGroup(const QString& title, const QList<QToolButton*>& buttons);
QToolButton* makePanelToggle(const QString& text, QDockWidget* dock);
void setStatusMessage(const QString& mode, const QString& detail);
void addFiles(const QStringList& paths);
QString formatElapsed(qint64 ms) const;
private slots:
void onAddFiles();
void onLoadStarted(uint32_t mid, QString display_name);
void onLoadedFromSidecar(uint32_t mid, qint64 elapsed_ms);
void onLoadedFromStream(uint32_t mid, qint64 elapsed_ms);
void onLoadCancelled(uint32_t mid);
void onLoadError(uint32_t mid, QString message);
void onAllLoadsFinished();
2026-05-07 14:45:23 +10:00
void onSetHomeView();
void onGoHomeView();
2026-05-07 12:21:55 +10:00
void onNewProject();
void onOpenProject();
void onSaveProject();
void onSaveProjectAs();
2026-05-05 07:29:32 +10:00
private:
2026-05-07 12:21:55 +10:00
Federation* federation_ = nullptr;
2026-05-05 07:29:32 +10:00
QLabel* status_mode_label_ = nullptr;
QLabel* status_selection_label_ = nullptr;
QLabel* status_perf_label_ = nullptr;
2026-05-07 12:21:55 +10:00
ifcinterface::components::TabBar* ribbon_tabs_ = nullptr;
2026-05-05 07:29:32 +10:00
QStackedWidget* ribbon_pages_ = nullptr;
2026-05-07 14:45:23 +10:00
ifcinterface::panels::viewport::ViewportWidget* viewport_widget_ = nullptr;
ifcinterface::panels::viewport::ViewportController* viewport_controller_ = nullptr;
2026-05-05 07:29:32 +10:00
SceneLoader* loader_ = nullptr;
2026-05-06 10:47:03 +10:00
ifcinterface::ElementRegistry* element_registry_ = nullptr;
2026-05-07 14:12:27 +10:00
ifcinterface::panels::models::ModelsPanelWidget* models_panel_ = nullptr;
ifcinterface::panels::spatial_hierarchy::SpatialHierarchyPanelWidget* spatial_panel_ = nullptr;
2026-05-06 10:47:03 +10:00
QDockWidget* layers_panel_ = nullptr;
2026-05-07 14:12:27 +10:00
ifcinterface::panels::properties::PropertiesPanelWidget* properties_panel_ = nullptr;
2026-05-06 10:47:03 +10:00
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::panels::models::ModelsPanelView* models_view_ = nullptr;
ifcinterface::panels::spatial_hierarchy::SpatialHierarchyPanelView* spatial_view_ = nullptr;
ifcinterface::panels::properties::PropertiesPanelView* properties_view_ = nullptr;
2026-05-07 12:21:55 +10:00
QHash<QString, uint32_t> fed_id_to_model_id_;
QHash<uint32_t, QString> model_id_to_fed_id_;
2026-05-05 07:29:32 +10:00
};
2026-05-05 18:02:02 +10:00
} // namespace ifcinterface::shell
2026-05-05 07:29:32 +10:00
#endif