BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
MaskEditorCanvas.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Mask/MaskEditorCanvas.h
6 //! @brief Defines class MaskEditorCanvas
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_MASKEDITORCANVAS_H
16 #define BORNAGAIN_GUI_VIEW_MASK_MASKEDITORCANVAS_H
17 
19 #include <QWidget>
20 
21 class MaskGraphicsScene;
22 class MaskGraphicsView;
23 class SessionModel;
24 class QItemSelectionModel;
25 class QModelIndex;
27 class IntensityDataItem;
28 class PlotStatusLabel;
29 class IntensityDataItem;
30 
31 //! Painting widget for MaskEditor, contains graphics scene and graphics view
32 
33 class MaskEditorCanvas : public QWidget {
34  Q_OBJECT
35 public:
36  MaskEditorCanvas(QWidget* parent = nullptr);
37 
38  void setMaskContext(SessionModel* model, const QModelIndex& maskContainerIndex,
39  IntensityDataItem* intensityItem);
40 
41  void resetContext();
42 
43  void setSelectionModel(QItemSelectionModel* model);
44 
46 
47 signals:
48  void changeActivityRequest(MaskEditorFlags::Activity);
50 
51 public slots:
52  void onPresentationTypeRequest(MaskEditorFlags::PresentationType presentationType);
53  void onSavePlotRequest();
54  void onResetViewRequest();
55 
56 private:
57  bool isAxisRangeMatchData() const;
58  void setZoomToROI();
59 
65 };
66 
67 #endif // BORNAGAIN_GUI_VIEW_MASK_MASKEDITORCANVAS_H
Defines class MaskEditorFlags.
Painting widget for MaskEditor, contains graphics scene and graphics view.
void deleteSelectedRequest()
void onSavePlotRequest()
Saves plot into project directory.
MaskGraphicsView * m_view
bool isAxisRangeMatchData() const
Returns true if IntensityData is currently at 100% zoom level.
PlotStatusLabel * m_statusLabel
void changeActivityRequest(MaskEditorFlags::Activity)
MaskGraphicsScene * getScene()
void onPresentationTypeRequest(MaskEditorFlags::PresentationType presentationType)
MaskResultsPresenter * m_resultsPresenter
IntensityDataItem * m_intensityDataItem
void setSelectionModel(QItemSelectionModel *model)
MaskGraphicsScene * m_scene
void setMaskContext(SessionModel *model, const QModelIndex &maskContainerIndex, IntensityDataItem *intensityItem)
MaskEditorCanvas(QWidget *parent=nullptr)
Graphics scene for MaskEditorCanvas to draw masks on top of intensity data widgets.
Graphics view for MaskEditorCanvas.
Updates bin values inside IntensityData to display current mask state. Returns IntensityData to origi...
The PlotStatusLabel class shows status string as reported by DescriptedPlot in a frame....
Base class for a GUI data collection. A collection is e.g. all real data (RealDataModel)....
Definition: SessionModel.h:42