BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
MultiLayerForm.h
Go to the documentation of this file.
1
// ************************************************************************************************
2
//
3
// BornAgain: simulate and fit reflection and scattering
4
//
5
//! @file GUI/View/SampleDesigner/MultiLayerForm.h
6
//! @brief Defines class MultiLayerForm
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_MULTILAYERFORM_H
16
#define BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_MULTILAYERFORM_H
17
18
#include <QWidget>
19
20
class
MultiLayerItem
;
21
class
SampleEditorController
;
22
class
LayerItem
;
23
class
QVBoxLayout;
24
class
QPushButton;
25
class
LayerForm
;
26
27
//! Form to present/edit a MultiLayer (sample)
28
class
MultiLayerForm
:
public
QWidget {
29
Q_OBJECT
30
public
:
31
MultiLayerForm
(QWidget* parent,
MultiLayerItem
* sampleItem,
SampleEditorController
* ec);
32
33
//! Show or hide all buttons related to structure editing (like "add layer", "remove particle")
34
void
showInlineEditButtons
(
bool
b);
35
36
//! Create widgets for the new layer.
37
void
onLayerAdded
(
LayerItem
* layerItem);
38
39
//! Call this when a layerItem has been moved to a different position.
40
//!
41
//! This updates the item's position in the layout.
42
void
onLayerMoved
(
LayerItem
* layerItem);
43
44
//! Call this before removing (deleting) a LayerItem.
45
//!
46
//! Any widgets related to the item will be deleted or scheduled for later deletion.
47
void
onAboutToRemoveLayer
(
LayerItem
* layerItem);
48
49
void
updateRowVisibilities
();
50
51
//! Update the presented units in all contained widgets according to current settings.
52
void
updateUnits
();
53
54
void
ensureVisible
(QWidget* w);
55
56
//! Show values in Angstrom or nanometers
57
void
setUseAngstrom
(
bool
angstrom
);
58
bool
useAngstrom
()
const
;
59
60
//! Show values in radiants or degrees
61
void
setUseRadiant
(
bool
radiant
);
62
bool
useRadiant
()
const
;
63
64
//! Shows or hides the "Add Layer" buttons.
65
void
showAddLayerButtons
(
bool
show);
66
67
//! Search for the next LayerForm, starting from the given widget.
68
//!
69
//! The search starts with the given widget itself If it is a LayerForm, it is returned.
70
//! If no following LayerForm is found, nullptr is returned.
71
LayerForm
*
findNextLayerForm
(QWidget* w);
72
73
private
:
74
QVBoxLayout*
m_layout
;
75
MultiLayerItem
*
m_sampleItem
;
//!< Ptr is borrowed, don't delete
76
SampleEditorController
*
m_ec
;
//!< Ptr is borrowed, don't delete
77
bool
m_showInlineEditButtons
=
false
;
78
bool
m_useAngstrom
;
79
bool
m_useRadiant
;
80
QList<QPushButton*>
m_addLayerButtons
;
81
};
82
83
#endif
// BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_MULTILAYERFORM_H
Unit::angstrom
@ angstrom
Unit::radiant
@ radiant
LayerForm
Form for editing a layer.
Definition:
LayerForm.h:29
LayerItem
Definition:
LayerItem.h:36
MultiLayerForm
Form to present/edit a MultiLayer (sample)
Definition:
MultiLayerForm.h:28
MultiLayerForm::MultiLayerForm
MultiLayerForm(QWidget *parent, MultiLayerItem *sampleItem, SampleEditorController *ec)
Definition:
MultiLayerForm.cpp:55
MultiLayerForm::ensureVisible
void ensureVisible(QWidget *w)
Definition:
MultiLayerForm.cpp:248
MultiLayerForm::updateRowVisibilities
void updateRowVisibilities()
Definition:
MultiLayerForm.cpp:188
MultiLayerForm::setUseAngstrom
void setUseAngstrom(bool angstrom)
Show values in Angstrom or nanometers.
Definition:
MultiLayerForm.cpp:253
MultiLayerForm::findNextLayerForm
LayerForm * findNextLayerForm(QWidget *w)
Search for the next LayerForm, starting from the given widget.
Definition:
MultiLayerForm.cpp:282
MultiLayerForm::m_showInlineEditButtons
bool m_showInlineEditButtons
Definition:
MultiLayerForm.h:77
MultiLayerForm::m_useAngstrom
bool m_useAngstrom
Definition:
MultiLayerForm.h:78
MultiLayerForm::onLayerAdded
void onLayerAdded(LayerItem *layerItem)
Create widgets for the new layer.
Definition:
MultiLayerForm.cpp:114
MultiLayerForm::m_ec
SampleEditorController * m_ec
Ptr is borrowed, don't delete.
Definition:
MultiLayerForm.h:76
MultiLayerForm::m_layout
QVBoxLayout * m_layout
Definition:
MultiLayerForm.h:74
MultiLayerForm::m_sampleItem
MultiLayerItem * m_sampleItem
Ptr is borrowed, don't delete.
Definition:
MultiLayerForm.h:75
MultiLayerForm::updateUnits
void updateUnits()
Update the presented units in all contained widgets according to current settings.
Definition:
MultiLayerForm.cpp:212
MultiLayerForm::showAddLayerButtons
void showAddLayerButtons(bool show)
Shows or hides the "Add Layer" buttons.
Definition:
MultiLayerForm.cpp:275
MultiLayerForm::onAboutToRemoveLayer
void onAboutToRemoveLayer(LayerItem *layerItem)
Call this before removing (deleting) a LayerItem.
Definition:
MultiLayerForm.cpp:161
MultiLayerForm::m_addLayerButtons
QList< QPushButton * > m_addLayerButtons
Definition:
MultiLayerForm.h:80
MultiLayerForm::useRadiant
bool useRadiant() const
Definition:
MultiLayerForm.cpp:270
MultiLayerForm::showInlineEditButtons
void showInlineEditButtons(bool b)
Show or hide all buttons related to structure editing (like "add layer", "remove particle")
Definition:
MultiLayerForm.cpp:108
MultiLayerForm::setUseRadiant
void setUseRadiant(bool radiant)
Show values in radiants or degrees.
Definition:
MultiLayerForm.cpp:264
MultiLayerForm::m_useRadiant
bool m_useRadiant
Definition:
MultiLayerForm.h:79
MultiLayerForm::useAngstrom
bool useAngstrom() const
Definition:
MultiLayerForm.cpp:259
MultiLayerForm::onLayerMoved
void onLayerMoved(LayerItem *layerItem)
Call this when a layerItem has been moved to a different position.
Definition:
MultiLayerForm.cpp:128
MultiLayerItem
Definition:
MultiLayerItem.h:31
SampleEditorController
Class to modify a sample from the layer oriented sample editor.
Definition:
SampleEditorController.h:50
GUI
View
SampleDesigner
MultiLayerForm.h
Generated by
1.9.1