28 return iff.
getName() ==
"Interference2DLattice" || iff.
getName() ==
"Interference2DParaCrystal"
29 || iff.
getName() ==
"Interference2DSuperLattice"
30 || iff.
getName() ==
"InterferenceFinite2DLattice"
31 || iff.
getName() ==
"InterferenceHardDisk";
36 : m_weight(1.0), m_total_particle_density(0.01), m_interference_function(nullptr)
44 : m_weight(1.0), m_total_particle_density(0.01), m_interference_function(nullptr)
82 particle_clone->
rotate(rotation);
96 for (
const IParticle* particle : generated_particles)
97 particle_vector.
push_back(particle->clone());
98 }
else if (
const auto* p_iparticle =
dynamic_cast<const IParticle*
>(particle)) {
99 particle_vector.
push_back(p_iparticle->clone());
102 return particle_vector;
114 result += particle->abundance();
140 std::vector<const INode*> result;
142 result.push_back(particle);
168 if (make_registered) {
Defines class InterferenceFunctionNone.
Defines class ParameterPool.
Defines class ParticleDistribution.
Defines class ParticleLayout.
Defines class RealParameter.
BasicVector3D< double > kvector_t
Interface for a generic particle.
void setAbundance(double abundance)
Sets particle abundance.
virtual IAbstractParticle * clone() const =0
Returns a clone of this ISampleNode object.
virtual void translate(kvector_t translation)=0
Translates the particle with the given vector.
virtual void rotate(const IRotation &rotation)=0
Applies the given rotation to the particle.
Abstract base class of interference functions.
virtual IInterferenceFunction * clone() const =0
Returns a clone of this ISampleNode object.
void registerChild(INode *node)
const std::string & getName() const
void removeParameter(const std::string &name)
RealParameter * parameter(const std::string &name) const
Returns parameter with given 'name'.
void setName(const std::string &name)
RealParameter & registerParameter(const std::string &name, double *parpointer)
Abstract base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
Abstract base class for rotations.
virtual bool isIdentity() const
Returns true if rotation matrix is identity matrix (no rotations)
A particle type that is a parametric distribution of IParticle's.
Decorator class that adds particles to ISampleNode objects.
double weight() const
Returns the relative weight of this layout.
SafePointerVector< IAbstractParticle > m_particles
Vector of particle types.
std::unique_ptr< IInterferenceFunction > m_interference_function
void registerParticleDensity(bool make_registered=true)
void setTotalParticleSurfaceDensity(double particle_density)
Sets total particle surface density.
double getTotalAbundance() const
ParticleLayout * clone() const override
Returns a clone of this ISampleNode object.
~ParticleLayout() override
void setInterferenceFunction(const IInterferenceFunction &interference_function)
Adds interference functions.
const IInterferenceFunction * interferenceFunction() const
SafePointerVector< IParticle > particles() const
Returns information on all particles (type and abundance) and generates new particles if an IAbstract...
std::vector< const INode * > getChildren() const override
Returns a vector of children.
void setAndRegisterInterferenceFunction(IInterferenceFunction *child)
Sets interference function with simultaneous registration in parent class.
double m_total_particle_density
void addAndRegisterAbstractParticle(IAbstractParticle *child)
Adds particle information with simultaneous registration in parent class.
void setWeight(double weight)
Sets the relative weight of this layout.
void addParticle(const IAbstractParticle &particle, double abundance=-1.0, const kvector_t position={}, const IRotation &rotation=IdentityRotation())
Adds particle to the layout with abundance, position and the rotation defined.
double totalParticleSurfaceDensity() const
A vector of pointers, owned by *this, with methods to handle them safely.
void push_back(T *pointer)