BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
FootprintItems.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Device/FootprintItems.cpp
6 //! @brief Implements FootprintItem 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 #include "Device/Beam/FootprintGauss.h"
17 #include "Device/Beam/FootprintSquare.h"
19 
20 std::unique_ptr<IFootprintFactor> FootprintNoneItem::createFootprint() const
21 {
22  return {};
23 }
24 
26 {
27  m_gaussianFootprintValue.init("Width ratio", "The ratio of beam and sample full widths", value,
28  Unit::unitless, 3, RealLimits::nonnegative(), "ratio");
29 }
30 
32 {
33  s.assertVersion(0);
34  Serialize::rwProperty(s, m_gaussianFootprintValue);
35 }
36 
37 std::unique_ptr<IFootprintFactor> FootprintGaussianItem::createFootprint() const
38 {
39  return std::make_unique<FootprintGauss>(m_gaussianFootprintValue);
40 }
41 
43 {
44  m_squareFootprintValue.init("Width ratio", "The ratio of beam and sample full widths", value,
45  Unit::unitless, 3, RealLimits::nonnegative(), "ratio");
46 }
47 
49 {
50  s.assertVersion(0);
51  Serialize::rwProperty(s, m_squareFootprintValue);
52 }
53 
54 std::unique_ptr<IFootprintFactor> FootprintSquareItem::createFootprint() const
55 {
56  return std::make_unique<FootprintSquare>(m_squareFootprintValue);
57 }
Declares FootprintItem classes.
Defines class Streamer.
@ unitless
FootprintGaussianItem(double value=0.0)
void serialize(Streamer &s) override
std::unique_ptr< IFootprintFactor > createFootprint() const override
std::unique_ptr< IFootprintFactor > createFootprint() const override
void serialize(Streamer &s) override
FootprintSquareItem(double value=0.0)
std::unique_ptr< IFootprintFactor > createFootprint() const override
Supports serialization to or deserialization from QXmlStream.
Definition: Streamer.h:36
void assertVersion(unsigned expectedVersion) const
As reader, throws DeserializationException unless the expected version is read. As writer,...
Definition: Streamer.cpp:26
void rwProperty(Streamer &s, DoubleProperty &d)