28 const QString abundance_tooltip =
"Proportion of this type of particles normalized to the \n"
29 "total number of particles in the layout";
31 const QString position_tooltip =
"Relative position of the particle's reference point \n"
32 "in the coordinate system of the parent (nm)";
76 auto particle = std::make_unique<Particle>(*material, *ffItem.createFormFactor());
77 particle->setAbundance(abundance);
102 pos->setEnabled(
false);
Defines class MaterialItemUtils.
Defines ModelPath namespace.
Defines class ParticleCoreShellItem.
Defines class ParticleItem.
Defines namespace SessionItemUtils.
Defines class SessionModel.
Defines class TransformToDomain.
Defines class VectorItem.
BasicVector3D< double > kvector_t
void setOnParentChange(std::function< void(SessionItem *)> f, const void *caller=0)
Calls back when parent has changed, reports newParent.
static const QString T_SHELL
VectorItem * positionItem() const
std::unique_ptr< Particle > createParticle() const
static const QString P_MATERIAL
bool isShellParticle() const
Returns true if this particle is a shell particle.
QVector< SessionItem * > materialPropertyItems()
static const QString P_ABUNDANCE
bool parentIsParticleLayout() const
Returns true if this particle is directly connected to a ParticleLayout.
static const QString T_TRANSFORMATION
static const QString P_POSITION
void updatePropertiesAppearance(SessionItem *)
Updates enabled/disabled for particle position and particle abundance depending on context.
static const QString P_FORM_FACTOR
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.
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.
SessionItem * parent() const
Returns parent of this item.
void setDefaultTag(const QString &tag)
Set default tag.
void addTranslator(const IPathTranslator &translator)
T * item(const QString &tag) const
void setItemValue(const QString &tag, const QVariant &variant)
Directly set value of item under given tag.
SessionItem & setToolTip(const QString &tooltip)
QString modelType() const
Get model type.
QString tagFromItem(const SessionItem *item) const
Returns the tag name of given item when existing.
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)
ExternalProperty defaultMaterialProperty()
bool HasOwnAbundance(const SessionItem *item)
void setTransformationInfo(IParticle *result, const SessionItem &item)
std::unique_ptr< Material > createDomainMaterial(const SessionItem &item)