BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
IPositionBuilder.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Realspace/IPositionBuilder.h
6 //! @brief Declares interface IPositionBuilder and subclasses
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_GUI_VIEW_REALSPACE_IPOSITIONBUILDER_H
16 #define BORNAGAIN_GUI_VIEW_REALSPACE_IPOSITIONBUILDER_H
17 
18 #include <memory>
19 #include <vector>
20 
21 class Interference1DLattice;
22 class Interference2DLattice;
23 class Interference2DParaCrystal;
24 class InterferenceFinite2DLattice;
25 class InterferenceRadialParaCrystal;
26 
28 public:
29  virtual ~IPositionBuilder();
30 
31  std::vector<std::vector<double>> generatePositions(double layer_size,
32  double density = 0.0) const;
33 
34 private:
35  virtual std::vector<std::vector<double>> generatePositionsImpl(double layer_size,
36  double density = 0.0) const = 0;
37  virtual double positionVariance() const = 0;
38 };
39 
40 //! The default position builder is used when no specific implementation exist for generating
41 //! the positions based on the interference function
42 //!
43 //! It always generates a single point at the origin
45 public:
48 
49 private:
50  std::vector<std::vector<double>> generatePositionsImpl(double layer_size,
51  double density = 0.0) const override;
52  double positionVariance() const override;
53 };
54 
56 public:
59 
60 private:
61  std::vector<std::vector<double>> generatePositionsImpl(double layer_size,
62  double density = 0.0) const override;
63  double positionVariance() const override;
64 };
65 
67 public:
68  Lattice1DPositionBuilder(const Interference1DLattice* p_iff);
70 
71 private:
72  std::vector<std::vector<double>> generatePositionsImpl(double layer_size,
73  double density = 0.0) const override;
74  double positionVariance() const override;
75  std::unique_ptr<Interference1DLattice> m_iff;
76 };
77 
79 public:
80  Lattice2DPositionBuilder(const Interference2DLattice* p_iff);
82 
83 private:
84  std::vector<std::vector<double>> generatePositionsImpl(double layer_size,
85  double density = 0.0) const override;
86  double positionVariance() const override;
87  std::unique_ptr<Interference2DLattice> m_iff;
88 };
89 
91 public:
92  ParaCrystal2DPositionBuilder(const Interference2DParaCrystal* p_iff);
94 
95 private:
96  std::vector<std::vector<double>> generatePositionsImpl(double layer_size,
97  double density = 0.0) const override;
98  double positionVariance() const override;
99  std::unique_ptr<Interference2DParaCrystal> m_iff;
100 };
101 
103 public:
104  Finite2DLatticePositionBuilder(const InterferenceFinite2DLattice* p_iff);
106 
107 private:
108  std::vector<std::vector<double>> generatePositionsImpl(double layer_size,
109  double density = 0.0) const override;
110  double positionVariance() const override;
111  std::unique_ptr<InterferenceFinite2DLattice> m_iff;
112 };
113 
115 public:
116  RadialParacrystalPositionBuilder(const InterferenceRadialParaCrystal* p_iff);
118 
119 private:
120  std::vector<std::vector<double>> generatePositionsImpl(double layer_size,
121  double density = 0.0) const override;
122  double positionVariance() const override;
123  std::unique_ptr<InterferenceRadialParaCrystal> m_iff;
124 };
125 
126 #endif // BORNAGAIN_GUI_VIEW_REALSPACE_IPOSITIONBUILDER_H
The default position builder is used when no specific implementation exist for generating the positio...
std::vector< std::vector< double > > generatePositionsImpl(double layer_size, double density=0.0) const override
double positionVariance() const override
~DefaultPositionBuilder() override
std::unique_ptr< InterferenceFinite2DLattice > m_iff
std::vector< std::vector< double > > generatePositionsImpl(double layer_size, double density=0.0) const override
~Finite2DLatticePositionBuilder() override
Finite2DLatticePositionBuilder(const InterferenceFinite2DLattice *p_iff)
double positionVariance() const override
virtual ~IPositionBuilder()
virtual std::vector< std::vector< double > > generatePositionsImpl(double layer_size, double density=0.0) const =0
std::vector< std::vector< double > > generatePositions(double layer_size, double density=0.0) const
virtual double positionVariance() const =0
Lattice1DPositionBuilder(const Interference1DLattice *p_iff)
std::unique_ptr< Interference1DLattice > m_iff
~Lattice1DPositionBuilder() override
std::vector< std::vector< double > > generatePositionsImpl(double layer_size, double density=0.0) const override
double positionVariance() const override
~Lattice2DPositionBuilder() override
Lattice2DPositionBuilder(const Interference2DLattice *p_iff)
std::unique_ptr< Interference2DLattice > m_iff
std::vector< std::vector< double > > generatePositionsImpl(double layer_size, double density=0.0) const override
double positionVariance() const override
std::unique_ptr< Interference2DParaCrystal > m_iff
double positionVariance() const override
std::vector< std::vector< double > > generatePositionsImpl(double layer_size, double density=0.0) const override
ParaCrystal2DPositionBuilder(const Interference2DParaCrystal *p_iff)
~ParaCrystal2DPositionBuilder() override
std::unique_ptr< InterferenceRadialParaCrystal > m_iff
RadialParacrystalPositionBuilder(const InterferenceRadialParaCrystal *p_iff)
std::vector< std::vector< double > > generatePositionsImpl(double layer_size, double density=0.0) const override
double positionVariance() const override
~RandomPositionBuilder() override
std::vector< std::vector< double > > generatePositionsImpl(double layer_size, double density=0.0) const override
double positionVariance() const override