BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
MaterialDataItems.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Models/MaterialDataItems.cpp
6 //! @brief Implements MaterialDataItems classes
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 
16 
17 MaterialDataItem::MaterialDataItem(const QString& modelType) : SessionItem(modelType)
18 {
19  setEditable(false); // empty label, non-editable
20 }
21 
22 // ------------------------------------------------------------------------------------------------
23 
24 const QString MaterialRefractiveDataItem::P_DELTA = "Delta";
25 const QString MaterialRefractiveDataItem::P_BETA = "Beta";
26 
28  : MaterialDataItem("MaterialRefractiveData")
29 {
30  addProperty(P_DELTA, 0.0)
31  ->setEditorType("ScientificDouble")
33  .setToolTip("Delta of refractive index (n = 1 - delta + i*beta)");
34  addProperty(P_BETA, 0.0)
35  ->setEditorType("ScientificDouble")
37  .setToolTip("Beta of refractive index (n = 1 - delta + i*beta)");
38 }
39 
40 // ------------------------------------------------------------------------------------------------
41 
42 const QString MaterialSLDDataItem::P_SLD_REAL = "SLD, real";
43 const QString MaterialSLDDataItem::P_SLD_IMAG = "SLD, imaginary";
44 
46 {
48  ->setEditorType("ScientificDouble")
50  .setToolTip("Real part of SLD (SLD = real - i*imag), AA^{-2}");
52  ->setEditorType("ScientificDouble")
54  .setToolTip("Imaginary part of SLD (SLD = real - i*imag), AA^{-2}");
55 }
Defines MaterialDataItems classes.
MaterialDataItem(const QString &modelType)
static const QString P_DELTA
static const QString P_BETA
static const QString P_SLD_REAL
static const QString P_SLD_IMAG
static RealLimits limitless()
Creates an object withoud bounds (default)
Definition: RealLimits.cpp:130
SessionItem * addProperty(const QString &name, const QVariant &variant)
Add new property item and register new tag.
SessionItem & setEditorType(const QString &editorType)
void setEditable(bool enabled)
SessionItem & setToolTip(const QString &tooltip)
SessionItem & setLimits(const RealLimits &value)