BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ColorMapUtils.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/IntensityDataWidgets/ColorMapUtils.h
6 //! @brief Defines ColorMapUtils namespace
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_COREGUI_VIEWS_INTENSITYDATAWIDGETS_COLORMAPUTILS_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_INTENSITYDATAWIDGETS_COLORMAPUTILS_H
17 
18 #include <QMap>
19 #include <QMargins>
20 #include <QString>
21 #include <qcustomplot.h>
22 
23 class IntensityDataItem;
24 class ColorMap;
25 
26 //! Provides few helper functions for ColorMapPlot.
27 
28 namespace ColorMapUtils {
29 
30 QCPColorGradient getGradient(const QString& gradientName);
31 QCPColorGradient itemGradient(const IntensityDataItem* item);
32 
33 //! Returns x-axis range.
34 QCPRange itemXrange(const IntensityDataItem* item);
35 
36 //! Returns x-axis vizible range (zoom).
37 QCPRange itemZoomX(const IntensityDataItem* item);
38 
39 //! Returns y-axis range.
40 QCPRange itemYrange(const IntensityDataItem* item);
41 
42 //! Returns y-axis vizible range (zoom).
43 QCPRange itemZoomY(const IntensityDataItem* item);
44 
45 //! Returns z-axis data range.
46 QCPRange itemDataRange(const IntensityDataItem* item);
47 
48 //! Returns z-axis visible range (zoom).
49 QCPRange itemDataZoom(const IntensityDataItem* item);
50 
51 void setLogz(QCPColorScale* scale, bool isLogz);
52 void setLogz(QCPAxis* axis, bool isLogz);
53 
54 //! Sets default margins for axes rectangle plot.
55 void setDefaultMargins(QCustomPlot* customPlot);
56 
57 } // namespace ColorMapUtils
58 
59 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_INTENSITYDATAWIDGETS_COLORMAPUTILS_H
The ColorMap class presents 2D intensity data from IntensityDataItem as color map.
Definition: ColorMap.h:36
Provides few helper functions for ColorMapPlot.
Definition: ColorMapUtils.h:28
QCPRange itemDataZoom(const IntensityDataItem *item)
Returns z-axis visible range (zoom).
QCPRange itemZoomY(const IntensityDataItem *item)
Returns y-axis vizible range (zoom).
QCPRange itemXrange(const IntensityDataItem *item)
Returns x-axis range.
QCPColorGradient getGradient(const QString &gradientName)
void setDefaultMargins(QCustomPlot *customPlot)
Sets default margins for axes rectangle plot.
QCPColorGradient itemGradient(const IntensityDataItem *item)
QCPRange itemYrange(const IntensityDataItem *item)
Returns y-axis range.
QCPRange itemDataRange(const IntensityDataItem *item)
Returns z-axis data range.
QCPRange itemZoomX(const IntensityDataItem *item)
Returns x-axis vizible range (zoom).
void setLogz(QCPColorScale *scale, bool isLogz)