BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ParticleLayoutForm.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/SampleDesigner/ParticleLayoutForm.h
6 //! @brief Defines class ParticleLayoutForm
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_PARTICLELAYOUTFORM_H
16 #define BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_PARTICLELAYOUTFORM_H
17 
18 #include <QGroupBox>
19 #include <QList>
20 
21 class QAction;
23 class QFormLayout;
24 class ParticleLayoutItem;
25 class LayerForm;
26 class ItemWithParticles;
27 class DoubleSpinBox;
28 class LayerItem;
29 class GroupBoxCollapser;
30 
31 //! Form for editing a particle layout
32 class ParticleLayoutForm : public QGroupBox {
33  Q_OBJECT
34 public:
37 
38  void enableStructureEditing(bool b);
42 
43  //! Disable/enable total density property depending on type of interference function.
44  //!
45  //! E.g. 2-dimensional interference calculates density automatically, so
46  //! the property shown in the particle layout shall be disabled.
47  void updateDensityEnabling();
48 
49  //! Update the shown density value.
50  //!
51  //! This does not update any internal values, it only refreshes the shown value.
52  void updateDensityValue();
53 
54  void updateTitle(const LayerItem* layerItem);
55 
56 private:
57  QFormLayout* m_layout;
59  QAction* m_removeAction;
61  QList<QWidget*> m_structureEditingWidgets;
64 };
65 
66 #endif // BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_PARTICLELAYOUTFORM_H
SpinBox for DoubleDescriptors, supporting units.
Definition: DoubleSpinBox.h:22
Add-on to group boxes to make them collapsible.
Form for editing a layer.
Definition: LayerForm.h:29
Form for editing a particle layout.
void enableStructureEditing(bool b)
void updateDensityEnabling()
Disable/enable total density property depending on type of interference function.
QFormLayout * m_layout
void onParticleAdded(ItemWithParticles *item)
SampleEditorController * m_ec
void onAboutToRemoveParticle(ItemWithParticles *item)
void updateTitle(const LayerItem *layerItem)
ParticleLayoutForm(LayerForm *parent, ParticleLayoutItem *layoutItem, SampleEditorController *ec)
GroupBoxCollapser * m_collapser
void updateDensityValue()
Update the shown density value.
ParticleLayoutItem * m_layoutItem
ParticleLayoutItem * layoutItem() const
DoubleSpinBox * m_totalDensitySpinBox
QList< QWidget * > m_structureEditingWidgets
Class to modify a sample from the layer oriented sample editor.