BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ColorMapSceneAdaptor.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Mask/ColorMapSceneAdaptor.h
6 //! @brief Defines class ColorMapSceneAdaptor
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_VIEW_MASK_COLORMAPSCENEADAPTOR_H
16 #define BORNAGAIN_GUI_VIEW_MASK_COLORMAPSCENEADAPTOR_H
17 
19 
20 class ColorMap;
21 
22 //! Performs conversion of MaskItems coordinates between ColorMap and GraphicsScene.
23 
25  Q_OBJECT
26 
27 public:
29 
30  qreal toSceneX(qreal mask_x) const override;
31  qreal toSceneY(qreal mask_y) const override;
32  qreal fromSceneX(qreal scene_x) const override;
33  qreal fromSceneY(qreal scene_y) const override;
34 
35  void setColorMapPlot(ColorMap* plot);
36 
37  bool eventFilter(QObject* object, QEvent* event) override;
38 
39  //! Returns ColorMapPlot axes rectangle (at current zoom level) in scene coordinates
40  const QRectF& viewportRectangle() const override;
41 
42 private:
44 };
45 
46 #endif // BORNAGAIN_GUI_VIEW_MASK_COLORMAPSCENEADAPTOR_H
Defines interface class ISceneAdaptor.
Performs conversion of MaskItems coordinates between ColorMap and GraphicsScene.
void setColorMapPlot(ColorMap *plot)
qreal fromSceneX(qreal scene_x) const override
convert scene x-coordinate to native mask coordinate
qreal toSceneX(qreal mask_x) const override
convert native mask x-coordinate to scene coordinate
const QRectF & viewportRectangle() const override
Returns ColorMapPlot axes rectangle (at current zoom level) in scene coordinates.
bool eventFilter(QObject *object, QEvent *event) override
qreal toSceneY(qreal mask_y) const override
convert native mask y-coordinate to scene coordinate
qreal fromSceneY(qreal scene_y) const override
convert scene y-coordinate to native mask coordinate
The ColorMap class presents 2D intensity data from IntensityDataItem as color map.
Definition: ColorMap.h:36
Interface to adapt MaskItems coordinates (expressed in units of IntensityDataItem) to/from scene coor...
Definition: ISceneAdaptor.h:24