Skip to content
Snippets Groups Projects
Commit a78e8009 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

inline LayerEditorUtil::addMagnetizationToGrid

parent b5b56195
No related branches found
No related tags found
1 merge request!2056inline LayerEditorUtil::addMagnetizationToGrid
Pipeline #116124 passed
......@@ -100,19 +100,6 @@ void LayerEditorUtil::addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firs
addSpacer);
}
void LayerEditorUtil::addMagnetizationToGrid(
QGridLayout* m_gridLayout, int firstCol, VectorProperty& v,
std::function<void(double, DoubleProperty&)> setNewValue, bool vertically, bool addSpacer,
bool with_z)
{
if (with_z)
addMultiPropertyToGrid(m_gridLayout, firstCol, {&v.x(), &v.y(), &v.z()}, setNewValue,
vertically, addSpacer);
else
addMultiPropertyToGrid(m_gridLayout, firstCol, {&v.x(), &v.y()}, setNewValue, vertically,
addSpacer);
}
QWidget* LayerEditorUtil::createWidgetForItemWithParticles(QWidget* parentWidget,
ItemWithParticles* itemWithParticles,
bool allowAbundance,
......
......@@ -54,10 +54,6 @@ void addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firstCol,
const DoubleProperties& valueProperties, SampleEditorController* ec,
bool addSpacer);
void addMagnetizationToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v,
std::function<void(double, DoubleProperty&)> setNewValue,
bool vertically, bool addSpacer, bool with_z);
QWidget* createWidgetForItemWithParticles(QWidget* parentWidget,
ItemWithParticles* itemWithParticles, bool allowAbundance,
SampleEditorController* ec, bool allowRemove = true);
......
......@@ -120,12 +120,14 @@ void MaterialInplaceForm::createWidgets()
// Processing z-magnetization is not implemented yet (see issue #654)
const LayerItem* layer_item = dynamic_cast<LayerItem*>(m_item);
VectorProperty& v = material->magnetization();
if (layer_item && !layer_item->isTopLayer())
LayerEditorUtil::addMagnetizationToGrid(m_layout, col, material->magnetization(),
setNewValue, true, false, false);
LayerEditorUtil::addMultiPropertyToGrid(m_layout, col, {&v.x(), &v.y()}, setNewValue, true,
false);
if (!layer_item)
LayerEditorUtil::addMagnetizationToGrid(m_layout, col, material->magnetization(),
setNewValue, true, false, true);
LayerEditorUtil::addMultiPropertyToGrid(m_layout, col, {&v.x(), &v.y(), &v.z()},
setNewValue, true, false);
// -- Create UI for material selection button
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