BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ParticleCoreShell.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Particle/ParticleCoreShell.h
6 //! @brief Defines ParticleCoreShell.
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_PARTICLE_PARTICLECORESHELL_H
16 #define BORNAGAIN_CORE_PARTICLE_PARTICLECORESHELL_H
17 
19 
20 class Particle;
21 
22 //! A particle with a core/shell geometry.
23 //! @ingroup samples
24 
26 {
27 public:
28  ParticleCoreShell(const Particle& shell, const Particle& core,
29  kvector_t relative_core_position = kvector_t(0.0, 0.0, 0.0));
31 
32  ParticleCoreShell* clone() const override final;
33 
34  void accept(INodeVisitor* visitor) const override final { visitor->visit(this); }
35 
36  SlicedParticle createSlicedParticle(ZLimits limits) const override final;
37 
38  const Particle* coreParticle() const;
39 
40  const Particle* shellParticle() const;
41 
42  std::vector<const INode*> getChildren() const override final;
43 
44 protected:
45  void addAndRegisterCore(const Particle& core, kvector_t relative_core_position);
46  void addAndRegisterShell(const Particle& shell);
48 
49  std::unique_ptr<Particle> mp_shell;
50  std::unique_ptr<Particle> mp_core;
51 };
52 
53 inline const Particle* ParticleCoreShell::coreParticle() const
54 {
55  return mp_core.get();
56 }
57 
59 {
60  return mp_shell.get();
61 }
62 
63 #endif // BORNAGAIN_CORE_PARTICLE_PARTICLECORESHELL_H
Defines interface IParticle.
BasicVector3D< double > kvector_t
Definition: Vectors3D.h:21
Visitor interface to visit ISample objects.
Definition: INodeVisitor.h:149
Pure virtual base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
Definition: IParticle.h:33
A particle with a core/shell geometry.
std::vector< const INode * > getChildren() const override final
Returns a vector of children (const).
void addAndRegisterShell(const Particle &shell)
ParticleCoreShell * clone() const override final
Returns a clone of this ISample object.
void accept(INodeVisitor *visitor) const override final
Calls the INodeVisitor's visit method.
const Particle * shellParticle() const
void addAndRegisterCore(const Particle &core, kvector_t relative_core_position)
SlicedParticle createSlicedParticle(ZLimits limits) const override final
Creates a sliced form factor for this particle.
std::unique_ptr< Particle > mp_shell
const Particle * coreParticle() const
std::unique_ptr< Particle > mp_core
A particle with a form factor and refractive index.
Definition: Particle.h:26
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.
Definition: ZLimits.h:41
Struct that contains information on a sliced particle.