BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Particle3DContainer Class Reference

Public Member Functions

 Particle3DContainer ()
 
 Particle3DContainer (const Particle3DContainer &other)
 
 Particle3DContainer (Particle3DContainer &&other) noexcept
 
 ~Particle3DContainer () noexcept
 
void addParticle (RealSpace::Particles::Particle *particle3D, bool blend)
 
void clearContainer ()
 
size_t containerSize () const
 
std::unique_ptr< RealSpace::Particles::ParticlecreateParticle (const size_t &index) const
 
double cumulativeAbundance () const
 
Particle3DContaineroperator= (const Particle3DContainer &rhs)
 
Particle3DContaineroperator= (Particle3DContainer &&other) noexcept
 
bool particle3DBlend (const size_t &index) const
 
const QString particleType () const
 
void setCumulativeAbundance (double cumulativeAbundance)
 
void setParticleType (QString particleType)
 

Private Attributes

std::vector< RealSpace::Particles::Particle * > m_containerParticles
 
std::vector< bool > m_containerParticlesBlend
 
QString m_containerType
 
double m_cumulativeAbundance
 

Detailed Description

Definition at line 28 of file Particle3DContainer.h.

Constructor & Destructor Documentation

◆ Particle3DContainer() [1/3]

Particle3DContainer::Particle3DContainer ( )
inline

Definition at line 30 of file Particle3DContainer.h.

◆ Particle3DContainer() [2/3]

Particle3DContainer::Particle3DContainer ( const Particle3DContainer other)

Definition at line 19 of file Particle3DContainer.cpp.

21 {
22  m_containerParticles.resize(other.m_containerParticles.size());
23  for (size_t i = 0; i < m_containerParticles.size(); ++i)
26 
28  for (size_t i = 0; i < m_containerParticlesBlend.size(); ++i)
30 }
std::vector< RealSpace::Particles::Particle * > m_containerParticles
std::vector< bool > m_containerParticlesBlend

References m_containerParticles, and m_containerParticlesBlend.

◆ ~Particle3DContainer()

Particle3DContainer::~Particle3DContainer ( )
noexcept

Definition at line 53 of file Particle3DContainer.cpp.

54 {
56 }

References clearContainer().

Here is the call graph for this function:

◆ Particle3DContainer() [3/3]

Particle3DContainer::Particle3DContainer ( Particle3DContainer &&  other)
noexcept

Definition at line 59 of file Particle3DContainer.cpp.

60  : m_containerParticles(std::move(other.m_containerParticles))
62  , m_containerType(std::move(other.m_containerType))
64 {
65 }

Member Function Documentation

◆ addParticle()

◆ clearContainer()

void Particle3DContainer::clearContainer ( )

Definition at line 80 of file Particle3DContainer.cpp.

81 {
82  for (auto it = m_containerParticles.begin(); it != m_containerParticles.end(); ++it)
83  delete (*it);
84 
85  m_containerParticles.clear();
87 }

References m_containerParticles, and m_containerParticlesBlend.

Referenced by ~Particle3DContainer(), and operator=().

◆ containerSize()

◆ createParticle()

std::unique_ptr< RealSpace::Particles::Particle > Particle3DContainer::createParticle ( const size_t &  index) const

Definition at line 106 of file Particle3DContainer.cpp.

107 {
108  auto particle = new RealSpace::Particles::Particle(*m_containerParticles.at(index));
109  return std::unique_ptr<RealSpace::Particles::Particle>(particle);
110 }
static const Material Particle

References m_containerParticles, and refMat::Particle.

Referenced by RealSpaceBuilderUtils::particleComposition3DContainer(), RealSpaceMesoCrystal::populateMesoCrystal(), and RealSpaceBuilder::populateParticleFromParticle3DContainer().

◆ cumulativeAbundance()

double Particle3DContainer::cumulativeAbundance ( ) const
inline

◆ operator=() [1/2]

Particle3DContainer & Particle3DContainer::operator= ( const Particle3DContainer rhs)

Definition at line 33 of file Particle3DContainer.cpp.

34 {
35  if (this != &rhs) {
37  m_containerParticles.resize(rhs.containerSize());
38  for (size_t i = 0; i < m_containerParticles.size(); ++i)
41 
44 
46  for (size_t i = 0; i < m_containerParticlesBlend.size(); ++i)
48  }
49  return *this;
50 }
size_t containerSize() const

References clearContainer(), containerSize(), m_containerParticles, m_containerParticlesBlend, m_containerType, and m_cumulativeAbundance.

Here is the call graph for this function:

◆ operator=() [2/2]

Particle3DContainer & Particle3DContainer::operator= ( Particle3DContainer &&  other)
noexcept

Definition at line 68 of file Particle3DContainer.cpp.

69 {
70  if (this != &rhs) {
72  m_containerParticles = std::move(rhs.m_containerParticles);
73  m_cumulativeAbundance = std::move(rhs.m_cumulativeAbundance);
74  m_containerType = std::move(rhs.m_containerType);
75  m_containerParticlesBlend = std::move(rhs.m_containerParticlesBlend);
76  }
77  return *this;
78 }

◆ particle3DBlend()

bool Particle3DContainer::particle3DBlend ( const size_t &  index) const
inline

◆ particleType()

const QString Particle3DContainer::particleType ( ) const
inline

Definition at line 42 of file Particle3DContainer.h.

42 { return m_containerType; }

References m_containerType.

Referenced by setParticleType().

◆ setCumulativeAbundance()

void Particle3DContainer::setCumulativeAbundance ( double  cumulativeAbundance)

Definition at line 95 of file Particle3DContainer.cpp.

96 {
98 }
double cumulativeAbundance() const

References cumulativeAbundance(), and m_cumulativeAbundance.

Referenced by RealSpaceBuilderUtils::particle3DContainerVector(), RealSpaceBuilderUtils::particleComposition3DContainer(), RealSpaceBuilderUtils::particleCoreShell3DContainer(), RealSpaceMesoCrystal::populateMesoCrystal(), and RealSpaceBuilderUtils::singleParticle3DContainer().

Here is the call graph for this function:

◆ setParticleType()

void Particle3DContainer::setParticleType ( QString  particleType)

Definition at line 100 of file Particle3DContainer.cpp.

101 {
103 }
const QString particleType() const

References m_containerType, and particleType().

Referenced by RealSpaceBuilderUtils::particleComposition3DContainer(), RealSpaceBuilderUtils::particleCoreShell3DContainer(), RealSpaceMesoCrystal::populateMesoCrystal(), and RealSpaceBuilderUtils::singleParticle3DContainer().

Here is the call graph for this function:

Member Data Documentation

◆ m_containerParticles

std::vector<RealSpace::Particles::Particle*> Particle3DContainer::m_containerParticles
private

◆ m_containerParticlesBlend

std::vector<bool> Particle3DContainer::m_containerParticlesBlend
private

◆ m_containerType

QString Particle3DContainer::m_containerType
private

Definition at line 55 of file Particle3DContainer.h.

Referenced by operator=(), particleType(), and setParticleType().

◆ m_cumulativeAbundance

double Particle3DContainer::m_cumulativeAbundance
private

Definition at line 54 of file Particle3DContainer.h.

Referenced by cumulativeAbundance(), operator=(), and setCumulativeAbundance().


The documentation for this class was generated from the following files: