ddt 1.4.0
 
Loading...
Searching...
No Matches
ddtPickObjectDialog.hpp
Go to the documentation of this file.
1
10
11#ifndef DDT_DATAVISUALISATION_DDTDIALOGS_PICKOBJECTDIALOG_HPP
12#define DDT_DATAVISUALISATION_DDTDIALOGS_PICKOBJECTDIALOG_HPP
13
14#include <QtWidgets>
15
21
26 Q_OBJECT
27
28 public:
33 explicit DdtPickObjectDialog(QWidget* parent = nullptr);
34
38 virtual ~DdtPickObjectDialog() = default;
39
43 void Initialize();
44
51 void SetInitialParameter(const QString parameter_id,
52 const QVariant parameter) override;
53
58 QString GetDialogName() override;
59
60 protected:
64 virtual void CreateDialog() override;
65
71
76
81
82 void closeEvent(QCloseEvent* event) override;
83
84 private:
85 void CreateLayouts();
86 void CreateWidgets();
87 void CreateWidgets2();
88
89 void TryDrawingMarker();
90 void UpdateMagnifiedImage(QImage const& magnified_image);
91
92 // Constant values
93 const int LABELS_WIDTH = 120;
94 const int LINE_EDITS_WIDTH = 140;
95 const int SQUARE_MIN_SIZE = 10;
96 const int DEFAULT_MAGNIFIED_IMAGE_SIZE = 280;
97 const int NUMBER_FLIP_STATES = 2;
98
99 // Layouts
100 QVBoxLayout* layout;
101 QHBoxLayout* layout_upper_half;
102 QVBoxLayout* layout_valueoutput;
103 QHBoxLayout* layout_image_x;
104 QHBoxLayout* layout_image_y;
105 QHBoxLayout* layout_pixel_value;
106 QHBoxLayout* layout_ra_value;
107 QHBoxLayout* layout_dec_value;
108 QHBoxLayout* layout_equinox_value;
109 QHBoxLayout* layout_fwhm_x_value;
110 QHBoxLayout* layout_fwhm_y_value;
111 QHBoxLayout* layout_angle_x_axis_value;
112 QHBoxLayout* layout_peak_above_bg_value;
113 QHBoxLayout* layout_background_value;
114 QHBoxLayout* layout_square_size_value;
115 QVBoxLayout* layout_magnification;
116 QHBoxLayout* layout_slider_label;
117 QHBoxLayout* layout_middle;
118
119 // Labels
120 QLabel* label_image_x;
121 QLabel* label_image_y;
122 QLabel* label_pixel_value;
123 QLabel* label_ra_value;
124 QLabel* label_dec_value;
125 QLabel* label_equinox_value;
126 QLabel* label_fwhm_x_value;
127 QLabel* label_fwhm_y_value;
128 QLabel* label_angle_x_axis_value;
129 QLabel* label_peak_above_bg_value;
130 QLabel* label_background_value;
131 QLabel* label_square_size_value;
132
133 // Inactive edit field for value display
134 InactiveLineEdit* line_edit_image_x;
135 InactiveLineEdit* line_edit_image_y;
136 InactiveLineEdit* line_edit_pixel_value;
137 InactiveLineEdit* line_edit_ra;
138 InactiveLineEdit* line_edit_dec;
139 InactiveLineEdit* line_edit_equinox;
140 InactiveLineEdit* line_edit_fwhm_x;
141 InactiveLineEdit* line_edit_fwhm_y;
142 InactiveLineEdit* line_edit_angle_x_axis;
143 InactiveLineEdit* line_edit_peak_above_bg;
144 InactiveLineEdit* line_edit_background;
145 InactiveLineEdit* line_edit_square_size;
146
147 // Magnification widget
148 DdtMagnificationWidget* magnification_widget;
149
150 // Square size slider
151 QLabel* label_square_size;
152 QLabel* label_slider_min;
153 QLabel* label_slider_max;
154 QSlider* slider_square_size;
155 QLabel* label_pickmode;
156
157 // Radio buttons, samples and markers
158 QRadioButton* radio_button_objectmode;
159 QRadioButton* radio_button_cursormode;
160 QCheckBox* check_box_show_marker;
161
162 // Dialog buttons
163 QDialogButtonBox* push_buttons_box;
164 QPushButton* push_button_pick;
165 QPushButton* push_button_cancel_pick;
166 QPushButton* push_button_ok;
167 QPushButton* push_button_cancel;
168
169 // Status flags and values
170 bool show_marker;
171
172 PickMode current_pick_mode;
173
174 // Values to calculate marker position
175 QRect magnified_image_rect;
176 QPointF view_xy;
177 bool view_rotate_90_270;
178 double fwhm_x, fwhm_y;
179 double angle_x_axis;
180
181 // Handling of freezing of the magnified image upon "pick" action
182 bool freeze_image;
183 bool overwrite_freeze;
184 bool vertical_flipped_image;
185 bool horizontal_flipped_image;
186 QImage last_image_while_freezing;
187 bool datastream_pick;
188
189 public slots:
195 void SetChangedParameter(const QString param_id,
196 const QVariant parameter) override;
197
198 private slots:
202 void SliderValueChanged(const int value);
203
207 void PickModeSelected();
208
212 void ShowMarkerChanged();
213
217 void PickSelected();
218
222 void CancelPickSelected();
223
227 void ConfirmSelected();
228
232 void QuitSelected();
233
237 void SetMagnificationFactor(const QString magnification_factor);
238
239 signals:
243 void ParameterChanged(const QString dialog_id, const QString param_id,
244 const QVariant parameter);
245};
246
247#endif // DDT_DATAVISUALISATION_DDTDIALOGS_PICKOBJECTDIALOG_HPP
DdtDialog(QWidget *parent=nullptr)
Definition ddtDialog.cpp:16
The DdtMagnificationWidget class Class for the Magnification Widget that can be used to display a mag...
Definition ddtMagnificationWidget.hpp:26
void UpdateStatisticsValues(const ReturnValuePickObjectDialogParameters &parameters)
Definition ddtPickObjectDialog.cpp:549
virtual void CreateDialog() override
Definition ddtPickObjectDialog.cpp:46
void SetChangedParameter(const QString param_id, const QVariant parameter) override
Definition ddtPickObjectDialog.cpp:448
void SetInitialParameter(const QString parameter_id, const QVariant parameter) override
Definition ddtPickObjectDialog.cpp:334
QString GetDialogName() override
Definition ddtPickObjectDialog.cpp:25
void closeEvent(QCloseEvent *event) override
Definition ddtPickObjectDialog.cpp:587
DdtPickObjectDialog(QWidget *parent=nullptr)
Definition ddtPickObjectDialog.cpp:18
virtual ~DdtPickObjectDialog()=default
void ParameterChanged(const QString dialog_id, const QString param_id, const QVariant parameter)
void Initialize()
Definition ddtPickObjectDialog.cpp:29
void UpdateSliderSquareMaxSize()
Definition ddtPickObjectDialog.cpp:443
void ClearStatisticsValues()
Definition ddtPickObjectDialog.cpp:572
Definition ddtDatavisualisationUtils.hpp:18
DDT Utils. Definitions for the data visualisation. Utilities for the DDT Datavisualisation.
PickMode
Definition ddtDatavisualisationDefines.hpp:16
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:53