54 lines
1.5 KiB
C
54 lines
1.5 KiB
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <QTreeWidget>
|
||
|
|
#include <QTreeWidgetItem>
|
||
|
|
|
||
|
|
#include "entities/Entity.h"
|
||
|
|
#include "workspace/WorkSpace.h"
|
||
|
|
#include "workspace/WorkSpaceItem.h"
|
||
|
|
|
||
|
|
class ModelTreeWidget : public QTreeWidget {
|
||
|
|
Q_OBJECT
|
||
|
|
|
||
|
|
public:
|
||
|
|
ModelTreeWidget(QWidget* parent = 0);
|
||
|
|
~ModelTreeWidget() override;
|
||
|
|
|
||
|
|
public:
|
||
|
|
void OnWorkspaceChange(WorkSpace* workSpace);
|
||
|
|
void OnEntityAdded(class Entity* entity);
|
||
|
|
void OnEntityRemoved(class Entity* entity);
|
||
|
|
|
||
|
|
Q_SIGNALS:
|
||
|
|
void WorkSpaceChange(const QVariant& workSpace);
|
||
|
|
void EntityChange(const QVariant& entity);
|
||
|
|
|
||
|
|
protected:
|
||
|
|
void contextMenuEvent(QContextMenuEvent* event) override;
|
||
|
|
|
||
|
|
void OnWorkItemChanged(WorkSpaceItem* item);
|
||
|
|
void OnWorkItemCliecked(QTreeWidgetItem* item, int column);
|
||
|
|
void OnItemDoubleClicked(QTreeWidgetItem* item, int column);
|
||
|
|
|
||
|
|
void OnAddMeshEntity(const QString& mesh, const QString& name);
|
||
|
|
class SceneComponent* OnAddComponent(const QString& typeName, class Entity* entity);
|
||
|
|
|
||
|
|
void OnDeleteEntity(class Entity* entity);
|
||
|
|
|
||
|
|
void PopupEntityMenu(QContextMenuEvent* event, class Entity* entity);
|
||
|
|
|
||
|
|
void FindAndRemoveItem(const QString& itemToRemove);
|
||
|
|
bool RemoveItemFromParent(QTreeWidgetItem* parentItem, const QString& itemToRemove);
|
||
|
|
|
||
|
|
void OnAddSatelliteEntity();
|
||
|
|
|
||
|
|
void OnTrackEntity(class Entity* entity);
|
||
|
|
|
||
|
|
private:
|
||
|
|
//void initUI();
|
||
|
|
void AddEntity(class QTreeWidgetItem* parent, Entity* entity);
|
||
|
|
|
||
|
|
private:
|
||
|
|
WorkSpace* currentWorkSpace_{ nullptr };
|
||
|
|
QTreeWidgetItem* root_{ nullptr };
|
||
|
|
};
|