26 : m_par_distribution(par_distr)
28 setName(
"ParticleDistribution");
62 child->parameterPool()->copyToExternalPool(path, &pool);
68 std::map<std::string, double> linked_ratios;
81 child->parameterPool()->copyToExternalPool(path, &pool2);
84 for (
const auto& it : linked_ratios)
94 std::vector<const INode*> result = std::vector<const INode*>() <<
m_particle;
96 result.emplace_back(dist);
Defines classes representing one-dimensional distributions.
Defines interface IParticle.
Defines collection of utility functions for INode.
Defines class ParameterPool.
Defines namespace ParameterUtils.
Defines class ParticleDistribution.
Defines class RealParameter.
void setAbundance(double abundance)
Sets particle abundance.
Base class for tree-like structures containing parameterized objects.
std::vector< const INode * > progeny() const
Returns a vector of all descendants.
const INode * parent() const
void registerChild(INode *node)
void setName(const std::string &name)
RealParameter & registerParameter(const std::string &name, double *parpointer)
Abstract base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
IParticle * clone() const override=0
Returns a clone of this ISampleNode object.
Abstract base class for rotations.
A parametric distribution function, for use with any model parameter.
const IDistribution1D * getDistribution() const
std::vector< ParameterSample > generateSamples() const
generate list of sampled values with their weight
std::vector< std::string > getLinkedParameterNames() const
get list of linked parameter names
std::string getMainParameterName() const
get the main parameter's name
Container with parameters for IParametricComponent object.
void setUniqueMatchValue(const std::string &pattern, double value)
Sets value of the one parameter that matches pattern ('*' allowed), or throws.
RealParameter * getUniqueMatch(const std::string &pattern) const
Returns the one parameter that matches the pattern (wildcards '*' allowed), or throws.
A parameter value with a weight, as obtained when sampling from a distribution.
A particle type that is a parametric distribution of IParticle's.
ParameterDistribution m_par_distribution
const IParticle & prototype() const
Returns the prototype particle, used for generating multiple ones.
ParticleDistribution * clone() const final
Returns a clone of this ISampleNode object.
std::vector< const INode * > getChildren() const final
Returns a vector of children.
void translate(kvector_t translation) final
Translates the particle with the given vector.
void rotate(const IRotation &rotation) final
Applies the given rotation to the particle.
SafePointerVector< IParticle > generateParticles() const
Returns list of new particles generated according to a distribution.
ParameterDistribution parameterDistribution() const
Returns the distributed parameter data.
std::string mainUnits() const
ParticleDistribution(const IParticle &prototype, const ParameterDistribution &par_distr)
std::unique_ptr< IParticle > m_particle
double value() const
Returns value of wrapped parameter.
A vector of pointers, owned by *this, with methods to handle them safely.
void push_back(T *pointer)
std::string nodePath(const INode *node, const INode *root=nullptr)
Returns path composed of node's displayName, with respect to root node.
std::string poolParameterUnits(const IParametricComponent &node, const std::string &parName)
Returns units of main parameter.
QString const & name(EShape k)