2022-12-18 14:19:04 +00:00
|
|
|
/*##############################################################################
|
|
|
|
## Author: Shaun Reed ##
|
2023-01-02 03:26:58 +00:00
|
|
|
## Legal: All Content (c) 2023 Shaun Reed, all rights reserved ##
|
2022-12-18 14:19:04 +00:00
|
|
|
## About: TreeView plugin for scene hierarchy ##
|
|
|
|
## ##
|
|
|
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
|
|
|
################################################################################
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TREEVIEW_H
|
|
|
|
#define TREEVIEW_H
|
|
|
|
|
|
|
|
#include <QDesignerCustomWidgetInterface>
|
|
|
|
#include <QDesignerExportWidget>
|
|
|
|
#include <QDockWidget>
|
|
|
|
|
|
|
|
#include <qtk/scene.h>
|
|
|
|
#include <QTreeWidgetItem>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class TreeView;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Qtk {
|
|
|
|
class QDESIGNER_WIDGET_EXPORT TreeView : public QDockWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2023-01-02 03:26:58 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* Constructors / Destructors
|
|
|
|
************************************************************************/
|
|
|
|
|
2022-12-18 14:19:04 +00:00
|
|
|
explicit TreeView(QWidget * parent = nullptr);
|
|
|
|
|
|
|
|
~TreeView();
|
|
|
|
|
2023-01-02 03:26:58 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* Public Methods
|
|
|
|
************************************************************************/
|
|
|
|
|
2022-12-18 14:19:04 +00:00
|
|
|
/**
|
|
|
|
* Updates the QTreeWidget with all objects within the scene.
|
|
|
|
* @param scene The scene to load objects from.
|
|
|
|
*/
|
|
|
|
void updateView(const Scene * scene);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
/**
|
|
|
|
* Focus the camera on an item when it is double clicked.
|
|
|
|
* Triggered by QTreeWidget::itemDoubleClicked signal.
|
|
|
|
*
|
|
|
|
* @param item The item that was double clicked
|
|
|
|
* @param column The column of the item that was double clicked.
|
|
|
|
* This param is currently not used but required for this signal.
|
|
|
|
*/
|
|
|
|
void itemFocus(QTreeWidgetItem * item, int column);
|
|
|
|
|
|
|
|
private:
|
2023-01-02 03:26:58 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* Private Members
|
|
|
|
************************************************************************/
|
|
|
|
|
2022-12-18 14:19:04 +00:00
|
|
|
Ui::TreeView * ui;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The name of the scene last loaded by this TreeWidget.
|
|
|
|
* Used to load object data from a target scene.
|
|
|
|
*/
|
|
|
|
QString mSceneName;
|
|
|
|
};
|
|
|
|
} // namespace Qtk
|
|
|
|
|
|
|
|
#endif // TREEVIEW_H
|