Skip to content
Snippets Groups Projects
LayerOrientedSampleEditor.h 2.21 KiB
Newer Older
  • Learn to ignore specific revisions
  • //  ************************************************************************************************
    //
    //  BornAgain: simulate and fit reflection and scattering
    //
    
    //! @file      GUI/View/SampleDesigner/LayerOrientedSampleEditor.h
    
    //! @brief     Defines class LayerOrientedSampleEditor
    //!
    //! @homepage  http://www.bornagainproject.org
    //! @license   GNU General Public License v3 or higher (see COPYING)
    //! @copyright Forschungszentrum Jülich GmbH 2021
    //! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
    //
    //  ************************************************************************************************
    
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
    #ifndef BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_LAYERORIENTEDSAMPLEEDITOR_H
    #define BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_LAYERORIENTEDSAMPLEEDITOR_H
    
    #include "GUI/Model/Sample/SampleItem.h"
    
    #include <QMap>
    #include <QWidget>
    
    class MultiLayerItem;
    class QToolBar;
    class SampleEditorController;
    class MultiLayerForm;
    class QScrollArea;
    
    
    //! Sample editor with layer oriented presentation of a sample
    class LayerOrientedSampleEditor : public QWidget {
        Q_OBJECT
    public:
    
        LayerOrientedSampleEditor(QWidget* parent, ProjectDocument* document);
    
    
        void setCurrentSample(MultiLayerItem* multiLayerItem);
    
    
        void requestViewInRealSpace(SampleItem itemToShow);
    
        void aboutToRemoveItem(SampleItem item);
        void modified();
    
    private:
        void updateActionEnabling();
        void onShowInlineEditButtonsToggled(bool checked);
    
        void onUnitActionToggled();
    
    
        //! Create empty widget with a button for sample creation
    
        QWidget* createEmptyWidget();
    
    private:
        MultiLayerForm* m_currentMultiLayerWidget;
        QScrollArea* m_scrollArea;
        QToolBar* m_toolbar;
        QAction* m_undoAction; // dedicated to the current sample
        QAction* m_redoAction;
        QAction* m_showInlineEditButtonsAction;
    
        QAction* m_asAngstromAction;
    
        MultiLayerItem* m_currentMultiLayerItem = nullptr;
        QMap<MultiLayerItem*, SampleEditorController*> m_editControllers;
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
    #endif // BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_LAYERORIENTEDSAMPLEEDITOR_H