95 lines
2.4 KiB
C++
95 lines
2.4 KiB
C++
/*##############################################################################
|
|
## Author: Shaun Reed ##
|
|
## Legal: All Content (c) 2023 Shaun Reed, all rights reserved ##
|
|
## About: Toolbox plugin for object details and options ##
|
|
## ##
|
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
|
################################################################################
|
|
*/
|
|
|
|
#ifndef TOOLBOX_H
|
|
#define TOOLBOX_H
|
|
|
|
#include <QDesignerExportWidget>
|
|
#include <QDockWidget>
|
|
#include <QDoubleSpinBox>
|
|
#include <QFormLayout>
|
|
#include <QGroupBox>
|
|
#include <QHBoxLayout>
|
|
#include <QLabel>
|
|
|
|
|
|
#include "qtk/scene.h"
|
|
|
|
namespace Ui
|
|
{
|
|
class ToolBox;
|
|
}
|
|
|
|
namespace Qtk
|
|
{
|
|
class ToolBox : public QDockWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
/*************************************************************************
|
|
* Contructors / Destructors
|
|
*************************************************************************/
|
|
|
|
explicit ToolBox(QWidget * parent = nullptr);
|
|
|
|
~ToolBox();
|
|
|
|
void removePages();
|
|
|
|
/**
|
|
* Creates the transform panel and controls.
|
|
*
|
|
* @param object The Qtk::Object associated with this panel.
|
|
*/
|
|
void createTransformPanel(const Object * object);
|
|
|
|
void createPageProperties(const Object * object);
|
|
|
|
void createPageShader(const Object * object);
|
|
|
|
void updateFocus(const QString & name);
|
|
|
|
|
|
private:
|
|
/*************************************************************************
|
|
* Private Members
|
|
************************************************************************/
|
|
|
|
/// Spinbox with 3 fields and label.
|
|
struct SpinBox3D {
|
|
QLabel * label;
|
|
QDoubleSpinBox * x;
|
|
QDoubleSpinBox * y;
|
|
QDoubleSpinBox * z;
|
|
};
|
|
|
|
/// Transform controls and layout.
|
|
struct TransformPanel {
|
|
QHBoxLayout * layout;
|
|
SpinBox3D spinBox;
|
|
};
|
|
TransformPanel transformPanel_;
|
|
|
|
/// Scale controls and layout.
|
|
struct ScalePanel {
|
|
QHBoxLayout * layout;
|
|
SpinBox3D spinBox;
|
|
};
|
|
ScalePanel scalePanel_;
|
|
|
|
/// The root layout for the primary widget.
|
|
QFormLayout * formLayout_;
|
|
|
|
Ui::ToolBox * ui;
|
|
};
|
|
} // namespace Qtk
|
|
|
|
#endif // TOOLBOX_H
|