BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
BeamAngleItems.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Models/BeamAngleItems.cpp
6 //! @brief Implements class BeamAngleItems
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 #include "Base/Const/Units.h"
17 
19  : BeamDistributionItem("BeamAzimuthalAngle", m_show_mean)
20 {
21  register_distribution_group("Distribution extended group");
22 
24  valueItem->setLimits(RealLimits::limited(-90.0, 90.0));
25  valueItem->setDecimals(3);
26  valueItem->setValue(0.0);
27 
29 }
30 
31 //! Returns beam azimuthal angle. In the case of distribution applied, returns its mean.
32 
34 {
36 }
37 
39 {
40  return Units::deg;
41 }
42 
43 // ------------------------------------------------------------------------------------------------
44 
46  : BeamDistributionItem("BeamInclinationAngle", m_show_mean)
47 {
48  register_distribution_group("Distribution extended group");
49 
51  valueItem->setLimits(RealLimits::limited(0.0, 90.0));
52  valueItem->setDecimals(3);
53  valueItem->setValue(0.2);
54 
56 }
57 
58 //! Returns beam inclination angle. In the case of distribution applied, returns its mean.
59 
61 {
63 }
64 
66 {
67  return Units::deg;
68 }
Defines class BeamAngleItems.
Defines some unit conversion factors and other constants in namespace Units.
double azimuthalAngle() const
Returns beam azimuthal angle. In the case of distribution applied, returns its mean.
static const bool m_show_mean
double scaleFactor() const override
Scales the values provided by distribution (to perform deg->rad conversion in the case of AngleDistri...
The BeamDistributionItem handles wavelength, inclination and azimuthal parameter distribution for Bea...
void initDistributionItem(bool show_mean)
Propagates the value and limits stored in DistributionNone type into alls distributions.
static const QString P_DISTRIBUTION
void register_distribution_group(const QString &group_type)
virtual double meanValue() const
Returns mean value of the distribution.
double inclinationAngle() const
Returns beam inclination angle. In the case of distribution applied, returns its mean.
double scaleFactor() const override
Scales the values provided by distribution (to perform deg->rad conversion in the case of AngleDistri...
static const bool m_show_mean
static RealLimits limited(double left_bound_value, double right_bound_value)
Creates an object bounded from the left and right.
Definition: RealLimits.cpp:125
SessionItem & setDecimals(int n)
SessionItem * getGroupItem(const QString &groupName) const
Access subitem of group item.
bool setValue(QVariant value)
Set value, ensure that variant types match.
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.
SessionItem & setLimits(const RealLimits &value)
static const QString P_MEAN
static constexpr double deg
Definition: Units.h:46