28 const QString abundance_tooltip =
"Proportion of this type of particles normalized to the \n"
29 "total number of particles in the layout";
40 setToolTip(
"Collection of particles obtained via parametric distribution "
41 "of particle prototype");
49 ->
setToolTip(
"Distribution to apply to the specified parameter");
52 QStringList() <<
"Particle"
53 <<
"ParticleCoreShell"
54 <<
"ParticleComposition"
69 if (
item &&
item->modelType() ==
"Property" &&
item->parent() ==
this)
87 " -> Error! No correct particle defined");
93 auto P_distribution = distr_item.createDistribution(scale);
98 limits = limitsItem.createRealLimits(scale);
111 auto result = std::make_unique<ParticleDistribution>(*P_particle, par_distr);
113 result->setAbundance(abundance);
132 if (!guiName.isEmpty()) {
133 currentValue = guiName;
141 if (newProp.
getValues().contains(currentValue))
155 par_names.removeAll(mainValue);
161 QStringList domainValues;
164 if (!guiName.isEmpty())
165 domainValues.append(guiName);
167 if (!domainValues.isEmpty()) {
168 currentValues = domainValues;
174 for (
auto name : currentValues)
215 std::vector<std::string> result;
217 for (
auto name : linked_names) {
219 if (!translated.isEmpty())
220 result.push_back(translated.toStdString());
#define ASSERT(condition)
Defines class ComboProperty.
Defines class DistributionItem and several subclasses.
Defines class GUIHelpers functions.
Defines ParameterTreeUtils namespace.
Defines namespace ParameterUtils.
Defines class ParticleDistributionItem.
Defines class ParticleItem.
Defines RealLimitsItems's classes.
Defines namespace TransformFromDomain.
Defines class TransformToDomain.
Defines some unit conversion factors and other constants in namespace Units.
Custom property to define list of string values with multiple selections.
QStringList getValues() const
static ComboProperty fromList(const QStringList &values, const QString ¤t_value="")
QVariant variant() const
Constructs variant enclosing given ComboProperty.
void setSelected(int index, bool value=true)
Sets given index selection flag.
void setValue(const QString &name)
QStringList selectedValues() const
Returns list of string with selected values;.
static const QString P_LIMITS
static const QString P_NUMBER_OF_SAMPLES
static const QString P_SIGMA_FACTOR
void setOnAnyChildChange(std::function< void(SessionItem *)> f, const void *caller=0)
Calls back on any change in children (number of children or their properties), reports childItem.
void setOnPropertyChange(std::function< void(QString)> f, const void *caller=0)
A parametric distribution function, for use with any model parameter.
ParameterDistribution & linkParameter(std::string par_name)
const SessionItem * childParticle() const
QString m_domain_cache_name
std::unique_ptr< ParticleDistribution > createParticleDistribution() const
static const QString NO_SELECTION
QString translateParameterNameToGUI(const QString &domainName)
static const QString P_DISTRIBUTION
std::string domainMainParameter() const
static const QString T_PARTICLES
QStringList childParameterNames() const
void setDomainCacheNames(const QString &name, const QStringList &linked)
static const QString P_DISTRIBUTED_PARAMETER
void updateLinkedParameterList()
std::vector< std::string > domainLinkedParameters() const
QStringList m_linked_names
static const QString P_LINKED_PARAMETER
void updateMainParameterList()
ParticleDistributionItem()
static const QString P_ABUNDANCE
Limits for a real fit parameter.
static RealLimits limitless()
Creates an object withoud bounds (default)
static RealLimits limited(double left_bound_value, double right_bound_value)
Creates an object bounded from the left and right.
bool isTag(const QString &name) const
Returns true if tag is available.
SessionItem * addProperty(const QString &name, const QVariant &variant)
Add new property item and register new tag.
SessionItem & setDecimals(int n)
bool registerTag(const QString &name, int min=0, int max=-1, QStringList modelTypes={})
Add new tag to this item with given name, min, max and types.
QVector< SessionItem * > getItems(const QString &tag="") const
Returns vector of all items of given tag.
SessionItem & setEditorType(const QString &editorType)
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.
SessionItem * addGroupProperty(const QString &groupTag, const QString &groupType)
Creates new group item and register new tag, returns GroupItem.
ModelMapper * mapper()
Returns the current model mapper of this item. Creates new one if necessary.
void setDefaultTag(const QString &tag)
Set default tag.
T * item(const QString &tag) const
void setItemValue(const QString &tag, const QVariant &variant)
Directly set value of item under given tag.
QVector< SessionItem * > children() const
Returns vector of all children.
RealLimits limits() const
SessionItem & setToolTip(const QString &tooltip)
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.
SessionItem & setLimits(const RealLimits &value)
QString domainNameToParameterName(const QString &domainName, const SessionItem *source)
Converts domain name to parameterItem name.
QStringList parameterTreeNames(const SessionItem *source)
Creates list with parameter names of source item.
QString parameterNameToDomainName(const QString &parName, const SessionItem *source)
Converts parameter name to domain name.
bool isAngleRelated(const std::string &par_name)
Returns true if given parameter name is related to angles.
QString const & name(EShape k)
std::unique_ptr< IParticle > createIParticle(const SessionItem &item)
static constexpr double deg