BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
LayerForm.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/SampleDesigner/LayerForm.h
6 //! @brief Defines class LayerForm
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_LAYERFORM_H
16 #define BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_LAYERFORM_H
17 
19 #include <QGroupBox>
20 #include <memory>
21 
22 class LayerItem;
24 class ParticleLayoutItem;
25 class GroupBoxCollapser;
26 class WidgetMoverButton;
27 
28 //! Form for editing a layer
29 class LayerForm : public QGroupBox {
30  Q_OBJECT
31 public:
32  LayerForm(QWidget* parent, LayerItem* layer, SampleEditorController* ec);
33 
34  void enableStructureEditing(bool b);
36  void onLayoutAdded(ParticleLayoutItem* layoutItem);
37  void onAboutToRemoveLayout(ParticleLayoutItem* layoutItem);
38  LayerItem* layerItem() const;
39  void updateTitle();
40  void expand();
41 
42 private:
43  void updateColor();
44 
45 private:
47  std::unique_ptr<FormLayouter> m_layouter;
49  QAction* m_removeAction;
50  int m_roughnessRow = -1;
51  int m_thicknessRow = -1;
53  QList<QWidget*> m_structureEditingWidgets;
55 };
56 
57 
58 #endif // BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_LAYERFORM_H
Defines classes FormLayouter.
Add-on to group boxes to make them collapsible.
Form for editing a layer.
Definition: LayerForm.h:29
GroupBoxCollapser * m_collapser
Definition: LayerForm.h:46
int m_thicknessRow
Definition: LayerForm.h:51
void updateColor()
Definition: LayerForm.cpp:114
QAction * m_removeAction
Definition: LayerForm.h:49
LayerItem * m_layer
Definition: LayerForm.h:48
void updateLayerPositionDependentElements()
Definition: LayerForm.cpp:132
void updateTitle()
Definition: LayerForm.cpp:120
void onAboutToRemoveLayout(ParticleLayoutItem *layoutItem)
Definition: LayerForm.cpp:179
void expand()
Definition: LayerForm.cpp:127
WidgetMoverButton * m_moveButton
Definition: LayerForm.h:54
std::unique_ptr< FormLayouter > m_layouter
Definition: LayerForm.h:47
SampleEditorController * m_ec
Definition: LayerForm.h:52
LayerForm(QWidget *parent, LayerItem *layer, SampleEditorController *ec)
Definition: LayerForm.cpp:31
LayerItem * layerItem() const
Definition: LayerForm.cpp:188
void enableStructureEditing(bool b)
Definition: LayerForm.cpp:103
void onLayoutAdded(ParticleLayoutItem *layoutItem)
Definition: LayerForm.cpp:171
QList< QWidget * > m_structureEditingWidgets
Definition: LayerForm.h:53
int m_roughnessRow
Definition: LayerForm.h:50
Class to modify a sample from the layer oriented sample editor.
Button to move a widget vertically in a layout.