Skip to content
Snippets Groups Projects
CoreAndShellForm.h 1.78 KiB
Newer Older
  • Learn to ignore specific revisions
  • //  ************************************************************************************************
    //
    //  BornAgain: simulate and fit reflection and scattering
    //
    
    //! @file      GUI/View/SampleDesigner/CoreAndShellForm.h
    //! @brief     Defines class CoreAndShellForm
    
    //!
    //! @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)
    //
    //  ************************************************************************************************
    
    
    #ifndef BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_COREANDSHELLFORM_H
    #define BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_COREANDSHELLFORM_H
    
    Mikhail Svechnikov's avatar
    Mikhail Svechnikov committed
    #include <QComboBox>
    
    #include <QGroupBox>
    #include <memory>
    
    
    class FormLayouter;
    
    class CoreAndShellItem;
    
    class SampleEditorController;
    
    
    //! Form for editing a core/shell particle
    
    class CoreAndShellForm : public QGroupBox {
    
        CoreAndShellForm(QWidget* parent, CoreAndShellItem* item, SampleEditorController* ec,
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
                         bool allowRemove = true);
    
    
        void enableStructureEditing(bool b);
    
        CoreAndShellItem* coreShellItem() const;
    
        void createCoreWidgets();
        void createShellWidgets();
    
    
    private:
        void onCoreComboChanged();
        void onShellComboChanged();
    
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        void showCoreInRealspace();
        void showShellInRealspace();
    
        CoreAndShellItem* m_item;
    
        QAction* m_removeAction = nullptr;
        SampleEditorController* m_ec;
        struct Location {
            std::unique_ptr<FormLayouter> layouter;
    
            QComboBox* formfactorCombo = nullptr;
    
            GroupBoxCollapser* collapser = nullptr;
        };
        Location core;
        Location shell;
    };
    
    
    
    #endif // BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_COREANDSHELLFORM_H