33 const QString abundance_tooltip =
"Proportion of this type of mesocrystal normalized to the \n"
34 "total number of particles in the layout";
36 const QString lattice_vector1_tooltip =
"Coordinates of the first lattice vector";
38 const QString lattice_vector2_tooltip =
"Coordinates of the second lattice vector";
40 const QString lattice_vector3_tooltip =
"Coordinates of the third lattice vector";
42 const QString position_tooltip =
"Relative position of the mesocrystal's reference point \n"
43 "in the coordinate system of the parent (nm)";
45 const QString density_tooltip =
46 "Number of mesocrystals per square nanometer (particle surface density).\n "
47 "Should be defined for disordered and 1d-ordered particle collections.";
49 bool IsIParticleName(QString
name)
51 return (
name.startsWith(
"Particle") ||
name.startsWith(
"ParticleComposition")
52 ||
name.startsWith(
"ParticleCoreShell") ||
name.startsWith(
"MesoCrystal"));
67 setToolTip(
"A 3D crystal structure of nanoparticles");
82 QStringList() <<
"Particle"
83 <<
"ParticleCoreShell"
84 <<
"ParticleComposition"
92 QStringList additional_names{QString::fromStdString(
"Lattice"),
93 QString::fromStdString(
"Crystal")};
118 "Lattice volume not strictly positive");
119 std::unique_ptr<IParticle> basis =
getBasis();
122 "No basis particle defined");
123 Crystal crystal(*basis, lattice);
128 "No outer shape defined");
130 auto result = std::make_unique<MesoCrystal>(crystal, *ff);
138 QStringList result = list;
140 if (IsIParticleName(list.back()))
141 result << QString::fromStdString(
"Crystal");
156 QVector<SessionItem*> childlist =
children();
157 for (
int i = 0; i < childlist.size(); ++i) {
158 if (childlist[i]->
modelType() ==
"Particle") {
159 auto* particle_item =
static_cast<ParticleItem*
>(childlist[i]);
161 }
else if (childlist[i]->
modelType() ==
"ParticleCoreShell") {
164 }
else if (childlist[i]->
modelType() ==
"ParticleComposition") {
167 }
else if (childlist[i]->
modelType() ==
"MesoCrystal") {
178 return ff_item.createFormFactor();
Defines class ComboProperty.
Defines class GUIHelpers functions.
Defines class MesoCrystalItem.
Defines class MesoCrystal.
Defines ModelPath namespace.
Defines class ParticleCompositionItem.
Defines class ParticleCoreShellItem.
Defines ParticleCoreShell.
Defines class ParticleItem.
Defines namespace SessionItemUtils.
Defines class TransformToDomain.
Defines class VectorItem.
A crystal structure, defined by a Bravais lattice, a basis, and a position variance.
A Bravais lattice, characterized by three basis vectors, and optionally an ISelectionRule.
double unitCellVolume() const
Returns the volume of the unit cell.
std::unique_ptr< IFormFactor > getOuterShape() const
static const QString P_VECTOR_C
QStringList translateList(const QStringList &list) const override
std::unique_ptr< MesoCrystal > createMesoCrystal() const
std::unique_ptr< IParticle > getBasis() const
static const QString T_BASIS_PARTICLE
Lattice3D getLattice() const
static const QString P_VECTOR_B
VectorItem * positionItem() const
static const QString P_VECTOR_A
static const QString P_OUTER_SHAPE
void setOnParentChange(std::function< void(SessionItem *)> f, const void *caller=0)
Calls back when parent has changed, reports newParent.
std::unique_ptr< ParticleComposition > createParticleComposition() const
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.
virtual QStringList translateList(const QStringList &list) const
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)
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.
SessionItem & setToolTip(const QString &tooltip)
QString modelType() const
Get model type.
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)
QString const & name(EShape k)
bool HasOwnAbundance(const SessionItem *item)
void setTransformationInfo(IParticle *result, const SessionItem &item)