BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
MaskResultsPresenter.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Mask/MaskResultsPresenter.h
6 //! @brief Defines class MaskResultsPresenter
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_MASKRESULTSPRESENTER_H
16 #define BORNAGAIN_GUI_VIEW_MASK_MASKRESULTSPRESENTER_H
17 
19 #include <QModelIndex>
20 #include <QObject>
21 #include <memory>
22 
23 class SessionModel;
24 class IntensityDataItem;
25 class Datafield;
26 
27 //! Updates bin values inside IntensityData to display current mask state. Returns IntensityData
28 //! to original state when requested.
29 
30 class MaskResultsPresenter : public QObject {
31 public:
32  MaskResultsPresenter(QWidget* parent = nullptr);
33 
34  void setMaskContext(SessionModel* maskModel, const QModelIndex& maskContainerIndex,
35  IntensityDataItem* intensityItem);
36 
37  void resetContext();
38 
39  void updatePresenter(MaskEditorFlags::PresentationType presentationType);
40 
41 private:
42  void setShowMaskMode();
43  void setOriginalMode();
44  void backup_data();
45  Datafield* createMaskPresentation() const;
46 
48  QModelIndex m_maskContainerIndex;
50  std::unique_ptr<Datafield> m_dataBackup;
52 };
53 
54 #endif // BORNAGAIN_GUI_VIEW_MASK_MASKRESULTSPRESENTER_H
Defines class MaskEditorFlags.
Updates bin values inside IntensityData to display current mask state. Returns IntensityData to origi...
std::unique_ptr< Datafield > m_dataBackup
void setMaskContext(SessionModel *maskModel, const QModelIndex &maskContainerIndex, IntensityDataItem *intensityItem)
void updatePresenter(MaskEditorFlags::PresentationType presentationType)
void setShowMaskMode()
Update IntensityDataItem in SessionModel to represent masked areas. Corresponding bins of Datafield w...
Datafield * createMaskPresentation() const
Constructs Datafield which contains original intensity data except masked areas, and areas outside of...
IntensityDataItem * m_intensityDataItem
MaskResultsPresenter(QWidget *parent=nullptr)
void setOriginalMode()
Restores original state of IntensityDataItem.
Base class for a GUI data collection. A collection is e.g. all real data (RealDataModel)....
Definition: SessionModel.h:42