26 std::vector<kvector_t> positions)
38 for (
size_t index = 0; index <
m_particles.size(); ++index)
52 for (
const auto* particle : particles) {
53 std::unique_ptr<IFormFactor> P_particle_ff(particle->createFormFactor());
54 result->addFormFactor(*P_particle_ff);
76 for (
size_t i = 0; i < positions.size(); ++i)
84 result.push_back(P_particle.get());
94 const auto sublist = particle->decompose();
95 for (
auto* subparticle : sublist) {
97 subparticle->rotate(*rot);
98 subparticle->translate(translation);
109 for (
const auto& particle : particles) {
121 :
throw std::runtime_error(
122 "ParticleComposition::check_index() -> Index is out of bounds");
134 setName(
"ParticleComposition");
Defines class ParticleComposition.
Defines class ParticleDistribution.
Defines IRotation classes.
void setAbundance(double abundance)
Sets particle abundance.
void registerChild(INode *node)
void setName(const std::string &name)
Abstract base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
void registerAbundance(bool make_registered=true)
std::vector< const INode * > getChildren() const override
Returns a vector of children.
void setPosition(kvector_t position)
Sets relative position of the particle's reference point in the coordinate system of parent.
kvector_t position() const
Returns particle position.
const IRotation * rotation() const
Returns rotation object.
IParticle * clone() const override=0
Returns a clone of this ISampleNode object.
std::unique_ptr< IRotation > m_rotation
void setRotation(const IRotation &rotation)
Sets transformation.
void translate(kvector_t translation) final
Translates the particle.
void registerParticleProperties()
Registers abundance and position.
A composition of particles at fixed positions.
IFormFactor * createFormFactor() const final
Creates a form factor for this particle.
void addParticle(const IParticle &particle)
std::vector< std::unique_ptr< IParticle > > m_particles
size_t check_index(size_t index) const
void addParticlePointer(IParticle *p_particle)
For internal use.
ParticleLimits bottomTopZ() const final
Top and bottom z-coordinate.
ParticleComposition * clone() const final
Returns a clone of this ISampleNode object.
std::vector< const INode * > getChildren() const final
Returns a vector of children.
void addParticles(const IParticle &particle, std::vector< kvector_t > positions)
SafePointerVector< IParticle > decompose() const final
Decompose in constituent IParticle objects.
A vector of pointers, owned by *this, with methods to handle them safely.
void push_back(T *pointer)
Vertical extension of a particle, specified by bottom and top z coordinate.