forked from huxingyi/dust3d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpartwidget.h
82 lines (80 loc) · 2.76 KB
/
partwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef DUST3D_PART_WIDGET_H
#define DUST3D_PART_WIDGET_H
#include <QLabel>
#include <QPushButton>
#include <QMouseEvent>
#include "document.h"
#include "modelwidget.h"
class PartWidget : public QWidget
{
Q_OBJECT
signals:
void setPartLockState(QUuid partId, bool locked);
void setPartVisibleState(QUuid partId, bool visible);
void setPartSubdivState(QUuid partId, bool subdived);
void setPartDisableState(QUuid partId, bool disabled);
void setPartXmirrorState(QUuid partId, bool mirrored);
void setPartZmirrorState(QUuid partId, bool mirrored);
void setPartDeformThickness(QUuid partId, float thickness);
void setPartDeformWidth(QUuid partId, float width);
void setPartRoundState(QUuid partId, bool rounded);
void setPartColorState(QUuid partId, bool hasColor, QColor color);
void setPartCutRotation(QUuid partId, float cutRotation);
void setPartMaterialId(QUuid partId, QUuid materialId);
void movePartUp(QUuid partId);
void movePartDown(QUuid partId);
void movePartToTop(QUuid partId);
void movePartToBottom(QUuid partId);
void checkPart(QUuid partId);
void groupOperationAdded();
void enableBackgroundBlur();
void disableBackgroundBlur();
public:
PartWidget(const Document *document, QUuid partId);
void reload();
void updatePreview();
void updateLockButton();
void updateVisibleButton();
void updateSubdivButton();
void updateDisableButton();
void updateXmirrorButton();
void updateZmirrorButton();
void updateDeformButton();
void updateRoundButton();
void updateColorButton();
void updateCutRotationButton();
void updateCheckedState(bool checked);
void updateUnnormalState(bool unnormal);
static QSize preferredSize();
ModelWidget *previewWidget();
protected:
void mouseDoubleClickEvent(QMouseEvent *event) override;
public slots:
void showDeformSettingPopup(const QPoint &pos);
void showCutRotationSettingPopup(const QPoint &pos);
void showColorSettingPopup(const QPoint &pos);
private: // need initialize
const Document *m_document;
QUuid m_partId;
bool m_unnormal;
private:
ModelWidget *m_previewWidget;
QPushButton *m_visibleButton;
QPushButton *m_lockButton;
QPushButton *m_subdivButton;
QPushButton *m_disableButton;
QPushButton *m_xMirrorButton;
QPushButton *m_zMirrorButton;
QPushButton *m_deformButton;
QPushButton *m_roundButton;
QPushButton *m_colorButton;
QPushButton *m_cutButton;
QWidget *m_backgroundWidget;
private:
void initToolButton(QPushButton *button);
void initToolButtonWithoutFont(QPushButton *button);
void initButton(QPushButton *button);
void updateButton(QPushButton *button, QChar icon, bool highlighted);
void updateAllButtons();
};
#endif