ddt 1.2.1
Loading...
Searching...
No Matches
ddtMagnificationWidget.hpp
Go to the documentation of this file.
1
20#ifndef DDT_DATAVISUALISATION_DDTWIDGETS_MAGNIFICATIONWIDGET_HPP
21#define DDT_DATAVISUALISATION_DDTWIDGETS_MAGNIFICATIONWIDGET_HPP
22
23#include <QtUiPlugin/QDesignerExportWidget>
24
26#include "ddt/imageHandling.hpp"
28
35class QDESIGNER_WIDGET_EXPORT DdtMagnificationWidget : public DdtWidget {
36 Q_OBJECT
37
38 Q_PROPERTY(QString default_magnification_factors READ
39 get_default_magnification_factors WRITE
40 set_default_magnification_factors)
41 Q_PROPERTY(int center_rectangle_size READ get_center_rectangle_size WRITE set_center_rectangle_size)
42
43 public:
48 explicit DdtMagnificationWidget(QWidget* parent = nullptr);
49
53 virtual ~DdtMagnificationWidget() = default;
54
60 void set_default_magnification_factors(const QString default_factors);
61
66 QString get_default_magnification_factors();
67
72 void set_center_rectangle_size(const int size);
73
78 int get_center_rectangle_size() const;
79
83 void SetExpandingSize();
84
89 int GetImageSize() const;
90
95 int GetCurrentMagnificationFactor() const;
96
101 int GetMaximumCenterRectangleSize() const;
102
115 void CalcMarkerPosAndDraw(bool draw_marker,
116 QPointF view_xy, QRect magnified_image_rect, bool view_rotate_90_270,
117 double fwhm_x, double fwhm_y,
118 double angle_x_axis, bool vertical_flip, bool horizontal_flip);
119
120 public slots:
124 void ClearMagnifiedImage();
125
126 protected:
132
138
144
150
156
162
167
172
173 private:
174 QLabel* label_zoomed_image;
175 QToolButton* button_zoom_in;
176 QToolButton* button_zoom_out;
177 QToolButton* button_zoom_one;
178 QLabel* label_current_zoom;
179
180 void CreateWidget();
181
182 void ChangedMagnification(QString magnification_factor);
183
184 void Draw();
185 void DrawCenterRectangle(QPixmap& pixmap);
186 void DrawMarker(QPixmap& pixmap);
187
188 private slots:
189
190 void ButtonZoomInPressed();
191 void ButtonZoomOutPressed();
192 void ButtonZoomOnePressed();
193
194 public slots:
199 void MagnifiedImage(QImage magnified_image);
200
201 signals:
206 void SetMagnificationFactor(QString factor);
207};
208
209#endif // DDT_DATAVISUALISATION_DDTWIDGETS_MAGNIFICATIONWIDGET_HPP
210
The DdtMagnificationWidget class Class for the Magnification Widget that can be used to display a mag...
Definition ddtMagnificationWidget.hpp:35
void SetMagnificationFactor(QString factor)
virtual ~DdtMagnificationWidget()=default
bool draw_marker
draw_marker Flag indicates that the marker should/shouldn't be draw
Definition ddtMagnificationWidget.hpp:137
int center_rectangle_size
center_rectangle_size The size of the center rectangle, 0 value disables drawing the center rectangle
Definition ddtMagnificationWidget.hpp:161
QLineF marker_line_two
marker_line_two Second line that builds marker
Definition ddtMagnificationWidget.hpp:149
QLineF marker_line_one
marker_line_one First line that builds marker
Definition ddtMagnificationWidget.hpp:143
QPixmap current_zoomed_image
current_zoomed_image Copy of the drawn zoomed image, using to draw marker/cross
Definition ddtMagnificationWidget.hpp:131
QString default_magnification_factors
default_magnification_factors List of magnification scales
Definition ddtMagnificationWidget.hpp:155
int magnification_factor_index
Definition ddtMagnificationWidget.hpp:166
QStringList magnification_factors
Definition ddtMagnificationWidget.hpp:171
The DdtWidget class Use as wrapper class for new widgets.
Definition ddtWidget.hpp:28
DDT Utils. Helper classes for DDT Datavisualisation. Utilities for the DDT Datavisualisation.
DDT Widgets. Base class for the DDT widgets. Base class for the DDT widgets.
Image Handling class, offers access to image handling functions. This file is part of the DDT Image H...