BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
MaskEditor.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Mask/MaskEditor.h
6 //! @brief Defines class MaskEditor
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_MASKEDITOR_H
16 #define BORNAGAIN_GUI_VIEW_MASK_MASKEDITOR_H
17 
18 #include <QMainWindow>
19 #include <QModelIndex>
20 #include <QWidget>
21 
23 class MaskEditorActions;
24 class MaskEditorToolbar;
25 class MaskEditorCanvas;
26 class SessionModel;
27 class IntensityDataItem;
28 
29 //! Main class to draw masks on top of intensity data map
30 
31 class MaskEditor : public QMainWindow {
32  Q_OBJECT
33 public:
34  MaskEditor(QWidget* parent = nullptr);
35 
36 public slots:
37  //! Main method to setup context for mask editing
38  //! @par model The model which will hold all masks
39  //! @par maskContainerIndex Index of top level MaskContainerItem in the model to hold masks
40  //! @par intensityItem IntensityDataItem which will be used as background for Mask drawing
41  void setMaskContext(SessionModel* model, const QModelIndex& maskContainerIndex,
42  IntensityDataItem* intensityItem);
43 
44  void resetContext();
45 
47 
48  QList<QAction*> topToolbarActions();
49 
50 protected:
51  void contextMenuEvent(QContextMenuEvent* event) override;
52 
53 private:
54  void setup_connections();
55 
60 };
61 
62 #endif // BORNAGAIN_GUI_VIEW_MASK_MASKEDITOR_H
Defines actions for MaskEditor which are related to selected MaskItem (toggle mask value,...
Painting widget for MaskEditor, contains graphics scene and graphics view.
Tool widget for MaskEditor.
Main class to draw masks on top of intensity data map.
Main class to draw masks on top of intensity data map.
Definition: MaskEditor.h:31
MaskEditorCanvas * m_editorCanvas
Definition: MaskEditor.h:59
void resetContext()
Definition: MaskEditor.cpp:67
void onPropertyPanelRequest()
shows/hides right panel with properties
Definition: MaskEditor.cpp:74
QList< QAction * > topToolbarActions()
Returns list of actions intended for styled toolbar (on the top).
Definition: MaskEditor.cpp:87
MaskEditor(QWidget *parent=nullptr)
Definition: MaskEditor.cpp:27
MaskEditorToolbar * m_toolbar
Definition: MaskEditor.h:57
void setup_connections()
Definition: MaskEditor.cpp:92
MaskEditorActions * m_editorActions
Definition: MaskEditor.h:56
void setMaskContext(SessionModel *model, const QModelIndex &maskContainerIndex, IntensityDataItem *intensityItem)
Main method to setup context for mask editing.
Definition: MaskEditor.cpp:51
void contextMenuEvent(QContextMenuEvent *event) override
Context menu reimplemented to supress default menu.
Definition: MaskEditor.cpp:80
MaskEditorPropertyPanel * m_editorPropertyPanel
Definition: MaskEditor.h:58
Base class for a GUI data collection. A collection is e.g. all real data (RealDataModel)....
Definition: SessionModel.h:42