BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Model for list of materials, used in MaterialEditorDialog.
This model is also used for changing values of a material, therefore the list can be updated accordingly.
Definition at line 27 of file MaterialEditorModel.h.
Public Member Functions | |
MaterialEditorModel (MaterialItems *p) | |
MaterialItem * | addRefractiveMaterial (const QString &name, double delta, double beta) |
MaterialItem * | addSLDMaterial (const QString &name, double sld, double abs_term) |
MaterialItem * | cloneMaterial (const QModelIndex &index) |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
QModelIndex | first () const |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
QModelIndex | indexFromMaterial (const MaterialItem *m) const |
QModelIndex | indexFromMaterial (const QString &identifier) const |
MaterialItem * | materialFromIndex (const QModelIndex &index) const |
void | removeMaterial (const QModelIndex &index) |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
void | setBeta (const QModelIndex &index, double value) |
void | setColor (const QModelIndex &index, const QColor &color) |
void | setDelta (const QModelIndex &index, double value) |
void | setIm (const QModelIndex &index, double value) |
void | setMaterialItemName (const QModelIndex &index, const QString &name) |
void | setRe (const QModelIndex &index, double value) |
void | setX (const QModelIndex &index, double value) |
void | setY (const QModelIndex &index, double value) |
void | setZ (const QModelIndex &index, double value) |
Private Types | |
enum | Column { NAME , TYPE , PARAMETERS , MAGNETIZATION , NUM_COLUMNS } |
The columns in the header. PARAMETERS contains delta/beta or Re/Im. More... | |
Private Attributes | |
MaterialItems * | m_model |
|
private |
The columns in the header. PARAMETERS contains delta/beta or Re/Im.
Enumerator | |
---|---|
NAME | |
TYPE | |
PARAMETERS | |
MAGNETIZATION | |
NUM_COLUMNS |
Definition at line 60 of file MaterialEditorModel.h.
MaterialEditorModel::MaterialEditorModel | ( | MaterialItems * | p | ) |
Definition at line 23 of file MaterialEditorModel.cpp.
MaterialItem * MaterialEditorModel::addRefractiveMaterial | ( | const QString & | name, |
double | delta, | ||
double | beta | ||
) |
Definition at line 201 of file MaterialEditorModel.cpp.
References MaterialItems::addRefractiveMaterial(), m_model, GUI::RealSpace::Particles::name(), and rowCount().
Referenced by MaterialEditorDialog::addRefractiveMaterial().
MaterialItem * MaterialEditorModel::addSLDMaterial | ( | const QString & | name, |
double | sld, | ||
double | abs_term | ||
) |
Definition at line 210 of file MaterialEditorModel.cpp.
References MaterialItems::addSLDMaterial(), m_model, GUI::RealSpace::Particles::name(), and rowCount().
Referenced by MaterialEditorDialog::addSldMaterial().
MaterialItem * MaterialEditorModel::cloneMaterial | ( | const QModelIndex & | index | ) |
Definition at line 218 of file MaterialEditorModel.cpp.
References MaterialItems::insertCopy(), m_model, materialFromIndex(), and rowCount().
Referenced by MaterialEditorDialog::cloneCurrentMaterial().
|
override |
Definition at line 33 of file MaterialEditorModel.cpp.
References NUM_COLUMNS.
|
override |
Definition at line 58 of file MaterialEditorModel.cpp.
References MaterialItem::beta(), MaterialItem::delta(), MaterialItem::hasRefractiveIndex(), m_model, MaterialItem::magnetization(), MAGNETIZATION, materialFromIndex(), MaterialItems::materialItems(), MaterialItem::matItemName(), NAME, PARAMETERS, MaterialItem::sldIm(), MaterialItem::sldRe(), and TYPE.
QModelIndex MaterialEditorModel::first | ( | ) | const |
Definition at line 196 of file MaterialEditorModel.cpp.
Referenced by MaterialEditorDialog::MaterialEditorDialog().
|
override |
Definition at line 38 of file MaterialEditorModel.cpp.
References MAGNETIZATION, NAME, PARAMETERS, and TYPE.
QModelIndex MaterialEditorModel::indexFromMaterial | ( | const MaterialItem * | m | ) | const |
Definition at line 187 of file MaterialEditorModel.cpp.
References m_model, and MaterialItems::materialItems().
Referenced by MaterialEditorDialog::setCurrentMaterial().
QModelIndex MaterialEditorModel::indexFromMaterial | ( | const QString & | identifier | ) | const |
Definition at line 178 of file MaterialEditorModel.cpp.
References m_model, and MaterialItems::materialItems().
MaterialItem * MaterialEditorModel::materialFromIndex | ( | const QModelIndex & | index | ) | const |
Definition at line 173 of file MaterialEditorModel.cpp.
References m_model, and MaterialItems::materialItems().
Referenced by cloneMaterial(), MaterialEditorDialog::currentMaterial(), data(), removeMaterial(), setBeta(), setColor(), setDelta(), setIm(), setMaterialItemName(), setRe(), setX(), setY(), and setZ().
void MaterialEditorModel::removeMaterial | ( | const QModelIndex & | index | ) |
Definition at line 226 of file MaterialEditorModel.cpp.
References m_model, materialFromIndex(), and MaterialItems::removeMaterial().
Referenced by MaterialEditorDialog::removeCurrentMaterial().
|
override |
Definition at line 28 of file MaterialEditorModel.cpp.
References m_model, and MaterialItems::materialItems().
Referenced by MaterialEditorDialog::MaterialEditorDialog(), addRefractiveMaterial(), addSLDMaterial(), and cloneMaterial().
void MaterialEditorModel::setBeta | ( | const QModelIndex & | index, |
double | value | ||
) |
Definition at line 149 of file MaterialEditorModel.cpp.
References materialFromIndex(), and PARAMETERS.
void MaterialEditorModel::setColor | ( | const QModelIndex & | index, |
const QColor & | color | ||
) |
Definition at line 105 of file MaterialEditorModel.cpp.
References materialFromIndex(), and MaterialItem::setColor().
Referenced by MaterialEditorDialog::onSelectColor().
void MaterialEditorModel::setDelta | ( | const QModelIndex & | index, |
double | value | ||
) |
Definition at line 141 of file MaterialEditorModel.cpp.
References materialFromIndex(), and PARAMETERS.
void MaterialEditorModel::setIm | ( | const QModelIndex & | index, |
double | value | ||
) |
Definition at line 165 of file MaterialEditorModel.cpp.
References materialFromIndex(), and PARAMETERS.
void MaterialEditorModel::setMaterialItemName | ( | const QModelIndex & | index, |
const QString & | name | ||
) |
Definition at line 99 of file MaterialEditorModel.cpp.
References materialFromIndex(), GUI::RealSpace::Particles::name(), and MaterialItem::setMatItemName().
void MaterialEditorModel::setRe | ( | const QModelIndex & | index, |
double | value | ||
) |
Definition at line 157 of file MaterialEditorModel.cpp.
References materialFromIndex(), and PARAMETERS.
void MaterialEditorModel::setX | ( | const QModelIndex & | index, |
double | value | ||
) |
Definition at line 111 of file MaterialEditorModel.cpp.
References MAGNETIZATION, and materialFromIndex().
void MaterialEditorModel::setY | ( | const QModelIndex & | index, |
double | value | ||
) |
Definition at line 121 of file MaterialEditorModel.cpp.
References MAGNETIZATION, and materialFromIndex().
void MaterialEditorModel::setZ | ( | const QModelIndex & | index, |
double | value | ||
) |
Definition at line 131 of file MaterialEditorModel.cpp.
References MAGNETIZATION, and materialFromIndex().
|
private |
Definition at line 62 of file MaterialEditorModel.h.
Referenced by addRefractiveMaterial(), addSLDMaterial(), cloneMaterial(), data(), indexFromMaterial(), materialFromIndex(), removeMaterial(), and rowCount().