ddt  0.1
ddtPickObjectDialog.hpp
Go to the documentation of this file.
1 // @copyright
2 // (c) Copyright ESO 2020
3 // All Rights Reserved
4 // ESO (eso.org) is an Intergovernmental Organization, and therefore special
5 // legal conditions apply.
6 //
7 // @file ddtPickObjectDialog.hpp
8 // @brief DDT Dialogs. Class for the pick object dialog
9 // The dialogs allows to pick objects in the image and
10 // retrieve information on it
11 //
12 // Class for the DDT Pick Object dialog
13 //
14 // @author Carsten Mannel, CGI
15 // @since 2020/11/06
16 //
17 
18 #ifndef DDT_DATAVISUALISATION_DDTDIALOGS_PICKOBJECTDIALOG_HPP
19 #define DDT_DATAVISUALISATION_DDTDIALOGS_PICKOBJECTDIALOG_HPP
20 
21 #include <QtWidgets>
22 
28 
33  Q_OBJECT
34 
35  public:
40  explicit DdtPickObjectDialog(QWidget* parent = nullptr);
44  virtual ~DdtPickObjectDialog() = default;
45 
49  void Initialize();
50 
57  void SetInitialParameter(const QString parameter_id,
58  const QVariant parameter) override;
59 
64  QString GetDialogName() override;
65 
66  protected:
70  virtual void CreateDialog();
71 
76  void UpdateStatisticsValues(const QString all_values_string);
77 
82  void UpdatePixelWindowSizeMax(const QString magnification_factor);
83 
84  void closeEvent(QCloseEvent* event) override;
85 
86  private:
87  void createLayouts();
88  void createWidgets();
89  void createWidgets2();
90  void connectElements() const;
91 
92  QVBoxLayout* layout;
93  QHBoxLayout* layout_upper_half;
94  QVBoxLayout* layout_valueoutput;
95  QHBoxLayout* layout_image_x;
96  QHBoxLayout* layout_image_y;
97  QHBoxLayout* layout_pixelvalue;
98  QHBoxLayout* layout_ra_value;
99  QHBoxLayout* layout_dec_value;
100  QHBoxLayout* layout_equinox_value;
101  QHBoxLayout* layout_fwhm_x_value;
102  QHBoxLayout* layout_fwhm_y_value;
103  QHBoxLayout* layout_angle_x_axis_value;
104  QHBoxLayout* layout_peak_above_bg_value;
105  QHBoxLayout* layout_background_value;
106  QHBoxLayout* layout_pixels_x_y_value;
107  QVBoxLayout* layout_magnification;
108  QHBoxLayout* layout_slider_label;
109  QHBoxLayout* layout_middle;
110  QHBoxLayout* layout_buttons;
111 
112  QLabel* label_image_x;
113  QLabel* label_image_y;
114  QLabel* label_pixelvalue;
115  QLabel* label_ra_value;
116  QLabel* label_dec_value;
117  QLabel* label_equinox_value;
118  QLabel* label_fwhm_x_value;
119  QLabel* label_fwhm_y_value;
120  QLabel* label_angle_x_axis_value;
121  QLabel* label_peak_above_bg_value;
122  QLabel* label_background_value;
123  QLabel* label_pixels_x_y_value;
124 
125  // Inactive edit field for value display
126  InactiveLineEdit* lineEdit_image_x;
127  InactiveLineEdit* lineEdit_image_y;
128  InactiveLineEdit* lineEdit_pixelvalue;
129  InactiveLineEdit* lineEdit_ra;
130  InactiveLineEdit* lineEdit_dec;
131  InactiveLineEdit* lineEdit_equinox;
132  InactiveLineEdit* lineEdit_fwhm_x;
133  InactiveLineEdit* lineEdit_fwhm_y;
134  InactiveLineEdit* lineEdit_angle_x_axis;
135  InactiveLineEdit* lineEdit_peak_above_bg;
136  InactiveLineEdit* lineEdit_background;
137  InactiveLineEdit* lineEdit_pixels_in_x_y;
138 
139  // Magnification widget
140  DdtMagnificationWidget* magnification_widget;
141 
142  // Pixel Window slider
143  QLabel* label_no_pixels;
144  QLabel* label_slider_min;
145  QLabel* label_slider_max;
146  QSlider* slider_pixel_window_size;
147  QLabel* label_pickmode;
148 
149  // Radio buttons, samples and markers
150  QRadioButton* radioButton_objectmode;
151  QRadioButton* radioButton_cursormode;
152  std::unique_ptr<QLineEdit> lineEdit_no_samples;
153  QCheckBox* checkBox_show_marker;
154 
155  // Dialog buttons
156  QPushButton* pushButton_pick;
157  QPushButton* pushButton_cancel_pick;
158  QPushButton* pushButton_confirm;
159  QPushButton* pushButton_quit;
160 
161  // Status flags and values
162  bool show_marker;
163  int no_samples;
164  int pixel_window_size_max;
165 
166  PickMode current_pick_mode;
167 
168  // Handling of freezing of the magnified image upon "pick" action
169  bool freeze_image;
170  bool overwrite_freeze;
171  QImage last_image_while_freezing;
172 
173  public slots:
179  void SetChangedParameter(const QString param_id,
180  const QVariant parameter) override;
181 
182  private slots:
183 
187  void SliderValueChanged(const int value);
188 
192  void PickModeSelected();
193 
197  void NumberOfSamplesChanged(const QString text);
198 
202  void ShowMarkerChanged();
203 
207  void PickSelected();
208 
212  void CancelPickSelected();
213 
217  void ConfirmSelected();
218 
222  void QuitSelected();
223 
227  void SetMagnificationFactor(const QString magnification_factor);
228 
229  signals:
233  void ParameterChanged(const QString dialog_id, const QString param_id,
234  const QVariant parameter);
235 };
236 
237 #endif // DDT_DATAVISUALISATION_DDTDIALOGS_PICKOBJECTDIALOG_HPP
DdtPickObjectDialog::UpdateStatisticsValues
void UpdateStatisticsValues(const QString all_values_string)
Definition: ddtPickObjectDialog.cpp:494
InactiveLineEdit
Definition: ddtDatavisualisationUtils.hpp:24
DdtPickObjectDialog::UpdatePixelWindowSizeMax
void UpdatePixelWindowSizeMax(const QString magnification_factor)
Definition: ddtPickObjectDialog.cpp:452
ddtDatavisualisationUtils.hpp
PickMode
PickMode
Definition: ddtDatavisualisationDefines.hpp:22
DdtPickObjectDialog::CreateDialog
virtual void CreateDialog()
Definition: ddtPickObjectDialog.cpp:44
ddtDialog.hpp
DdtPickObjectDialog::GetDialogName
QString GetDialogName() override
Definition: ddtPickObjectDialog.cpp:29
DdtPickObjectDialog::closeEvent
void closeEvent(QCloseEvent *event) override
Definition: ddtPickObjectDialog.cpp:554
DdtPickObjectDialog::ParameterChanged
void ParameterChanged(const QString dialog_id, const QString param_id, const QVariant parameter)
DdtPickObjectDialog::Initialize
void Initialize()
Definition: ddtPickObjectDialog.cpp:33
DdtPickObjectDialog::~DdtPickObjectDialog
virtual ~DdtPickObjectDialog()=default
ddtDialogIds.hpp
DdtDialog
Definition: ddtDialog.hpp:24
DdtPickObjectDialog::SetChangedParameter
void SetChangedParameter(const QString param_id, const QVariant parameter) override
Definition: ddtPickObjectDialog.cpp:463
DdtMagnificationWidget
The DdtMagnificationWidget class Class for the Magnification Widget that can be used to display a mag...
Definition: ddtMagnificationWidget.hpp:32
DdtPickObjectDialog::DdtPickObjectDialog
DdtPickObjectDialog(QWidget *parent=nullptr)
Definition: ddtPickObjectDialog.cpp:22
DdtPickObjectDialog
Definition: ddtPickObjectDialog.hpp:32
ddtDatavisualisationDefines.hpp
ddtMagnificationWidget.hpp
DdtPickObjectDialog::SetInitialParameter
void SetInitialParameter(const QString parameter_id, const QVariant parameter) override
Definition: ddtPickObjectDialog.cpp:333