BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Particle3DContainer.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/RealSpaceWidgets/Particle3DContainer.h
6 //! @brief Implements namespace TransformTo3D
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_COREGUI_VIEWS_REALSPACEWIDGETS_PARTICLE3DCONTAINER_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_REALSPACEWIDGETS_PARTICLE3DCONTAINER_H
17 
18 #include <QString>
19 #include <memory>
20 #include <vector>
21 
22 namespace RealSpace {
23 namespace Particles {
24 class Particle;
25 }
26 } // namespace RealSpace
27 
29 public:
31  Particle3DContainer(const Particle3DContainer& other); // copy constructor
32  Particle3DContainer& operator=(const Particle3DContainer& rhs); // copy assignment
33  ~Particle3DContainer() noexcept;
34 
35  Particle3DContainer(Particle3DContainer&& other) noexcept; // move constructor
36  Particle3DContainer& operator=(Particle3DContainer&& other) noexcept; // move assignment
37 
38  void clearContainer();
39 
40  size_t containerSize() const { return m_containerParticles.size(); }
41  double cumulativeAbundance() const { return m_cumulativeAbundance; }
42  const QString particleType() const { return m_containerType; }
43  bool particle3DBlend(const size_t& index) const { return m_containerParticlesBlend.at(index); }
44 
45  void addParticle(RealSpace::Particles::Particle* particle3D, bool blend);
47  void setParticleType(QString particleType);
48 
49  std::unique_ptr<RealSpace::Particles::Particle> createParticle(const size_t& index) const;
50 
51 private:
52  std::vector<RealSpace::Particles::Particle*> m_containerParticles;
53  // Contains the constituents of the 3D Particle (e.g. core and shell of a ParticleCoreShell)
55  QString m_containerType; // type of 3D Particle e.g. ParticleType, ParticleCompositionType etc.
56  std::vector<bool> m_containerParticlesBlend;
57 };
58 
59 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_REALSPACEWIDGETS_PARTICLE3DCONTAINER_H
std::vector< RealSpace::Particles::Particle * > m_containerParticles
double cumulativeAbundance() const
void setCumulativeAbundance(double cumulativeAbundance)
std::unique_ptr< RealSpace::Particles::Particle > createParticle(const size_t &index) const
const QString particleType() const
void addParticle(RealSpace::Particles::Particle *particle3D, bool blend)
size_t containerSize() const
void setParticleType(QString particleType)
Particle3DContainer & operator=(const Particle3DContainer &rhs)
bool particle3DBlend(const size_t &index) const
std::vector< bool > m_containerParticlesBlend
A particle with a form factor and refractive index.
Definition: Particle.h:24