Skip to content
Snippets Groups Projects
CompoundForm.h 1.5 KiB
Newer Older
  • Learn to ignore specific revisions
  • //  ************************************************************************************************
    //
    //  BornAgain: simulate and fit reflection and scattering
    //
    
    //! @file      GUI/View/SampleDesigner/CompoundForm.h
    //! @brief     Defines class CompoundForm
    
    //!
    //! @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_COMPOUNDFORM_H
    #define BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_COMPOUNDFORM_H
    
    #include <QFormLayout>
    
    class SampleEditorController;
    
    class CompoundItem;
    
    class ItemWithParticles;
    
    //! Form for editing a particle composition
    
    class CompoundForm : public QGroupBox {
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        CompoundForm(QWidget* parent, CompoundItem* compositionItem, SampleEditorController* ec,
                     bool allowRemove = true);
    
    
        void enableStructureEditing(bool b);
    
        CompoundItem* compositionItem() const;
    
        void onParticleAdded(ItemWithParticles* item);
    
        void onAboutToRemoveParticle(ItemWithParticles* item);
    
    private:
        QFormLayout* m_layout;
    
        CompoundItem* m_compositionItem;
    
        QAction* m_removeAction = nullptr;
        SampleEditorController* m_ec;
        QList<QWidget*> m_structureEditingWidgets;
    };
    
    
    #endif // BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_COMPOUNDFORM_H