-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrianglecontainer.h
40 lines (32 loc) · 1.26 KB
/
trianglecontainer.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
#ifndef TRIANGLECONTAINER_H
#define TRIANGLECONTAINER_H
#include <QQuickItem>
#include <triangleitem.h>
#include <QMatrix4x4>
#include <triangleprimitive.h>
class TrianglesContainer : public QQuickItem
{
Q_OBJECT
Q_PROPERTY(qreal piecesRotation READ piecesRotation WRITE setPiecesRotation NOTIFY piecesRotationChanged)
private:
QVector<TriangleItem*> m_triangles;
QVector<TrianglePrimitive> m_cloudedPolygons;
QVector<TrianglePrimitive> m_disasmPolygons;
QVector<TrianglePrimitive> m_asmPolygons;
qreal m_piecesRotation;
QMatrix4x4 m_currentTransformation;
public:
TrianglesContainer(QQuickItem* parent = nullptr);
qreal piecesRotation() const;
private slots:
public slots:
void interpolateToDisAsm(qreal currentAngle = 0., bool inverted = false);
void interpolateToAsm(qreal currentAngle = 0., bool inverted = false);
void initTriangles();
void setPiecesRotation(qreal piecesRotation);
signals:
void piecesRotationChanged(qreal piecesRotation);
void interpolationRequest(bool inverted = false);
void setTransformationMatrixRequest(const QMatrix4x4& currentTransformations = QMatrix4x4{});
};
#endif // TRIANGLECONTAINER_H