BornAgain  1.19.0
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/coregui/Views/MaskWidgets/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_COREGUI_VIEWS_MASKWIDGETS_COLORMAPSCENEADAPTOR_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_MASKWIDGETS_COLORMAPSCENEADAPTOR_H
17 
19 class ColorMap;
20 
21 //! Performs conversion of MaskItems coordinates between ColorMap and GraphicsScene.
22 
24  Q_OBJECT
25 
26 public:
28 
29  qreal toSceneX(qreal mask_x) const;
30  qreal toSceneY(qreal mask_y) const;
31  qreal fromSceneX(qreal scene_x) const;
32  qreal fromSceneY(qreal scene_y) const;
33 
34  void setColorMapPlot(ColorMap* plot);
35 
36  bool eventFilter(QObject* object, QEvent* event);
37 
38  //! returns ColorMapPlot axes rectangle (at current zoom level) in scene coordinates
39  const QRectF& viewportRectangle() const;
40 
41 private:
43 };
44 
45 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_MASKWIDGETS_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
convert scene x-coordinate to native mask coordinate
qreal fromSceneY(qreal scene_y) const
convert scene y-coordinate to native mask coordinate
const QRectF & viewportRectangle() const
returns ColorMapPlot axes rectangle (at current zoom level) in scene coordinates
qreal toSceneX(qreal mask_x) const
convert native mask x-coordinate to scene coordinate
bool eventFilter(QObject *object, QEvent *event)
qreal toSceneY(qreal mask_y) const
convert native mask y-coordinate to scene 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