Skip to content
Snippets Groups Projects
Commit b9c2f47b authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

allow magnetization for particles in fronting media

parent 430b90ab
No related branches found
No related tags found
2 merge requests!2050rebase main on r21/v21.1,!2047<root>/CMakeLists.txt: add 'BornAgain_LIBRARIES' cached variable to store...
...@@ -135,16 +135,17 @@ void LayerEditorUtil::addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, V ...@@ -135,16 +135,17 @@ void LayerEditorUtil::addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, V
vertically, addSpacer); vertically, addSpacer);
} }
void LayerEditorUtil::addMagnetizationNoZToGrid( void LayerEditorUtil::addMagnetizationToGrid(
QGridLayout* m_gridLayout, int firstCol, VectorProperty& v, QGridLayout* m_gridLayout, int firstCol, VectorProperty& v,
std::function<void(double, DoubleProperty&)> setNewValue, bool vertically, bool addSpacer) std::function<void(double, DoubleProperty&)> setNewValue, bool vertically, bool addSpacer,
bool with_z)
{ {
// Setting z-component is temporary disabled (see issue #654) if (with_z)
// When interaction with magnetic field in fronting medium is implemented, addMultiPropertyToGrid(m_gridLayout, firstCol, {&v.x(), &v.y(), &v.z()}, setNewValue,
// delete this method and use 'addVectorToGrid' instead vertically, addSpacer);
else
addMultiPropertyToGrid(m_gridLayout, firstCol, {&v.x(), &v.y()}, setNewValue, vertically, addMultiPropertyToGrid(m_gridLayout, firstCol, {&v.x(), &v.y()}, setNewValue, vertically,
addSpacer); addSpacer);
} }
QLabel* LayerEditorUtil::createBoldLabel(const QString& text) QLabel* LayerEditorUtil::createBoldLabel(const QString& text)
......
...@@ -64,9 +64,9 @@ void addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v, ...@@ -64,9 +64,9 @@ void addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v,
void addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v, void addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v,
std::function<void(double, DoubleProperty&)> setNewValue, bool vertically, std::function<void(double, DoubleProperty&)> setNewValue, bool vertically,
bool addSpacer); bool addSpacer);
void addMagnetizationNoZToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v, void addMagnetizationToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v,
std::function<void(double, DoubleProperty&)> setNewValue, std::function<void(double, DoubleProperty&)> setNewValue,
bool vertically, bool addSpacer); bool vertically, bool addSpacer, bool with_z);
QLabel* createBoldLabel(const QString& text); QLabel* createBoldLabel(const QString& text);
......
...@@ -120,12 +120,13 @@ void MaterialInplaceForm::createWidgets() ...@@ -120,12 +120,13 @@ void MaterialInplaceForm::createWidgets()
}; };
// Processing z-magnetization is not implemented yet (see issue #654) // Processing z-magnetization is not implemented yet (see issue #654)
// LayerEditorUtil::addVectorToGrid(m_layout, col, material->magnetization(), setNewValue, true,
// false); When implemented, rm following lines and use 'addVectorToGrid'
const LayerItem* layer_item = dynamic_cast<LayerItem*>(m_item); const LayerItem* layer_item = dynamic_cast<LayerItem*>(m_item);
if (layer_item && !layer_item->isTopLayer()) if (layer_item && !layer_item->isTopLayer())
LayerEditorUtil::addMagnetizationNoZToGrid(m_layout, col, material->magnetization(), LayerEditorUtil::addMagnetizationToGrid(m_layout, col, material->magnetization(),
setNewValue, true, false); setNewValue, true, false, false);
if (!layer_item)
LayerEditorUtil::addMagnetizationToGrid(m_layout, col, material->magnetization(),
setNewValue, true, false, true);
// -- Create UI for material selection button // -- Create UI for material selection button
auto* btn = new QPushButton("...", this); auto* btn = new QPushButton("...", this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment