26 const QString abundance_tooltip =
"Proportion of this type of particles normalized to the \n"
27 "total number of particles in the layout";
29 const QString position_tooltip =
"Relative position of the particle's reference point \n"
30 "in the coordinate system of the parent (nm)";
41 setToolTip(
"A particle with a core/shell geometry");
75 std::unique_ptr<Particle> P_core{};
76 std::unique_ptr<Particle> P_shell{};
83 if (!P_core || !P_shell)
84 throw GUIHelpers::Error(
"ParticleCoreShellItem::createParticleCoreShell -> Error. Either "
85 "core or shell particle is undefined.");
86 auto P_coreshell = std::make_unique<ParticleCoreShell>(*P_shell, *P_core);
87 P_coreshell->setAbundance(abundance);
94 QVector<SessionItem*> result;
96 result.append(core->materialPropertyItems());
99 result.append(shell->materialPropertyItems());
Defines class GUIHelpers functions.
Defines ModelPath namespace.
Defines class ParticleCoreShellItem.
Defines ParticleCoreShell.
Defines class ParticleItem.
Defines namespace SessionItemUtils.
Defines class TransformToDomain.
Defines class VectorItem.
void setOnParentChange(std::function< void(SessionItem *)> f, const void *caller=0)
Calls back when parent has changed, reports newParent.
VectorItem * positionItem() const
static const QString T_CORE
QVector< SessionItem * > materialPropertyItems()
static const QString T_SHELL
std::unique_ptr< ParticleCoreShell > createParticleCoreShell() const
std::unique_ptr< Particle > createParticle() const
static const QString P_ABUNDANCE
static const QString T_TRANSFORMATION
static const QString P_POSITION
static RealLimits limited(double left_bound_value, double right_bound_value)
Creates an object bounded from the left and right.
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.
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.
ModelMapper * mapper()
Returns the current model mapper of this item. Creates new one if necessary.
SessionItem * parent() const
Returns parent of this item.
void addTranslator(const IPathTranslator &translator)
void setItemValue(const QString &tag, const QVariant &variant)
Directly set value of item under given tag.
SessionItem & setToolTip(const QString &tooltip)
void setEnabled(bool enabled)
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.
SessionItem & setLimits(const RealLimits &value)
bool HasOwnAbundance(const SessionItem *item)
void setTransformationInfo(IParticle *result, const SessionItem &item)