23 const QString magnetization_tooltip =
"Magnetization (A/m)";
39 addProperty<VectorItem>(
P_MAGNETIZATION)->setToolTip(magnetization_tooltip);
70 return property.
color();
79 if (dataItem->modelType() ==
"MaterialRefractiveData") {
84 }
else if (dataItem->modelType() ==
"MaterialSLDData") {
87 return std::make_unique<Material>(
MaterialBySLD(
name, sld_real, sld_imag, magnetization));
91 "Not implemented material type");
Defines class GUIHelpers functions.
Defines MaterialDataItems classes.
Factory functions used to create material instances.
Defines class MaterialItemUtils.
Defines namespace SessionItemUtils.
Defines class VectorItem.
The ExternalProperty class defines custom QVariant property to carry the text, color and an identifie...
void setRefractiveData(double delta, double beta)
Turns material into refractive index material.
static const QString P_MAGNETIZATION
static const QString P_MATERIAL_DATA
static const QString P_IDENTIFIER
static const QString P_COLOR
QString identifier() const
std::unique_ptr< Material > createMaterial() const
void setSLDData(double sld_real, double sld_imag)
Turns material into SLD based material.
static const QString P_DELTA
static const QString P_BETA
static const QString P_SLD_REAL
static const QString P_SLD_IMAG
QString itemName() const
Get item name, return display name if no name is set.
void setItemName(const QString &name)
Set item name, add property if necessary.
SessionItem * addProperty(const QString &name, const QVariant &variant)
Add new property item and register new tag.
SessionItem * getGroupItem(const QString &groupName) const
Access subitem of group item.
void setVisible(bool enabled)
Flags accessors.
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.
SessionItem * setGroupProperty(const QString &groupTag, const QString &modelType) const
Set the current type of group item.
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.
Material HomogeneousMaterial(const std::string &name, complex_t refractive_index, kvector_t magnetization)
Constructs a material with name, refractive_index and magnetization (in A/m).
ExternalProperty colorProperty(const QColor &color)
Constructs color property from given color.
QString const & name(EShape k)