27 std::vector<kvector_t> positions)
39 for (
size_t index = 0; index <
m_particles.size(); ++index)
53 for (
auto p_particle : particles) {
54 std::unique_ptr<IFormFactor> P_particle_ff{p_particle->createFormFactor()};
55 result->addFormFactor(*P_particle_ff);
77 for (
size_t i = 0; i < positions.size(); ++i)
85 result.push_back(P_particle.get());
95 auto sublist = P_particle->decompose();
96 for (
auto p_subparticle : sublist) {
98 p_subparticle->rotate(*p_rotation);
99 p_subparticle->translate(translation);
100 result.
push_back(p_subparticle->clone());
110 for (
auto& P_particle : particles) {
123 "ParticleComposition::check_index() -> Index is out of bounds");
135 setName(
"ParticleComposition");
Defines many exception classes in namespace Exceptionss.
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)
Pure virtual base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
void registerAbundance(bool make_registered=true)
void translate(kvector_t translation) override final
Translates the particle.
std::vector< const INode * > getChildren() const override
Returns a vector of children (const).
void setPosition(kvector_t position)
Sets relative position of the particle's reference point in the coordinate system of parent.
std::unique_ptr< IRotation > mP_rotation
kvector_t position() const
Returns particle position.
const IRotation * rotation() const
Returns rotation object.
IParticle * clone() const override=0
Returns a clone of this ISample object.
void setRotation(const IRotation &rotation)
Sets transformation.
void registerParticleProperties()
Registers abundance and position.
A composition of particles at fixed positions.
ParticleComposition * clone() const override final
Returns a clone of this ISample object.
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.
SafePointerVector< IParticle > decompose() const override final
Decompose in constituent IParticle objects.
std::vector< const INode * > getChildren() const override final
Returns a vector of children (const).
ParticleLimits bottomTopZ() const override final
Top and bottom z-coordinate.
void addParticles(const IParticle &particle, std::vector< kvector_t > positions)
IFormFactor * createFormFactor() const override final
Creates a form factor for this particle.
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.