BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
MaskGraphicsProxy.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Mask/MaskGraphicsProxy.h
6 //! @brief Defines class MaskGraphicsProxy
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_MASKGRAPHICSPROXY_H
16 #define BORNAGAIN_GUI_VIEW_MASK_MASKGRAPHICSPROXY_H
17 
19 #include <QGraphicsProxyWidget>
20 
21 class SessionItem;
22 class ISceneAdaptor;
24 class ColorMap;
25 class IntensityDataItem;
26 
27 //! Graphics proxy to place QWidget inside QGraphicsScene, used by MaskEditorCanvas.
28 
29 class MaskGraphicsProxy : public QGraphicsProxyWidget {
30  Q_OBJECT
31 
32 public:
34  ~MaskGraphicsProxy() override;
35 
36  int type() const override { return MaskEditorHelper::MASKGRAPHICSPROXY; }
37 
39  void setSceneAdaptor(ISceneAdaptor* sceneAdaptor);
40  void setInZoomMode(bool value);
41 
42  ColorMap* colorMap();
43 
44 protected:
45  void mousePressEvent(QGraphicsSceneMouseEvent* event) override;
46  void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override;
47  void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override;
48  void wheelEvent(QGraphicsSceneWheelEvent* event) override;
49 
50 private:
54 };
55 
56 #endif // BORNAGAIN_GUI_VIEW_MASK_MASKGRAPHICSPROXY_H
Defines class MaskEditorHelper.
Performs conversion of MaskItems coordinates between ColorMap and GraphicsScene.
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
Graphics proxy to place QWidget inside QGraphicsScene, used by MaskEditorCanvas.
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
void setIntensityItem(IntensityDataItem *item)
int type() const override
void wheelEvent(QGraphicsSceneWheelEvent *event) override
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
~MaskGraphicsProxy() override
ColorMapSceneAdaptor * m_sceneAdaptor
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
void setInZoomMode(bool value)
Sets widget to zoom mode, when signals (zoom wheel, mouse clicks) are send down to ColorMap plot....
void setSceneAdaptor(ISceneAdaptor *sceneAdaptor)
Base class for a GUI data item.
Definition: SessionItem.h:204