dust3d/src/skeletonpartlistwidget.h

71 lines
2.2 KiB
C
Raw Normal View History

#ifndef SKELETON_PART_LIST_WIDGET_H
#define SKELETON_PART_LIST_WIDGET_H
#include <QListWidget>
#include <map>
#include <QLabel>
#include <QPushButton>
#include "skeletondocument.h"
class SkeletonPartWidget : public QWidget
{
Q_OBJECT
2018-04-08 01:30:55 +00:00
signals:
void setPartLockState(QUuid partId, bool locked);
void setPartVisibleState(QUuid partId, bool visible);
void setPartSubdivState(QUuid partId, bool subdived);
2018-04-11 09:19:27 +00:00
void setPartDisableState(QUuid partId, bool disabled);
2018-04-15 12:11:51 +00:00
void setPartXmirrorState(QUuid partId, bool mirrored);
void setPartZmirrorState(QUuid partId, bool mirrored);
void setPartThickness(QUuid partId, float thickness);
public:
SkeletonPartWidget(const SkeletonDocument *document, QUuid partId);
void reload();
2018-04-08 01:30:55 +00:00
void updatePreview();
void updateLockButton();
void updateVisibleButton();
void updateSubdivButton();
2018-04-11 09:19:27 +00:00
void updateDisableButton();
2018-04-15 12:11:51 +00:00
void updateXmirrorButton();
void updateZmirrorButton();
void updateThicknessButton();
public slots:
void showThicknessSettingPopup(const QPoint &pos);
private:
const SkeletonDocument *m_document;
QUuid m_partId;
QLabel *m_previewLabel;
QPushButton *m_visibleButton;
2018-04-07 12:30:26 +00:00
QPushButton *m_lockButton;
QPushButton *m_subdivButton;
2018-04-11 09:19:27 +00:00
QPushButton *m_disableButton;
2018-04-15 12:11:51 +00:00
QPushButton *m_xMirrorButton;
QPushButton *m_zMirrorButton;
QPushButton *m_thicknessButton;
QLabel *m_nameLabel;
2018-04-08 01:30:55 +00:00
private:
void initButton(QPushButton *button);
void updateButton(QPushButton *button, QChar icon, bool highlighted);
};
class SkeletonPartListWidget : public QListWidget
{
Q_OBJECT
public:
SkeletonPartListWidget(const SkeletonDocument *document);
public slots:
void partChanged(QUuid partId);
void partListChanged();
void partPreviewChanged(QUuid partid);
2018-04-08 01:30:55 +00:00
void partLockStateChanged(QUuid partId);
void partVisibleStateChanged(QUuid partId);
void partSubdivStateChanged(QUuid partId);
2018-04-11 09:19:27 +00:00
void partDisableStateChanged(QUuid partId);
2018-04-15 12:11:51 +00:00
void partXmirrorStateChanged(QUuid partId);
void partThicknessChanged(QUuid partId);
private:
const SkeletonDocument *m_document;
std::map<QUuid, QListWidgetItem *> m_itemMap;
};
#endif