ddt  1.0.0
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 
79  void UpdateStatisticsValues(const QString all_values_string);
80 
85  void UpdatePixelWindowSizeMax(const QString magnification_factor);
86 
87  void closeEvent(QCloseEvent* event) override;
88 
89  private:
90  void CreateLayouts();
91  void CreateWidgets();
92  void CreateWidgets2();
93  void ConnectElements() const;
94 
95  void UpdateMagnifiedImage(QImage const& magnified_image);
96 
97  QVBoxLayout* layout;
98  QHBoxLayout* layout_upper_half;
99  QVBoxLayout* layout_valueoutput;
100  QHBoxLayout* layout_image_x;
101  QHBoxLayout* layout_image_y;
102  QHBoxLayout* layout_pixelvalue;
103  QHBoxLayout* layout_ra_value;
104  QHBoxLayout* layout_dec_value;
105  QHBoxLayout* layout_equinox_value;
106  QHBoxLayout* layout_fwhm_x_value;
107  QHBoxLayout* layout_fwhm_y_value;
108  QHBoxLayout* layout_angle_x_axis_value;
109  QHBoxLayout* layout_peak_above_bg_value;
110  QHBoxLayout* layout_background_value;
111  QHBoxLayout* layout_pixels_x_y_value;
112  QVBoxLayout* layout_magnification;
113  QHBoxLayout* layout_slider_label;
114  QHBoxLayout* layout_middle;
115 
116  QLabel* label_image_x;
117  QLabel* label_image_y;
118  QLabel* label_pixelvalue;
119  QLabel* label_ra_value;
120  QLabel* label_dec_value;
121  QLabel* label_equinox_value;
122  QLabel* label_fwhm_x_value;
123  QLabel* label_fwhm_y_value;
124  QLabel* label_angle_x_axis_value;
125  QLabel* label_peak_above_bg_value;
126  QLabel* label_background_value;
127  QLabel* label_pixels_x_y_value;
128 
129  // Inactive edit field for value display
130  InactiveLineEdit* line_edit_image_x;
131  InactiveLineEdit* line_edit_image_y;
132  InactiveLineEdit* line_edit_pixelvalue;
133  InactiveLineEdit* line_edit_ra;
134  InactiveLineEdit* line_edit_dec;
135  InactiveLineEdit* line_edit_equinox;
136  InactiveLineEdit* line_edit_fwhm_x;
137  InactiveLineEdit* line_edit_fwhm_y;
138  InactiveLineEdit* line_edit_angle_x_axis;
139  InactiveLineEdit* line_edit_peak_above_bg;
140  InactiveLineEdit* line_edit_background;
141  InactiveLineEdit* line_edit_pixels_in_x_y;
142 
143  // Magnification widget
144  DdtMagnificationWidget* magnification_widget;
145 
146  // Pixel Window slider
147  QLabel* label_no_pixels;
148  QLabel* label_slider_min;
149  QLabel* label_slider_max;
150  QSlider* slider_pixel_window_size;
151  QLabel* label_pickmode;
152 
153  // Radio buttons, samples and markers
154  QRadioButton* radio_button_objectmode;
155  QRadioButton* radio_button_cursormode;
156  std::unique_ptr<QLineEdit> line_edit_no_samples;
157  QCheckBox* check_box_show_marker;
158 
159  // Dialog buttons
160  QDialogButtonBox* push_buttons_box;
161  QPushButton* push_button_pick;
162  QPushButton* push_button_cancel_pick;
163  QPushButton* push_button_ok;
164  QPushButton* push_button_cancel;
165 
166  // Status flags and values
167  bool show_marker;
168  int no_samples;
169  int pixel_window_size_max;
170 
171  PickMode current_pick_mode;
172 
173  // Handling of freezing of the magnified image upon "pick" action
174  bool freeze_image;
175  bool overwrite_freeze;
176  bool vertical_flipped_image;
177  bool horizontal_flipped_image;
178  QImage last_image_while_freezing;
179  bool datastream_pick;
180 
181  public slots:
187  void SetChangedParameter(const QString param_id,
188  const QVariant parameter) override;
189 
190  private slots:
194  void SliderValueChanged(const int value);
195 
199  void PickModeSelected();
200 
204  void NumberOfSamplesChanged(const QString text);
205 
209  void ShowMarkerChanged();
210 
214  void PickSelected();
215 
219  void CancelPickSelected();
220 
224  void ConfirmSelected();
225 
229  void QuitSelected();
230 
234  void SetMagnificationFactor(const QString magnification_factor);
235 
236  signals:
240  void ParameterChanged(const QString dialog_id, const QString param_id,
241  const QVariant parameter);
242 };
243 
244 #endif // DDT_DATAVISUALISATION_DDTDIALOGS_PICKOBJECTDIALOG_HPP
245 
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
virtual void CreateDialog() override
Definition: ddtPickObjectDialog.cpp:51
void UpdateStatisticsValues(const QString all_values_string)
Definition: ddtPickObjectDialog.cpp:579
void SetChangedParameter(const QString param_id, const QVariant parameter) override
Definition: ddtPickObjectDialog.cpp:500
void SetInitialParameter(const QString parameter_id, const QVariant parameter) override
Definition: ddtPickObjectDialog.cpp:353
void UpdatePixelWindowSizeMax(const QString magnification_factor)
Definition: ddtPickObjectDialog.cpp:489
QString GetDialogName() override
Definition: ddtPickObjectDialog.cpp:33
void closeEvent(QCloseEvent *event) override
Definition: ddtPickObjectDialog.cpp:641
DdtPickObjectDialog(QWidget *parent=nullptr)
Definition: ddtPickObjectDialog.cpp:26
virtual ~DdtPickObjectDialog()=default
void ParameterChanged(const QString dialog_id, const QString param_id, const QVariant parameter)
void Initialize()
Definition: ddtPickObjectDialog.cpp:37
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 ...