-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathpolygongroupcontrolmenucontroller.h
93 lines (72 loc) · 2.75 KB
/
polygongroupcontrolmenucontroller.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
83
84
85
86
87
88
89
90
91
92
93
#ifndef POLYGONGROUPCONTROLMENUCONTROLLER_H
#define POLYGONGROUPCONTROLMENUCONTROLLER_H
#include <QStandardItemModel>
#include <QVector3D>
#include <memory>
#include "qmlcomponentcontroller.h"
class PolygonGroup;
class GraphicsScene3dView;
class PointObject;
class PolygonGroupControlMenuController : public QmlComponentController
{
Q_OBJECT
Q_PROPERTY(PolygonGroup* polygonGroup READ polygonGroup CONSTANT)
Q_PROPERTY(QStandardItemModel* polygonListModel READ polygonListModel CONSTANT)
public:
explicit PolygonGroupControlMenuController(QObject *parent = nullptr);
/**
* @brief Process of polygon group visibility check box checked state changing
* @param[in] checked - visibility check box checked state
*/
Q_INVOKABLE void onVisibilityCheckBoxCheckedChanged(bool checked);
/**
* @brief Process of polygon group item remove button clicking
* @param[in] index - model index of polygon item
*/
Q_INVOKABLE void onPolygonListItemRemoveButtonClicked(const QModelIndex& index);
/**
* @brief Process of point coord spinbox value changing
* @param[in] coord - coord to be set to point
* @param[in] index - model index of point item
*/
Q_INVOKABLE void onPointCoordSpinBoxValueChanged(QVector3D coord, const QModelIndex& index);
/**
* @brief Process of add polygon button clicking
*/
Q_INVOKABLE void onAddPolygonButtonClicked();
/**
* @brief Process of add point button clicking
* @param[in] index - model index of polygon item
*/
Q_INVOKABLE void onAddPointButtonClicked(const QModelIndex& index);
/**
* @brief Process of polygon color dialog accepting
* @param[in] color - color to be set to polygon
* @param[in] index - model index of polygon item
*/
Q_INVOKABLE void onPolygonColorDialogAccepted(QColor color, const QModelIndex& index);
/**
* @brief Sets pointer to graphics scene view
* @param[in] sceneView - pointer to graphics scene view
*/
void setGraphicsSceneView(GraphicsScene3dView* sceneView);
Q_INVOKABLE QVector3D getPointCoord(const QModelIndex& pointIndex);
Q_INVOKABLE PointObject* pointAt(const QModelIndex& pointIndex) const;
private:
/**
* @brief Returns pointer to model of polygon group
* @return Pointer to model of polygon group
*/
QStandardItemModel* polygonListModel() const;
/**
* @brief Returns pointer to polygon group
* @return Pointer to polygon group
*/
PolygonGroup* polygonGroup() const;
protected:
void findComponent() override;
private:
GraphicsScene3dView* m_graphicsSceneView = nullptr;
std::unique_ptr <QStandardItemModel> m_polygonListModel;
};
#endif // POLYGONGROUPCONTROLMENUCONTROLLER_H