BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
LayerOrientedSampleEditor.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/SampleDesigner/LayerOrientedSampleEditor.h
6 //! @brief Defines class LayerOrientedSampleEditor
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2021
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_LAYERORIENTEDSAMPLEEDITOR_H
16 #define BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_LAYERORIENTEDSAMPLEEDITOR_H
17 
19 #include <QMap>
20 #include <QWidget>
21 
22 class MultiLayerItem;
23 class QToolBar;
25 class MultiLayerForm;
26 class QScrollArea;
27 class SessionItem;
28 class ProjectDocument;
29 
30 //! Sample editor with layer oriented presentation of a sample
31 class LayerOrientedSampleEditor : public QWidget {
32  Q_OBJECT
33 public:
34  LayerOrientedSampleEditor(QWidget* parent, ProjectDocument* document);
35  ~LayerOrientedSampleEditor() override;
36 
37  void setCurrentSample(MultiLayerItem* sampleItem);
38 
39 signals:
43  void modified();
44 
45 private:
46  void updateActionEnabling();
47  void onShowInlineEditButtonsToggled(bool checked);
48  void onUnitActionToggled();
49 
50  void createLayerColors();
51 
52  //! Create empty widget with a button for sample creation
53  QWidget* createEmptyWidget();
54 
55 private:
57  QScrollArea* m_scrollArea;
58  QToolBar* m_toolbar;
59  QAction* m_undoAction; // dedicated to the current sample
60  QAction* m_redoAction;
64  QMap<MultiLayerItem*, SampleEditorController*> m_editControllers;
66 };
67 
68 
69 #endif // BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_LAYERORIENTEDSAMPLEEDITOR_H
Defines class SampleItem.
Sample editor with layer oriented presentation of a sample.
void setCurrentSample(MultiLayerItem *sampleItem)
void aboutToRemoveItem(SampleItem item)
QMap< MultiLayerItem *, SampleEditorController * > m_editControllers
LayerOrientedSampleEditor(QWidget *parent, ProjectDocument *document)
void onShowInlineEditButtonsToggled(bool checked)
void requestViewInRealSpace(SampleItem itemToShow)
QWidget * createEmptyWidget()
Create empty widget with a button for sample creation.
Form to present/edit a MultiLayer (sample)
Project document class handles all data related to the opened project (sample, job,...
Class to modify a sample from the layer oriented sample editor.
This can hold any item which belongs to a sample.
Definition: SampleItem.h:33
Base class for a GUI data item.
Definition: SessionItem.h:204