BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ILayout.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Correlations/ILayout.h
6 //! @brief Defines and implements interface class ILayout.
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_CORRELATIONS_ILAYOUT_H
16 #define BORNAGAIN_CORE_CORRELATIONS_ILAYOUT_H
17 
20 
21 class IAbstractParticle;
23 
24 //! Pure virtual interface class to equip a sample layer with scattering properties.
25 //! Currently only inherited by ParticleLayout; in the future also by domain structure.
26 //!
27 //! @ingroup samples_internal
28 
29 // NOTE: When domain structures are implemented, this interface would probably undergo
30 // major changes, because a domain layout would not contain particles
31 class ILayout : public ISample
32 {
33 public:
34  ILayout();
35  virtual ~ILayout();
36 
37  virtual ILayout* clone() const = 0;
38  virtual void accept(INodeVisitor* visitor) const = 0;
39 
40  //! Returns information on all particles (type and abundance)
41  //! and generates new particles if an IAbstractParticle denotes a collection
43 
44  //! Returns the interference function
45  virtual const IInterferenceFunction* interferenceFunction() const = 0;
46 
47  /// Get total abundance of all particles
48  virtual double getTotalAbundance() const = 0;
49 
50  //! Returns surface density of all particles
51  virtual double totalParticleSurfaceDensity() const = 0;
52 
53  //! Sets surface density of all particles
54  virtual void setTotalParticleSurfaceDensity(double particle_density) = 0;
55 
56  //! Returns the relative weight of this layout
57  double weight() const { return m_weight; }
58 
59  //! Sets the relative weight of this layout
60  void setWeight(double weight) { m_weight = weight; }
61 
62 protected:
63  double m_weight;
64 };
65 
66 #endif // BORNAGAIN_CORE_CORRELATIONS_ILAYOUT_H
Defines interface class ISample.
Defines and implements template class SafePointerVector.
Interface for a generic particle.
Pure virtual base class of interference functions.
Pure virtual interface class to equip a sample layer with scattering properties.
Definition: ILayout.h:32
void setWeight(double weight)
Sets the relative weight of this layout.
Definition: ILayout.h:60
double m_weight
Definition: ILayout.h:63
virtual void accept(INodeVisitor *visitor) const =0
Calls the INodeVisitor's visit method.
virtual const IInterferenceFunction * interferenceFunction() const =0
Returns the interference function.
virtual double getTotalAbundance() const =0
Get total abundance of all particles.
virtual SafePointerVector< IParticle > particles() const =0
Returns information on all particles (type and abundance) and generates new particles if an IAbstract...
virtual double totalParticleSurfaceDensity() const =0
Returns surface density of all particles.
virtual ~ILayout()
virtual void setTotalParticleSurfaceDensity(double particle_density)=0
Sets surface density of all particles.
virtual ILayout * clone() const =0
Returns a clone of this ISample object.
double weight() const
Returns the relative weight of this layout.
Definition: ILayout.h:57
ILayout()
Definition: ILayout.cpp:17
Visitor interface to visit ISample objects.
Definition: INodeVisitor.h:149
Pure virtual base class for sample components and properties related to scattering.
Definition: ISample.h:28
A vector of pointers, owned by *this, with methods to handle them safely.