BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ResolutionFunctionItems.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Models/ResolutionFunctionItems.cpp
6 //! @brief Implements family of ResolutionFunctionItem
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 
17 
19 
20 /* --------------------------------------------------------------------------------------------- */
21 
23  : ResolutionFunctionItem("ResolutionFunctionNone")
24 {
25 }
26 
27 std::unique_ptr<IResolutionFunction2D>
29 {
30  return std::unique_ptr<IResolutionFunction2D>();
31 }
32 
33 /* --------------------------------------------------------------------------------------------- */
34 
35 const QString ResolutionFunction2DGaussianItem::P_SIGMA_X = QString::fromStdString("SigmaX");
36 const QString ResolutionFunction2DGaussianItem::P_SIGMA_Y = QString::fromStdString("SigmaY");
37 
39  : ResolutionFunctionItem("ResolutionFunction2DGaussian")
40 {
41  addProperty(P_SIGMA_X, 0.02)
43  .setDecimals(3)
44  .setToolTip("Resolution along horizontal axis (in detector units)");
45  addProperty(P_SIGMA_Y, 0.02)
47  .setDecimals(3)
48  .setToolTip("Resolution along vertical axis (in detector units)");
49 }
50 
51 std::unique_ptr<IResolutionFunction2D>
53 {
54  return std::make_unique<ResolutionFunction2DGaussian>(
55  scale * getItemValue(P_SIGMA_X).toDouble(), scale * getItemValue(P_SIGMA_Y).toDouble());
56 }
Defines class ResolutionFunction2DGaussian.
Defines family of ResolutionFunctionItem.
static RealLimits lowerLimited(double bound_value)
Creates an object bounded from the left.
Definition: RealLimits.cpp:105
std::unique_ptr< IResolutionFunction2D > createResolutionFunction(double scale=1.0) const
ResolutionFunctionItem(const QString &name)
std::unique_ptr< IResolutionFunction2D > createResolutionFunction(double scale=1.0) const
SessionItem * addProperty(const QString &name, const QVariant &variant)
Add new property item and register new tag.
SessionItem & setDecimals(int n)
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.
SessionItem & setToolTip(const QString &tooltip)
SessionItem & setLimits(const RealLimits &value)
QString const & name(EShape k)
Definition: particles.cpp:21