BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ISpecularScan.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Core/Scan/ISpecularScan.h
6 //! @brief Declares and implements pure virtual class ISpecularScan.
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 
15 #ifndef BORNAGAIN_CORE_INSTRUMENT_ISPECULARSCAN_H
16 #define BORNAGAIN_CORE_INSTRUMENT_ISPECULARSCAN_H
17 
18 #include "Base/Types/ICloneable.h"
19 
20 #include <sstream>
21 #include <string>
22 #include <vector>
23 
24 class IAxis;
25 class IFootprintFactor;
27 
28 //! Pure virtual base class for all types of specular scans.
29 
30 class ISpecularScan : public ICloneable
31 {
32 public:
33  ISpecularScan* clone() const override = 0;
34 
35 #ifndef SWIG
36  //! Generates simulation elements for specular simulations
37  virtual std::vector<SpecularSimulationElement> generateSimulationElements() const = 0;
38 
39  //! Returns coordinate axis assigned to the data holder
40  virtual const IAxis* coordinateAxis() const = 0;
41 
42  //! Returns IFootprintFactor object pointer
43  virtual const IFootprintFactor* footprintFactor() const = 0;
44 
45  //! Returns footprint correction factor for a range of simulation elements of size _n_elements_
46  //! and starting from element with index _i_.
47  virtual std::vector<double> footprint(size_t i, size_t n_elements) const = 0;
48 
49  //! Returns the number of simulation elements
50  virtual size_t numberOfSimulationElements() const = 0;
51 
52  //! Returns intensity vector corresponding to convolution of given simulation elements
53  virtual std::vector<double>
54  createIntensities(const std::vector<SpecularSimulationElement>& sim_elements) const = 0;
55 
56  //! Print scan definition in python format
57  virtual std::string print() const = 0;
58 #endif // SWIG
59 };
60 
61 inline std::ostream& operator<<(std::ostream& os, const ISpecularScan& scan)
62 {
63  return os << scan.print();
64 }
65 #endif // BORNAGAIN_CORE_INSTRUMENT_ISPECULARSCAN_H
Defines and implements the standard mix-in ICloneable.
std::ostream & operator<<(std::ostream &os, const BasicVector3D< T > &a)
Output to stream.
Interface for one-dimensional axes.
Definition: IAxis.h:25
Interface for polymorphic classes that should not be copied, except by explicit cloning.
Definition: ICloneable.h:25
Abstract base for classes that calculate the beam footprint factor.
Pure virtual base class for all types of specular scans.
Definition: ISpecularScan.h:31
virtual std::vector< SpecularSimulationElement > generateSimulationElements() const =0
Generates simulation elements for specular simulations.
virtual std::vector< double > footprint(size_t i, size_t n_elements) const =0
Returns footprint correction factor for a range of simulation elements of size n_elements and startin...
virtual const IAxis * coordinateAxis() const =0
Returns coordinate axis assigned to the data holder.
virtual const IFootprintFactor * footprintFactor() const =0
Returns IFootprintFactor object pointer.
virtual std::string print() const =0
Print scan definition in python format.
ISpecularScan * clone() const override=0
virtual std::vector< double > createIntensities(const std::vector< SpecularSimulationElement > &sim_elements) const =0
Returns intensity vector corresponding to convolution of given simulation elements.
virtual size_t numberOfSimulationElements() const =0
Returns the number of simulation elements.
Data stucture containing both input and output of a single image pixel for specular simulation.