BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Dialog to select a material and also to edit the list of existing materials. The dialog operates on a copy of the current materials. The original material store is only updated if changes have been made and the dialog has been closed with OK. Use this dialog only with the two static methods to edit the list, or to choose a material.
Definition at line 35 of file MaterialEditorDialog.h.
Static Public Member Functions | |
static QString | chooseMaterial (QWidget *parent, MultiLayerItem *sample, const QString &identifierOfPreviousMaterial) |
Use this to choose a material. identifierOfPreviousMaterial is the material which should be selected when opening the dialog. Returns the identifier of the newly selected material. Returns an empty string, if the dialog is cancelled. More... | |
static void | editMaterials (QWidget *parent, MultiLayerItem *sample) |
Use this to edit the list of existing materials. More... | |
Private Member Functions | |
MaterialEditorDialog (MultiLayerItem *sample, QWidget *parent=nullptr) | |
~MaterialEditorDialog () override | |
void | accept () override |
updates original material model with the edited model More... | |
void | addRefractiveMaterial () |
void | addSldMaterial () |
void | cloneCurrentMaterial () |
QModelIndex | currentIndex () const |
MaterialItem * | currentMaterial () |
void | fill () |
QStringList | identifiersOfUsedMaterials () const |
Returns the list of material identifiers of the materials currently used in the sample. E.g. the material selected in a particle. More... | |
void | onSelectColor () |
void | removeCurrentMaterial () |
void | setCurrentMaterial (const MaterialItem *m) |
void | setCurrentMaterial (const QString &identifier) |
void | updateActionEnabling () |
Private Attributes | |
QAction * | m_cloneMaterialAction |
Materials for working within this dialog. More... | |
MaterialEditorModel * | m_model |
QAction * | m_removeMaterialAction |
MultiLayerItem * | m_sample |
Model for the left list. Works on m_tmpMaterialItems. More... | |
MaterialItems | m_tmpMaterialItems |
Ui::MaterialEditorDialog * | m_ui |
|
private |
Definition at line 35 of file MaterialEditorDialog.cpp.
References addRefractiveMaterial(), addSldMaterial(), appSettings, cloneCurrentMaterial(), GUI::View::EditUtil::configScientificDoubleEdit(), GUI::View::EditUtil::configSpinbox(), fill(), MaterialEditorModel::first(), MaterialItems::initFrom(), ApplicationSettings::loadWindowSizeAndPos(), m_cloneMaterialAction, m_model, m_removeMaterialAction, m_sample, m_tmpMaterialItems, m_ui, MultiLayerItem::materialItems(), onSelectColor(), removeCurrentMaterial(), MaterialEditorModel::rowCount(), GUI::Util::Style::setResizable(), and updateActionEnabling().
|
overrideprivate |
Definition at line 143 of file MaterialEditorDialog.cpp.
References appSettings, and ApplicationSettings::saveWindowSizeAndPos().
|
overrideprivate |
updates original material model with the edited model
Definition at line 148 of file MaterialEditorDialog.cpp.
References MaterialItems::initFrom(), m_sample, m_tmpMaterialItems, and MultiLayerItem::materialItems().
|
private |
Definition at line 172 of file MaterialEditorDialog.cpp.
References MaterialEditorModel::addRefractiveMaterial(), m_model, and setCurrentMaterial().
Referenced by MaterialEditorDialog().
|
private |
Definition at line 177 of file MaterialEditorDialog.cpp.
References MaterialEditorModel::addSLDMaterial(), m_model, and setCurrentMaterial().
Referenced by MaterialEditorDialog().
|
static |
Use this to choose a material. identifierOfPreviousMaterial is the material which should be selected when opening the dialog. Returns the identifier of the newly selected material. Returns an empty string, if the dialog is cancelled.
Definition at line 154 of file MaterialEditorDialog.cpp.
References currentMaterial(), and setCurrentMaterial().
Referenced by MaterialInplaceForm::selectMaterial().
|
private |
Definition at line 182 of file MaterialEditorDialog.cpp.
References MaterialEditorModel::cloneMaterial(), currentIndex(), m_model, and setCurrentMaterial().
Referenced by MaterialEditorDialog().
|
private |
Definition at line 273 of file MaterialEditorDialog.cpp.
References m_ui.
Referenced by cloneCurrentMaterial(), currentMaterial(), onSelectColor(), removeCurrentMaterial(), and updateActionEnabling().
|
private |
Definition at line 217 of file MaterialEditorDialog.cpp.
References currentIndex(), m_model, and MaterialEditorModel::materialFromIndex().
Referenced by chooseMaterial(), fill(), onSelectColor(), and removeCurrentMaterial().
|
static |
Use this to edit the list of existing materials.
Definition at line 166 of file MaterialEditorDialog.cpp.
|
private |
Definition at line 222 of file MaterialEditorDialog.cpp.
References currentMaterial(), and m_ui.
Referenced by MaterialEditorDialog(), and onSelectColor().
|
private |
Returns the list of material identifiers of the materials currently used in the sample. E.g. the material selected in a particle.
Definition at line 278 of file MaterialEditorDialog.cpp.
References MultiLayerItem::itemsWithMaterial(), and m_sample.
Referenced by removeCurrentMaterial().
|
private |
Definition at line 203 of file MaterialEditorDialog.cpp.
References currentIndex(), currentMaterial(), fill(), m_model, and MaterialEditorModel::setColor().
Referenced by MaterialEditorDialog().
|
private |
Definition at line 188 of file MaterialEditorDialog.cpp.
References currentIndex(), currentMaterial(), MaterialItem::identifier(), identifiersOfUsedMaterials(), m_model, MaterialEditorModel::removeMaterial(), and GUI::View::Helpers::warning().
Referenced by MaterialEditorDialog().
|
private |
Definition at line 263 of file MaterialEditorDialog.cpp.
References MaterialEditorModel::indexFromMaterial(), m_model, and m_ui.
Referenced by addRefractiveMaterial(), addSldMaterial(), chooseMaterial(), and cloneCurrentMaterial().
|
private |
Definition at line 268 of file MaterialEditorDialog.cpp.
References MaterialEditorModel::indexFromMaterial(), m_model, and m_ui.
|
private |
Definition at line 211 of file MaterialEditorDialog.cpp.
References currentIndex(), m_cloneMaterialAction, and m_removeMaterialAction.
Referenced by MaterialEditorDialog().
|
private |
Materials for working within this dialog.
Definition at line 76 of file MaterialEditorDialog.h.
Referenced by MaterialEditorDialog(), and updateActionEnabling().
|
private |
Definition at line 81 of file MaterialEditorDialog.h.
Referenced by MaterialEditorDialog(), addRefractiveMaterial(), addSldMaterial(), cloneCurrentMaterial(), currentMaterial(), onSelectColor(), removeCurrentMaterial(), and setCurrentMaterial().
|
private |
Definition at line 77 of file MaterialEditorDialog.h.
Referenced by MaterialEditorDialog(), and updateActionEnabling().
|
private |
Model for the left list. Works on m_tmpMaterialItems.
Definition at line 82 of file MaterialEditorDialog.h.
Referenced by MaterialEditorDialog(), accept(), and identifiersOfUsedMaterials().
|
private |
Definition at line 74 of file MaterialEditorDialog.h.
Referenced by MaterialEditorDialog(), and accept().
|
private |
Definition at line 79 of file MaterialEditorDialog.h.
Referenced by MaterialEditorDialog(), currentIndex(), fill(), and setCurrentMaterial().