ddt 1.2.1
Loading...
Searching...
No Matches
ddtPickObjectDialog.hpp
Go to the documentation of this file.
1
20#ifndef DDT_DATAVISUALISATION_DDTDIALOGS_PICKOBJECTDIALOG_HPP
21#define DDT_DATAVISUALISATION_DDTDIALOGS_PICKOBJECTDIALOG_HPP
22
23#include <QtWidgets>
24
30
35 Q_OBJECT
36
37 public:
42 explicit DdtPickObjectDialog(QWidget* parent = nullptr);
43
47 virtual ~DdtPickObjectDialog() = default;
48
52 void Initialize();
53
60 void SetInitialParameter(const QString parameter_id,
61 const QVariant parameter) override;
62
67 QString GetDialogName() override;
68
69 protected:
73 virtual void CreateDialog() override;
74
80
85
90
91 void closeEvent(QCloseEvent* event) override;
92
93 private:
94 void CreateLayouts();
95 void CreateWidgets();
96 void CreateWidgets2();
97
98 void TryDrawingMarker();
99 void UpdateMagnifiedImage(QImage const& magnified_image);
100
101 // Constant values
102 const int LABELS_WIDTH = 120;
103 const int LINE_EDITS_WIDTH = 140;
104 const int SQUARE_MIN_SIZE = 10;
105 const int DEFAULT_MAGNIFIED_IMAGE_SIZE = 280;
106 const int NUMBER_FLIP_STATES = 2;
107
108 // Layouts
109 QVBoxLayout* layout;
110 QHBoxLayout* layout_upper_half;
111 QVBoxLayout* layout_valueoutput;
112 QHBoxLayout* layout_image_x;
113 QHBoxLayout* layout_image_y;
114 QHBoxLayout* layout_pixel_value;
115 QHBoxLayout* layout_ra_value;
116 QHBoxLayout* layout_dec_value;
117 QHBoxLayout* layout_equinox_value;
118 QHBoxLayout* layout_fwhm_x_value;
119 QHBoxLayout* layout_fwhm_y_value;
120 QHBoxLayout* layout_angle_x_axis_value;
121 QHBoxLayout* layout_peak_above_bg_value;
122 QHBoxLayout* layout_background_value;
123 QHBoxLayout* layout_square_size_value;
124 QVBoxLayout* layout_magnification;
125 QHBoxLayout* layout_slider_label;
126 QHBoxLayout* layout_middle;
127
128 // Labels
129 QLabel* label_image_x;
130 QLabel* label_image_y;
131 QLabel* label_pixel_value;
132 QLabel* label_ra_value;
133 QLabel* label_dec_value;
134 QLabel* label_equinox_value;
135 QLabel* label_fwhm_x_value;
136 QLabel* label_fwhm_y_value;
137 QLabel* label_angle_x_axis_value;
138 QLabel* label_peak_above_bg_value;
139 QLabel* label_background_value;
140 QLabel* label_square_size_value;
141
142 // Inactive edit field for value display
143 InactiveLineEdit* line_edit_image_x;
144 InactiveLineEdit* line_edit_image_y;
145 InactiveLineEdit* line_edit_pixel_value;
146 InactiveLineEdit* line_edit_ra;
147 InactiveLineEdit* line_edit_dec;
148 InactiveLineEdit* line_edit_equinox;
149 InactiveLineEdit* line_edit_fwhm_x;
150 InactiveLineEdit* line_edit_fwhm_y;
151 InactiveLineEdit* line_edit_angle_x_axis;
152 InactiveLineEdit* line_edit_peak_above_bg;
153 InactiveLineEdit* line_edit_background;
154 InactiveLineEdit* line_edit_square_size;
155
156 // Magnification widget
157 DdtMagnificationWidget* magnification_widget;
158
159 // Square size slider
160 QLabel* label_square_size;
161 QLabel* label_slider_min;
162 QLabel* label_slider_max;
163 QSlider* slider_square_size;
164 QLabel* label_pickmode;
165
166 // Radio buttons, samples and markers
167 QRadioButton* radio_button_objectmode;
168 QRadioButton* radio_button_cursormode;
169 QCheckBox* check_box_show_marker;
170
171 // Dialog buttons
172 QDialogButtonBox* push_buttons_box;
173 QPushButton* push_button_pick;
174 QPushButton* push_button_cancel_pick;
175 QPushButton* push_button_ok;
176 QPushButton* push_button_cancel;
177
178 // Status flags and values
179 bool show_marker;
180
181 PickMode current_pick_mode;
182
183 // Values to calculate marker position
184 QRect magnified_image_rect;
185 QPointF view_xy;
186 bool view_rotate_90_270;
187 double fwhm_x, fwhm_y;
188 double angle_x_axis;
189
190 // Handling of freezing of the magnified image upon "pick" action
191 bool freeze_image;
192 bool overwrite_freeze;
193 bool vertical_flipped_image;
194 bool horizontal_flipped_image;
195 QImage last_image_while_freezing;
196 bool datastream_pick;
197
198 public slots:
204 void SetChangedParameter(const QString param_id,
205 const QVariant parameter) override;
206
207 private slots:
211 void SliderValueChanged(const int value);
212
216 void PickModeSelected();
217
221 void ShowMarkerChanged();
222
226 void PickSelected();
227
231 void CancelPickSelected();
232
236 void ConfirmSelected();
237
241 void QuitSelected();
242
246 void SetMagnificationFactor(const QString magnification_factor);
247
248 signals:
252 void ParameterChanged(const QString dialog_id, const QString param_id,
253 const QVariant parameter);
254};
255
256#endif // DDT_DATAVISUALISATION_DDTDIALOGS_PICKOBJECTDIALOG_HPP
257
Definition ddtDialog.hpp:27
The DdtMagnificationWidget class Class for the Magnification Widget that can be used to display a mag...
Definition ddtMagnificationWidget.hpp:35
Definition ddtPickObjectDialog.hpp:34
void UpdateStatisticsValues(const ReturnValuePickObjectDialogParameters &parameters)
Definition ddtPickObjectDialog.cpp:558
virtual void CreateDialog() override
Definition ddtPickObjectDialog.cpp:55
void SetChangedParameter(const QString param_id, const QVariant parameter) override
Definition ddtPickObjectDialog.cpp:457
void SetInitialParameter(const QString parameter_id, const QVariant parameter) override
Definition ddtPickObjectDialog.cpp:343
QString GetDialogName() override
Definition ddtPickObjectDialog.cpp:34
void closeEvent(QCloseEvent *event) override
Definition ddtPickObjectDialog.cpp:596
DdtPickObjectDialog(QWidget *parent=nullptr)
Definition ddtPickObjectDialog.cpp:27
virtual ~DdtPickObjectDialog()=default
void ParameterChanged(const QString dialog_id, const QString param_id, const QVariant parameter)
void Initialize()
Definition ddtPickObjectDialog.cpp:38
void UpdateSliderSquareMaxSize()
Definition ddtPickObjectDialog.cpp:452
void ClearStatisticsValues()
Definition ddtPickObjectDialog.cpp:581
Definition ddtDatavisualisationUtils.hpp:27
DDT Utils. Definitions for the data visualisation. Utilities for the DDT Datavisualisation.
PickMode
Definition ddtDatavisualisationDefines.hpp:25
DDT Utils. Helper classes for DDT Datavisualisation. Utilities for the DDT Datavisualisation.
DDT Dialog IDs. ID values for all used dialogs. IDs for the used dialogs.
DDT Dialogs. Base class for the DDT dialogs. Base class for the DDT dialogs.
DDT Widgets. Class for the DDT Magnification Widget. The widget will display a magnified part of the ...
Definition ddtDatavisualisationUtils.hpp:62