Files
IfcOpenShell/src/bonsaiviewer/modules/models/View.h
T

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

64 lines
3.0 KiB
C++
Raw Normal View History

2026-05-09 22:00:19 +10:00
// This file was generated with the assistance of an AI coding tool.
/********************************************************************************
* *
2026-07-03 09:39:27 +10:00
* This file is part of Bonsai. *
2026-05-09 22:00:19 +10:00
* *
2026-07-03 09:39:27 +10:00
* Bonsai is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
2026-05-09 22:00:19 +10:00
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
2026-07-03 09:39:27 +10:00
* Bonsai is distributed in the hope that it will be useful, *
2026-05-09 22:00:19 +10:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
2026-07-03 09:39:27 +10:00
* GNU General Public License for more details. *
2026-05-09 22:00:19 +10:00
* *
2026-07-03 09:39:27 +10:00
* You should have received a copy of the GNU General Public License *
2026-05-09 22:00:19 +10:00
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
#ifndef IFCINTERFACE_PANELS_MODELSPANELVIEW_H
#define IFCINTERFACE_PANELS_MODELSPANELVIEW_H
#include "Types.h"
#include <QObject>
2026-05-16 17:04:23 +10:00
class Federation;
2026-05-20 09:38:10 +10:00
namespace bonsaiviewer { class SessionState; }
2026-05-09 22:00:19 +10:00
2026-05-20 09:38:10 +10:00
namespace bonsaiviewer::modules::models {
2026-05-09 22:00:19 +10:00
2026-05-16 17:04:23 +10:00
class FederationItemModel;
2026-05-09 22:00:19 +10:00
class ModelsPanel;
2026-05-16 17:04:23 +10:00
// Pure derivation used by ModelsPanel when building its "move to..." menus.
// Walks the federation's group tree and returns every group except those in
// the subtree rooted at exclude_subtree_root (skip a group's own subtree to
// prevent a cyclic move). Pass an empty exclude_subtree_root to get every
// group back.
QList<GroupOption> validMoveTargets(const Federation& federation,
const QString& exclude_subtree_root);
// Owns the FederationItemModel, hands it to the panel, and listens to the
// coarse session signals (project open/reset, theme change) — those are the
// "rebuild from scratch" cases the model itself doesn't subscribe to.
// Granular Federation events are handled inside the model.
2026-05-09 22:00:19 +10:00
class ModelsPanelView : public QObject {
Q_OBJECT
public:
explicit ModelsPanelView(ModelsPanel* widget,
2026-05-20 09:38:10 +10:00
bonsaiviewer::SessionState* session_state,
2026-05-09 22:00:19 +10:00
QObject* parent = nullptr);
private:
ModelsPanel* widget_ = nullptr;
2026-05-20 09:38:10 +10:00
bonsaiviewer::SessionState* session_state_ = nullptr;
2026-05-16 17:04:23 +10:00
FederationItemModel* model_ = nullptr;
2026-05-09 22:00:19 +10:00
};
2026-05-20 09:38:10 +10:00
} // namespace bonsaiviewer::modules::models
2026-05-09 22:00:19 +10:00
#endif