BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ISample.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Scattering/ISample.h
6 //! @brief Defines interface class ISample.
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_SCATTERING_ISAMPLE_H
16 #define BORNAGAIN_CORE_SCATTERING_ISAMPLE_H
17 
18 #include "Base/Types/ICloneable.h"
19 #include "Param/Node/INode.h"
20 #include <vector>
21 
22 class Material;
23 
24 //! Pure virtual base class for sample components and properties related to scattering.
25 //! @ingroup samples_internal
26 
27 class ISample : public ICloneable, public INode
28 {
29 public:
30  ISample() = default;
31  ISample(const NodeMeta& meta, const std::vector<double>& PValues);
32 
33  //! Returns a clone of this ISample object.
34  ISample* clone() const override = 0;
35 
36  //! Returns nullptr, unless overwritten to return a specific material.
37  virtual const Material* material() const { return nullptr; }
38 
39  //! Returns set of unique materials contained in this ISample.
40  std::vector<const Material*> containedMaterials() const;
41 };
42 
43 #endif // BORNAGAIN_CORE_SCATTERING_ISAMPLE_H
Defines and implements the standard mix-in ICloneable.
Defines class INode.
Interface for polymorphic classes that should not be copied, except by explicit cloning.
Definition: ICloneable.h:25
Base class for tree-like structures containing parameterized objects.
Definition: INode.h:49
Pure virtual base class for sample components and properties related to scattering.
Definition: ISample.h:28
ISample()=default
virtual const Material * material() const
Returns nullptr, unless overwritten to return a specific material.
Definition: ISample.h:37
std::vector< const Material * > containedMaterials() const
Returns set of unique materials contained in this ISample.
Definition: ISample.cpp:23
ISample * clone() const override=0
Returns a clone of this ISample object.
A wrapper for underlying material implementation.
Definition: Material.h:29
Metadata of one model node.
Definition: INode.h:37