BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
DepthProbeInstrumentEditor.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Instrument/DepthProbeInstrumentEditor.cpp
6 //! @brief Implements class DepthProbeInstrumentEditor
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
24 #include <QGridLayout>
25 #include <QVBoxLayout>
26 
28  DepthProbeInstrumentItem* instrument)
29  : QWidget(parent)
30 {
31  ASSERT(instrument);
32  auto* layout = new QVBoxLayout(this);
33  layout->setContentsMargins(0, 0, 0, 0);
34 
35  auto* parametersGroupBox = new QGroupBox(this);
36  parametersGroupBox->setTitle("Parameters");
37  auto* vLayout = new QVBoxLayout(parametersGroupBox);
38  vLayout->setContentsMargins(30, 8, 0, 0);
39 
40  auto* m_wavelengthEditor =
42  this, instrument->beamItem()->wavelengthItem());
43  vLayout->addWidget(m_wavelengthEditor);
44 
45  auto* inclinationEditor =
46  new InclinationAnglesEditor(this, instrument->beamItem()->inclinationAngleItem());
47  vLayout->addWidget(inclinationEditor);
48 
49  auto* depthAxisEditor = new AxisPropertyEditor(this, "Depth axis", &instrument->zAxis());
50  vLayout->addWidget(depthAxisEditor);
51 
52  GroupBoxCollapser::installIntoGroupBox(parametersGroupBox);
53  layout->addWidget(parametersGroupBox);
54 
55  auto* polMatricesAnalysisEditor = new PolarizationAnalysisEditor(this, instrument);
56  layout->addWidget(polMatricesAnalysisEditor);
57 
58  layout->addStretch();
59 
60  connect(m_wavelengthEditor, &DistributionEditor::distributionChanged, this,
62  connect(inclinationEditor, &InclinationAnglesEditor::dataChanged, this,
64  connect(depthAxisEditor, &AxisPropertyEditor::dataChanged, this,
66  connect(polMatricesAnalysisEditor, &PolarizationAnalysisEditor::dataChanged, this,
68 }
Defines class AxisPropertyEditor.
Defines class BeamWavelengthItem.
Defines class DepthProbeInstrumentEditor.
A widget for selecting a distribution and setting its parameters.
Defines class GroupBoxCollapser.
Defines class InclinationAnglesEditor.
Defines class InstrumentItem and all its children.
Defines class PolarizationAnalysisEditor.
Defines class SphericalAxisEditor.
Use this to edit an AxisProperty.
DepthProbeInstrumentEditor(QWidget *parent, DepthProbeInstrumentItem *item)
SpecularBeamItem * beamItem() const override
DistributionSelector as above but contained in a GroupBox with a title and a button to open the distr...
void distributionChanged()
static GroupBoxCollapser * installIntoGroupBox(QGroupBox *groupBox, bool expanded=true)
Editor for the case where there is no single inclination angle.
Polarization analysis editor (beam polarization, analyzer properties) for instrument editors....
SpecularBeamInclinationItem * inclinationAngleItem() const override
Definition: BeamItems.cpp:151
configuration to control how the user can enter a mean value