BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ResolutionFunctionItems.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Device/ResolutionFunctionItems.h
6 //! @brief Defines 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 2022
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_MODEL_DEVICE_RESOLUTIONFUNCTIONITEMS_H
16 #define BORNAGAIN_GUI_MODEL_DEVICE_RESOLUTIONFUNCTIONITEMS_H
17 
19 #include <memory>
20 #include <variant>
21 
22 class IResolutionFunction2D;
23 class Streamer;
24 
26 public:
27  virtual ~ResolutionFunctionItem() = default;
28 
29  virtual std::unique_ptr<IResolutionFunction2D>
30  createResolutionFunction(double scale = 1.0) const = 0;
31 
32  //! Set the unit of the distributed value
33  virtual void setUnit(const std::variant<QString, Unit>&) {}
34  virtual void serialize(Streamer&){};
35 };
36 
38 public:
39  std::unique_ptr<IResolutionFunction2D>
40  createResolutionFunction(double scale = 1.0) const override;
41 };
42 
44 public:
46  std::unique_ptr<IResolutionFunction2D>
47  createResolutionFunction(double scale = 1.0) const override;
48 
49  void setUnit(const std::variant<QString, Unit>& unit) override;
50  void serialize(Streamer& s) override;
51 
52  DOUBLE_PROPERTY(sigmaX, SigmaX);
53  DOUBLE_PROPERTY(sigmaY, SigmaY);
54 };
55 
56 #endif // BORNAGAIN_GUI_MODEL_DEVICE_RESOLUTIONFUNCTIONITEMS_H
Defines class DoubleProperty.
void setUnit(const std::variant< QString, Unit > &unit) override
Set the unit of the distributed value.
std::unique_ptr< IResolutionFunction2D > createResolutionFunction(double scale=1.0) const override
virtual ~ResolutionFunctionItem()=default
virtual void serialize(Streamer &)
virtual std::unique_ptr< IResolutionFunction2D > createResolutionFunction(double scale=1.0) const =0
virtual void setUnit(const std::variant< QString, Unit > &)
Set the unit of the distributed value.
std::unique_ptr< IResolutionFunction2D > createResolutionFunction(double scale=1.0) const override
Supports serialization to or deserialization from QXmlStream.
Definition: Streamer.h:36