1 | #ifndef __DEFAULT_PROJECTOR_WIDGET_H__ |
---|
2 | #define __DEFAULT_PROJECTOR_WIDGET_H__ |
---|
3 | |
---|
4 | |
---|
5 | // Includes Projection Designer headers |
---|
6 | #include <projdesigner/include/interfaces.h> |
---|
7 | |
---|
8 | // Includes the ui_ header |
---|
9 | #include "ui_defaultprojectorwidget.h" |
---|
10 | |
---|
11 | // Includes local headers |
---|
12 | #include "DefaultProjectorData.h" |
---|
13 | |
---|
14 | |
---|
15 | /** |
---|
16 | * Implementation of the DefaultProjectorWidget class. |
---|
17 | * |
---|
18 | * This widget is used in a stacked widget with all the other projectors, to |
---|
19 | * configure the projector. |
---|
20 | * |
---|
21 | */ |
---|
22 | class DefaultProjectorWidget : public ProjectorWidget, |
---|
23 | private Ui::DefaultProjectorWidget |
---|
24 | { |
---|
25 | Q_OBJECT |
---|
26 | |
---|
27 | public: |
---|
28 | |
---|
29 | |
---|
30 | /** |
---|
31 | * Default constructor. |
---|
32 | * |
---|
33 | */ |
---|
34 | DefaultProjectorWidget(ProjectorInterface *plugin, QWidget* pParent=0, Qt::WFlags flag=0); |
---|
35 | |
---|
36 | |
---|
37 | /** |
---|
38 | * Destructor. |
---|
39 | * |
---|
40 | */ |
---|
41 | ~DefaultProjectorWidget(); |
---|
42 | |
---|
43 | |
---|
44 | /** |
---|
45 | * Updates the widget. |
---|
46 | * |
---|
47 | * This method can be used it two ways: to force a refresh or to update the |
---|
48 | * data of the widget. |
---|
49 | * |
---|
50 | * @param data A const pointer on the data to be used for the widget. This |
---|
51 | * data will be duplicated in the widget. If data is NULL, the |
---|
52 | * current data are used and the refresh is forced. If no data |
---|
53 | * is given, NULL is used. |
---|
54 | * |
---|
55 | */ |
---|
56 | void updateGUI(const ProjectorData* data=NULL); |
---|
57 | |
---|
58 | |
---|
59 | /** |
---|
60 | * Clears the fields of the widget. |
---|
61 | * |
---|
62 | * This method is typically used when the widget will be disabled (if no |
---|
63 | * channel is specified in Projection Designer, the widget is visible but |
---|
64 | * disabled: fields must be empty). |
---|
65 | * |
---|
66 | */ |
---|
67 | void clear(void); |
---|
68 | |
---|
69 | |
---|
70 | /** |
---|
71 | * Gets the widget data. |
---|
72 | * |
---|
73 | * @return A const reference on the data of the widget. |
---|
74 | * |
---|
75 | */ |
---|
76 | const ProjectorData& data(void) const {return m_data;} |
---|
77 | |
---|
78 | |
---|
79 | signals: |
---|
80 | |
---|
81 | |
---|
82 | /** |
---|
83 | * [signal] Notify that the data of the widget have changed. |
---|
84 | * |
---|
85 | * This signal is emitted each time that a field is changed. |
---|
86 | * |
---|
87 | * @param data A const reference on the new data (the same as returned by |
---|
88 | * the data() method). |
---|
89 | * |
---|
90 | */ |
---|
91 | virtual void dataChanged(const ProjectorData& data); |
---|
92 | |
---|
93 | |
---|
94 | private slots: |
---|
95 | |
---|
96 | |
---|
97 | /** |
---|
98 | * [private slot] Called when the Fov changes. |
---|
99 | * |
---|
100 | */ |
---|
101 | void on_fovEdit_editingFinished(); |
---|
102 | |
---|
103 | |
---|
104 | /** |
---|
105 | * [private slot] Called when the Aspect Ratio changes. |
---|
106 | * |
---|
107 | */ |
---|
108 | void on_aspectRatioEdit_editingFinished(); |
---|
109 | |
---|
110 | |
---|
111 | /** |
---|
112 | * [private slot] Called when the Near changes. |
---|
113 | * |
---|
114 | */ |
---|
115 | void on_nearEdit_editingFinished(); |
---|
116 | |
---|
117 | |
---|
118 | /** |
---|
119 | * [private slot] Called when the Far changes. |
---|
120 | * |
---|
121 | */ |
---|
122 | void on_farEdit_editingFinished(); |
---|
123 | |
---|
124 | |
---|
125 | /** |
---|
126 | * [private slot] Called when the OffAxis-X changes. |
---|
127 | * |
---|
128 | */ |
---|
129 | void on_offaxisXEdit_editingFinished(); |
---|
130 | |
---|
131 | |
---|
132 | /** |
---|
133 | * [private slot] Called when the OffAxis-Y changes. |
---|
134 | * |
---|
135 | */ |
---|
136 | void on_offaxisYEdit_editingFinished(); |
---|
137 | |
---|
138 | |
---|
139 | private: |
---|
140 | |
---|
141 | |
---|
142 | /// The current DefaultPluginData of the widget. |
---|
143 | DefaultPluginData m_data; |
---|
144 | |
---|
145 | }; |
---|
146 | |
---|
147 | #endif // __DEFAULT_PROJECTOR_WIDGET_H__ |
---|