BornAgain  1.19.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 reflection and scattering
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_SAMPLE_PARTICLE_PARTICLECORESHELL_H
16 #define BORNAGAIN_SAMPLE_PARTICLE_PARTICLECORESHELL_H
17 
19 
20 class Particle;
21 
22 //! A particle with a core/shell geometry.
23 //! @ingroup samples
24 
25 class ParticleCoreShell : public IParticle {
26 public:
27  ParticleCoreShell(const Particle& shell, const Particle& core,
28  kvector_t relative_core_position = kvector_t(0.0, 0.0, 0.0));
30 
31  ParticleCoreShell* clone() const final;
32 
33  void accept(INodeVisitor* visitor) const final { visitor->visit(this); }
34 
35  SlicedParticle createSlicedParticle(ZLimits limits) const final;
36 
37  const Particle* coreParticle() const;
38 
39  const Particle* shellParticle() const;
40 
41  std::vector<const INode*> getChildren() const final;
42 
43 protected:
44  void addAndRegisterCore(const Particle& core, kvector_t relative_core_position);
45  void addAndRegisterShell(const Particle& shell);
47 
48  std::unique_ptr<Particle> m_shell;
49  std::unique_ptr<Particle> m_core;
50 };
51 
52 inline const Particle* ParticleCoreShell::coreParticle() const
53 {
54  return m_core.get();
55 }
56 
58 {
59  return m_shell.get();
60 }
61 
62 #endif // BORNAGAIN_SAMPLE_PARTICLE_PARTICLECORESHELL_H
Defines interface IParticle.
BasicVector3D< double > kvector_t
Definition: Vectors3D.h:21
Visitor interface to visit ISampleNode objects.
Definition: INodeVisitor.h:146
Abstract base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
Definition: IParticle.h:33
A particle with a core/shell geometry.
std::unique_ptr< Particle > m_shell
std::unique_ptr< Particle > m_core
std::vector< const INode * > getChildren() const final
Returns a vector of children.
void addAndRegisterShell(const Particle &shell)
void accept(INodeVisitor *visitor) const final
Calls the INodeVisitor's visit method.
SlicedParticle createSlicedParticle(ZLimits limits) const final
Creates a sliced form factor for this particle.
const Particle * shellParticle() const
void addAndRegisterCore(const Particle &core, kvector_t relative_core_position)
ParticleCoreShell * clone() const final
Returns a clone of this ISampleNode object.
const Particle * coreParticle() const
A particle with a form factor and refractive index.
Definition: Particle.h:24
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.
Definition: ZLimits.h:45
Definition: filesystem.h:81
Struct that contains information on a sliced particle.