ddt  0.1
ddtColourmapWidget.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 ddtColourmapWdiget.hpp
8 // @brief DDT Widgets. Class for the DDT Colourmap Widget.
9 //
10 // Class for the Colourmap Widget. The widget will display a colourbar for the
11 // given colourmap.
12 //
13 // @author Carsten Mannel, CGI
14 // @since 2020/10/09
15 //
16 
17 #ifndef DDT_DATAVISUALISATION_DDTWIDGETS_COLOURMAPWIDGET_HPP
18 #define DDT_DATAVISUALISATION_DDTWIDGETS_COLOURMAPWIDGET_HPP
19 
20 #include <QtUiPlugin/QDesignerExportWidget>
21 
22 #include "ddt/imageHandling.hpp"
24 
29 class QDESIGNER_WIDGET_EXPORT DdtColourmapWidget : public DdtWidget {
30  Q_OBJECT
31 
32  public:
37  explicit DdtColourmapWidget(QWidget* parent = nullptr);
38 
43 
44  protected:
45  private:
46  QLabel* colourbar_label;
47  QLabel* colourscale_label;
48 
49  void CreateWidget();
50  void UpdateColourmap(QVector<QRgb> colourmap);
51  void UpdateColourscale(double min_value, double max_value,
52  int scaling_function);
53 
54  void DrawScale(double min_value, double max_value, QPainter& painter,
55  int scaling_function);
56  void DrawScaleLog(double min_value, double max_value, QPainter& painter);
57  int CalculateTickPositionLinear(double tick, double min_value, double width,
58  double maxsize);
59  int CalculateTickPositionSqrt(double tick, double min_value, double width,
60  double maxsize);
61 
62  protected slots:
67  void SetCurrentColourmap(QVector<QRgb> colourmap);
68 
76  void UpdateColourbarAxis(double min_value, double max_value,
77  int scaling_function);
78 };
79 
80 #endif // DDT_DATAVISUALISATION_DDTWIDGETS_COLOURMAPWIDGET_HPP
DdtColourmapWidget
Definition: ddtColourmapWidget.hpp:29
DdtWidget
The DdtWidget class Use as wrapper class for new widgets.
Definition: ddtWidget.hpp:23
DdtColourmapWidget::~DdtColourmapWidget
virtual ~DdtColourmapWidget()
ddtWidget.hpp
imageHandling.hpp