2022-11-11 12:06:06 +00:00
|
|
|
#ifndef DUST3D_APPLICATION_BONE_PROPERTY_WIDGET_H_
|
|
|
|
#define DUST3D_APPLICATION_BONE_PROPERTY_WIDGET_H_
|
|
|
|
|
|
|
|
#include "document.h"
|
2022-11-16 10:58:13 +00:00
|
|
|
#include "int_number_widget.h"
|
2022-11-11 12:06:06 +00:00
|
|
|
#include <QWidget>
|
|
|
|
#include <dust3d/base/uuid.h>
|
|
|
|
|
2022-11-13 04:38:04 +00:00
|
|
|
class QLineEdit;
|
2022-12-10 12:04:44 +00:00
|
|
|
class QComboBox;
|
2022-11-13 04:38:04 +00:00
|
|
|
|
2022-11-11 12:06:06 +00:00
|
|
|
class BonePropertyWidget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
signals:
|
2022-11-13 04:38:04 +00:00
|
|
|
void renameBone(const dust3d::Uuid& boneId, const QString& name);
|
2022-11-11 12:06:06 +00:00
|
|
|
void groupOperationAdded();
|
2022-11-29 10:32:19 +00:00
|
|
|
void pickBoneJoints(const dust3d::Uuid& boneId, size_t joints);
|
2022-12-10 12:04:44 +00:00
|
|
|
void setBoneAttachment(const dust3d::Uuid& boneId, const dust3d::Uuid& toBoneId, int toBoneJointIndex);
|
2022-11-11 12:06:06 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
BonePropertyWidget(Document* document,
|
|
|
|
const std::vector<dust3d::Uuid>& boneIds,
|
|
|
|
QWidget* parent = nullptr);
|
2022-11-13 04:38:04 +00:00
|
|
|
private slots:
|
|
|
|
void nameEditChanged();
|
2022-12-10 12:04:44 +00:00
|
|
|
void updateBoneJointComboBox();
|
|
|
|
void synchronizeBoneAttachmentFromControls();
|
2022-11-11 12:06:06 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Document* m_document = nullptr;
|
|
|
|
std::vector<dust3d::Uuid> m_boneIds;
|
|
|
|
dust3d::Uuid m_boneId;
|
|
|
|
const Document::Bone* m_bone = nullptr;
|
2022-11-13 04:38:04 +00:00
|
|
|
QLineEdit* m_nameEdit = nullptr;
|
2022-12-10 12:04:44 +00:00
|
|
|
QComboBox* m_parentBoneComboBox = nullptr;
|
|
|
|
QComboBox* m_parentJointComboBox = nullptr;
|
2022-11-16 10:58:13 +00:00
|
|
|
IntNumberWidget* m_jointsWidget = nullptr;
|
2022-11-11 12:06:06 +00:00
|
|
|
void prepareBoneIds();
|
2022-12-10 12:04:44 +00:00
|
|
|
dust3d::Uuid editingParentBoneId();
|
|
|
|
int editingParentJointIndex();
|
2022-11-11 12:06:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|