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

Description

Definition at line 28 of file Particle3DContainer.h.

Collaboration diagram for Particle3DContainer:
[legend]

Public Member Functions

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

Private Attributes

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

Constructor & Destructor Documentation

◆ Particle3DContainer() [1/3]

Particle3DContainer::Particle3DContainer ( )
inline

Definition at line 30 of file Particle3DContainer.h.

32  {
33  }

◆ Particle3DContainer() [2/3]

Particle3DContainer::Particle3DContainer ( const Particle3DContainer other)

Definition at line 19 of file Particle3DContainer.cpp.

20  : m_cumulativeAbundance(other.m_cumulativeAbundance)
21  , m_containerType(other.m_containerType)
22 {
23  m_containerParticles.resize(other.m_containerParticles.size());
24  for (size_t i = 0; i < m_containerParticles.size(); ++i)
26  new GUI::RealSpace::Particles::Particle(*other.m_containerParticles[i]);
27 
28  m_containerParticlesBlend.resize(other.m_containerParticlesBlend.size());
29  for (size_t i = 0; i < m_containerParticlesBlend.size(); ++i)
30  m_containerParticlesBlend[i] = other.m_containerParticlesBlend[i];
31 }
@ other
The unit has no enum value defined in here (e.g. when defined as an explicit string)
std::vector< GUI::RealSpace::Particles::Particle * > m_containerParticles
std::vector< bool > m_containerParticlesBlend

References m_containerParticles, m_containerParticlesBlend, and other.

◆ ~Particle3DContainer()

Particle3DContainer::~Particle3DContainer ( )

Definition at line 54 of file Particle3DContainer.cpp.

55 {
57 }

References clearContainer().

Here is the call graph for this function:

◆ Particle3DContainer() [3/3]

Particle3DContainer::Particle3DContainer ( Particle3DContainer &&  other)

Definition at line 60 of file Particle3DContainer.cpp.

61  : m_containerParticles(std::move(other.m_containerParticles))
62  , m_cumulativeAbundance(other.m_cumulativeAbundance)
63  , m_containerType(std::move(other.m_containerType))
64  , m_containerParticlesBlend(std::move(other.m_containerParticlesBlend))
65 {
66 }

References other.

Member Function Documentation

◆ addParticle()

◆ clearContainer()

void Particle3DContainer::clearContainer ( )

Definition at line 81 of file Particle3DContainer.cpp.

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

References m_containerParticles, and m_containerParticlesBlend.

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

◆ containerSize()

◆ createParticle()

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

◆ cumulativeAbundance()

double Particle3DContainer::cumulativeAbundance ( ) const
inline

◆ operator=() [1/2]

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

Definition at line 34 of file Particle3DContainer.cpp.

35 {
36  if (this != &rhs) {
38  m_containerParticles.resize(rhs.containerSize());
39  for (size_t i = 0; i < m_containerParticles.size(); ++i)
42 
45 
47  for (size_t i = 0; i < m_containerParticlesBlend.size(); ++i)
49  }
50  return *this;
51 }
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 &&  rhs)

Definition at line 69 of file Particle3DContainer.cpp.

70 {
71  if (this != &rhs) {
75  m_containerType = std::move(rhs.m_containerType);
77  }
78  return *this;
79 }

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

Here is the call graph for this function:

◆ particle3DBlend()

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

◆ particleType()

QString Particle3DContainer::particleType ( ) const
inline

Definition at line 45 of file Particle3DContainer.h.

45 { return m_containerType; }

References m_containerType.

Referenced by setParticleType().

◆ setCumulativeAbundance()

void Particle3DContainer::setCumulativeAbundance ( double  cumulativeAbundance)

◆ setParticleType()

void Particle3DContainer::setParticleType ( QString  particleType)

Definition at line 101 of file Particle3DContainer.cpp.

102 {
104 }
QString particleType() const

References m_containerType, and particleType().

Referenced by GUI::RealSpace::BuilderUtils::particleComposition3DContainer(), GUI::RealSpace::BuilderUtils::particleCoreShell3DContainer(), RealSpaceMesoCrystal::populateMesoCrystal(), and GUI::RealSpace::BuilderUtils::singleParticle3DContainer().

Here is the call graph for this function:

Member Data Documentation

◆ m_containerParticles

std::vector<GUI::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 58 of file Particle3DContainer.h.

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

◆ m_cumulativeAbundance

double Particle3DContainer::m_cumulativeAbundance
private

Definition at line 57 of file Particle3DContainer.h.

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


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