BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Definition at line 24 of file MaterialItems.h.
Signals | |
void | materialAddedOrRemoved () |
void | materialChanged (MaterialItem *materialItem) |
Public Member Functions | |
MaterialItems (QObject *parent=nullptr) | |
~MaterialItems () | |
void | addMaterial (MaterialItem *material) |
Add the material and take ownership of it. More... | |
MaterialItem * | addRefractiveMaterial (const QString &name, double delta, double beta) |
MaterialItem * | addSLDMaterial (const QString &name, double sld, double abs_term) |
void | clear () |
MaterialItems * | createCopy () const |
MaterialItem * | defaultMaterial () const |
void | initFrom (const MaterialItems &from) |
Copies the complete content, emitting signals for existing and changed materials. More... | |
MaterialItem * | insertCopy (const MaterialItem &material) |
Inserts a copy of the given material and returns the newly inserted item. More... | |
MaterialItem * | materialFromIdentifier (const QString &identifier) const |
MaterialItem * | materialFromName (const QString &name) const |
const QVector< MaterialItem * > & | materialItems () const |
bool | operator!= (const MaterialItems &other) const |
bool | operator== (const MaterialItems &other) const |
Compares for complete equality (same material identifiers, same order of materials,...) More... | |
void | removeMaterial (const QString &identifier) |
void | removeMaterial (MaterialItem *materialItem) |
void | serialize (Streamer &s) |
Private Member Functions | |
void | addMaterial (MaterialItem *material, bool signalAdding) |
Add the material and take ownership of it. More... | |
Private Attributes | |
QVector< MaterialItem * > | m_materialItems |
all materials (owned by this class) More... | |
|
explicit |
Definition at line 47 of file MaterialItems.cpp.
Referenced by createCopy().
MaterialItems::~MaterialItems | ( | ) |
Definition at line 52 of file MaterialItems.cpp.
References clear().
void MaterialItems::addMaterial | ( | MaterialItem * | material | ) |
Add the material and take ownership of it.
Definition at line 63 of file MaterialItems.cpp.
Referenced by addRefractiveMaterial(), addSLDMaterial(), initFrom(), and insertCopy().
|
private |
Add the material and take ownership of it.
In the given flag the signal "materialAddedOrRemoved" can be suppressed.
Definition at line 68 of file MaterialItems.cpp.
References MaterialItem::dataChanged(), m_materialItems, materialAddedOrRemoved(), and materialChanged().
MaterialItem * MaterialItems::addRefractiveMaterial | ( | const QString & | name, |
double | delta, | ||
double | beta | ||
) |
Definition at line 89 of file MaterialItems.cpp.
References addMaterial(), and GUI::RealSpace::Particles::name().
Referenced by MaterialEditorModel::addRefractiveMaterial(), and MultiLayerItem::addStandardMaterials().
MaterialItem * MaterialItems::addSLDMaterial | ( | const QString & | name, |
double | sld, | ||
double | abs_term | ||
) |
Definition at line 100 of file MaterialItems.cpp.
References addMaterial(), and GUI::RealSpace::Particles::name().
Referenced by MaterialEditorModel::addSLDMaterial().
void MaterialItems::clear | ( | ) |
Definition at line 57 of file MaterialItems.cpp.
References m_materialItems.
Referenced by ~MaterialItems(), and serialize().
MaterialItems * MaterialItems::createCopy | ( | ) | const |
Definition at line 79 of file MaterialItems.cpp.
References MaterialItems(), and m_materialItems.
MaterialItem * MaterialItems::defaultMaterial | ( | ) | const |
Definition at line 144 of file MaterialItems.cpp.
References materialItems().
Referenced by ParticleCoreShellItem::createCore(), and ParticleCoreShellItem::createShell().
void MaterialItems::initFrom | ( | const MaterialItems & | from | ) |
Copies the complete content, emitting signals for existing and changed materials.
Definition at line 170 of file MaterialItems.cpp.
References addMaterial(), m_materialItems, materialAddedOrRemoved(), materialFromIdentifier(), and materialItems().
Referenced by MaterialEditorDialog::MaterialEditorDialog(), and MaterialEditorDialog::accept().
MaterialItem * MaterialItems::insertCopy | ( | const MaterialItem & | material | ) |
Inserts a copy of the given material and returns the newly inserted item.
The copy will have a different material identifier and a different name.
Definition at line 129 of file MaterialItems.cpp.
References addMaterial(), and MaterialItem::matItemName().
Referenced by MaterialEditorModel::cloneMaterial().
|
signal |
Referenced by addMaterial(), initFrom(), and removeMaterial().
|
signal |
Referenced by LayerForm::LayerForm(), and addMaterial().
MaterialItem * MaterialItems::materialFromIdentifier | ( | const QString & | identifier | ) | const |
Definition at line 120 of file MaterialItems.cpp.
References m_materialItems.
Referenced by initFrom(), ItemWithMaterial::materialItem(), and removeMaterial().
MaterialItem * MaterialItems::materialFromName | ( | const QString & | name | ) | const |
Definition at line 111 of file MaterialItems.cpp.
References m_materialItems, and GUI::RealSpace::Particles::name().
Referenced by RealSpaceCanvas::updateScene().
const QVector< MaterialItem * > & MaterialItems::materialItems | ( | ) | const |
Definition at line 139 of file MaterialItems.cpp.
References m_materialItems.
Referenced by ParameterTreeBuilder::addMaterials(), MaterialEditorModel::data(), defaultMaterial(), MaterialEditorModel::indexFromMaterial(), initFrom(), GUI::Transform::FromCore::itemizeSample(), MaterialEditorModel::materialFromIndex(), and MaterialEditorModel::rowCount().
bool MaterialItems::operator!= | ( | const MaterialItems & | other | ) | const |
Definition at line 218 of file MaterialItems.cpp.
References operator==(), and other.
bool MaterialItems::operator== | ( | const MaterialItems & | other | ) | const |
Compares for complete equality (same material identifiers, same order of materials,...)
Definition at line 206 of file MaterialItems.cpp.
References m_materialItems, and other.
Referenced by operator!=().
void MaterialItems::removeMaterial | ( | const QString & | identifier | ) |
Definition at line 150 of file MaterialItems.cpp.
References materialFromIdentifier().
Referenced by MaterialEditorModel::removeMaterial().
void MaterialItems::removeMaterial | ( | MaterialItem * | materialItem | ) |
Definition at line 155 of file MaterialItems.cpp.
References m_materialItems, and materialAddedOrRemoved().
void MaterialItems::serialize | ( | Streamer & | s | ) |
Definition at line 162 of file MaterialItems.cpp.
References Streamer::assertVersion(), clear(), m_materialItems, Serialize::rwVector(), and Streamer::xmlReader().
|
private |
all materials (owned by this class)
Definition at line 76 of file MaterialItems.h.
Referenced by addMaterial(), clear(), createCopy(), initFrom(), materialFromIdentifier(), materialFromName(), materialItems(), operator==(), removeMaterial(), and serialize().