From 667d2f000abb6e1aa9595cc174b434d2e95eedd2 Mon Sep 17 00:00:00 2001
From: Matthias Puchner <github@mpuchner.de>
Date: Sun, 6 Feb 2022 15:07:33 +0100
Subject: [PATCH] continued

---
 GUI/Model/Item/ItemWithMaterial.cpp           |  2 +-
 GUI/Model/Item/JobItem.h                      |  2 +-
 GUI/Model/Item/MultiLayerItem.h               |  2 +-
 GUI/Model/Item/ParameterTreeItems.cpp         |  2 +-
 GUI/Model/Item/ParticleCoreShellItem.cpp      |  2 +-
 .../{MaterialModel.cpp => MaterialItems.cpp}  |  2 +-
 .../{MaterialModel.h => MaterialItems.h}      |  6 +--
 GUI/View/FromDomain/GUISampleBuilder.cpp      |  2 +-
 .../MaterialEditor/MaterialEditorDialog.cpp   |  2 +-
 .../MaterialEditor/MaterialEditorModel.cpp    |  2 +-
 GUI/View/SampleDesigner/LayerForm.cpp         |  4 +-
 .../SampleDesigner/MaterialInplaceForm.cpp    |  2 +-
 .../SampleDesigner/SampleEditorController.cpp | 24 +++++-----
 .../SampleDesigner/SampleEditorController.h   |  2 +-
 GUI/View/Toplevel/SessionModelView.cpp        |  2 +-
 Tests/Functional/GUI/Check.cpp                |  2 +-
 ...aterialModel.cpp => TestMaterialItems.cpp} | 22 +++++-----
 Tests/Unit/GUI/TestRealSpaceBuilderUtils.cpp  | 44 +++++++++----------
 Tests/Unit/GUI/TestSessionModel.cpp           |  3 --
 19 files changed, 63 insertions(+), 66 deletions(-)
 rename GUI/Model/Model/{MaterialModel.cpp => MaterialItems.cpp} (99%)
 rename GUI/Model/Model/{MaterialModel.h => MaterialItems.h} (94%)
 rename Tests/Unit/GUI/{TestMaterialModel.cpp => TestMaterialItems.cpp} (92%)

diff --git a/GUI/Model/Item/ItemWithMaterial.cpp b/GUI/Model/Item/ItemWithMaterial.cpp
index 1c8701d142b..27b285ebc9a 100644
--- a/GUI/Model/Item/ItemWithMaterial.cpp
+++ b/GUI/Model/Item/ItemWithMaterial.cpp
@@ -15,7 +15,7 @@
 #include "GUI/Model/Item/ItemWithMaterial.h"
 #include "Base/Util/Assert.h"
 #include "GUI/Model/Item/MaterialItem.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 
 void ItemWithMaterial::setMaterial(const MaterialItem* materialItem)
 {
diff --git a/GUI/Model/Item/JobItem.h b/GUI/Model/Item/JobItem.h
index 757361f25a7..493f82b36da 100644
--- a/GUI/Model/Item/JobItem.h
+++ b/GUI/Model/Item/JobItem.h
@@ -19,7 +19,7 @@
 #include "GUI/Model/Item/InstrumentItems.h"
 #include "GUI/Model/Item/MultiLayerItem.h"
 #include "GUI/Model/Item/ParameterTreeItems.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Model/Model/SessionModel.h" // call to model() from templated fct
 #include "GUI/Support/Data/JobStatus.h"   // enum cannot be forward declared
 #include "GUI/Support/Data/SimulationOptionsItem.h"
diff --git a/GUI/Model/Item/MultiLayerItem.h b/GUI/Model/Item/MultiLayerItem.h
index e7f4f27c42b..755272913ae 100644
--- a/GUI/Model/Item/MultiLayerItem.h
+++ b/GUI/Model/Item/MultiLayerItem.h
@@ -15,7 +15,7 @@
 #ifndef BORNAGAIN_GUI_MODEL_ITEM_MULTILAYERITEM_H
 #define BORNAGAIN_GUI_MODEL_ITEM_MULTILAYERITEM_H
 
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Model/Types/DoubleProperty.h"
 #include "GUI/Model/Types/VectorProperty.h"
 #include <QString>
diff --git a/GUI/Model/Item/ParameterTreeItems.cpp b/GUI/Model/Item/ParameterTreeItems.cpp
index 2127bb2a96d..1914b0ea714 100644
--- a/GUI/Model/Item/ParameterTreeItems.cpp
+++ b/GUI/Model/Item/ParameterTreeItems.cpp
@@ -15,7 +15,7 @@
 #include "GUI/Model/Item/ParameterTreeItems.h"
 #include "GUI/Model/Item/JobItem.h"
 #include "GUI/Model/Item/MaterialItem.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Model/Types/VectorDescriptor.h"
 #include "GUI/Support/Data/XML.h"
 #include "GUI/Util/DeserializationException.h"
diff --git a/GUI/Model/Item/ParticleCoreShellItem.cpp b/GUI/Model/Item/ParticleCoreShellItem.cpp
index aac4907ea3b..fc04b7b2c05 100644
--- a/GUI/Model/Item/ParticleCoreShellItem.cpp
+++ b/GUI/Model/Item/ParticleCoreShellItem.cpp
@@ -14,7 +14,7 @@
 
 #include "GUI/Model/Item/ParticleCoreShellItem.h"
 #include "GUI/Model/Item/ParticleItem.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Model/Types/DoubleDescriptor.h"
 #include "GUI/Support/Type/VariantUtil.h"
 #include "GUI/Util/Error.h"
diff --git a/GUI/Model/Model/MaterialModel.cpp b/GUI/Model/Model/MaterialItems.cpp
similarity index 99%
rename from GUI/Model/Model/MaterialModel.cpp
rename to GUI/Model/Model/MaterialItems.cpp
index 7274022e9a1..8980623c8b4 100644
--- a/GUI/Model/Model/MaterialModel.cpp
+++ b/GUI/Model/Model/MaterialItems.cpp
@@ -12,7 +12,7 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "Base/Util/Assert.h"
 #include "GUI/Model/Item/MaterialItem.h"
 #include "GUI/Model/XML/Serializer.h"
diff --git a/GUI/Model/Model/MaterialModel.h b/GUI/Model/Model/MaterialItems.h
similarity index 94%
rename from GUI/Model/Model/MaterialModel.h
rename to GUI/Model/Model/MaterialItems.h
index 35c46e941fd..d72f45123d8 100644
--- a/GUI/Model/Model/MaterialModel.h
+++ b/GUI/Model/Model/MaterialItems.h
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#ifndef BORNAGAIN_GUI_MODEL_MODEL_MATERIALMODEL_H
-#define BORNAGAIN_GUI_MODEL_MODEL_MATERIALMODEL_H
+#ifndef BORNAGAIN_GUI_MODEL_MODEL_MATERIALITEMS_H
+#define BORNAGAIN_GUI_MODEL_MODEL_MATERIALITEMS_H
 
 #include <QObject>
 #include <QVector>
@@ -80,4 +80,4 @@ private:
     QVector<MaterialItem*> m_materialItems; //!< all materials (owned by this class)
 };
 
-#endif // BORNAGAIN_GUI_MODEL_MODEL_MATERIALMODEL_H
+#endif // BORNAGAIN_GUI_MODEL_MODEL_MATERIALITEMS_H
diff --git a/GUI/View/FromDomain/GUISampleBuilder.cpp b/GUI/View/FromDomain/GUISampleBuilder.cpp
index 4f916525805..a1d59b3ce61 100644
--- a/GUI/View/FromDomain/GUISampleBuilder.cpp
+++ b/GUI/View/FromDomain/GUISampleBuilder.cpp
@@ -21,7 +21,7 @@
 #include "GUI/Model/Item/ParticleCoreShellItem.h"
 #include "GUI/Model/Item/ParticleItem.h"
 #include "GUI/Model/Item/ParticleLayoutItem.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Model/Types/DoubleDescriptor.h"
 #include "GUI/View/FromDomain/FromDomain.h"
 #include "Sample/Aggregate/ParticleLayout.h"
diff --git a/GUI/View/MaterialEditor/MaterialEditorDialog.cpp b/GUI/View/MaterialEditor/MaterialEditorDialog.cpp
index a773dc397d2..cc1619e5f20 100644
--- a/GUI/View/MaterialEditor/MaterialEditorDialog.cpp
+++ b/GUI/View/MaterialEditor/MaterialEditorDialog.cpp
@@ -17,7 +17,7 @@
 #include "GUI/Model/Item/ItemWithMaterial.h"
 #include "GUI/Model/Item/MaterialItem.h"
 #include "GUI/Model/Item/MultiLayerItem.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Model/Model/SampleModel.h"
 #include "GUI/Model/Types/DoubleDescriptor.h"
 #include "GUI/View/MaterialEditor/MaterialEditorModel.h"
diff --git a/GUI/View/MaterialEditor/MaterialEditorModel.cpp b/GUI/View/MaterialEditor/MaterialEditorModel.cpp
index c816a4bc8b0..f580173089b 100644
--- a/GUI/View/MaterialEditor/MaterialEditorModel.cpp
+++ b/GUI/View/MaterialEditor/MaterialEditorModel.cpp
@@ -14,7 +14,7 @@
 
 #include "GUI/View/MaterialEditor/MaterialEditorModel.h"
 #include "GUI/Model/Item/MaterialItem.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Model/Types/DoubleDescriptor.h"
 #include <QApplication>
 #include <QFontMetrics>
diff --git a/GUI/View/SampleDesigner/LayerForm.cpp b/GUI/View/SampleDesigner/LayerForm.cpp
index 1985e0753a0..d38b49f7714 100644
--- a/GUI/View/SampleDesigner/LayerForm.cpp
+++ b/GUI/View/SampleDesigner/LayerForm.cpp
@@ -16,7 +16,7 @@
 #include "GUI/Model/Item/LayerItem.h"
 #include "GUI/Model/Item/MaterialItem.h"
 #include "GUI/Model/Item/MultiLayerItem.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Util/ActionFactory.h"
 #include "GUI/View/SampleDesigner/MaterialInplaceForm.h"
 #include "GUI/View/SampleDesigner/ParticleLayoutForm.h"
@@ -95,7 +95,7 @@ LayerForm::LayerForm(QWidget* parent, LayerItem* layer, SampleEditorController*
 
     // listen to changes in materials to update the title (contains the material name). Necessary
     // to reflect e.g. a name change done in the material editor.
-    connect(ec->materialModel(), &MaterialItems::materialChanged, this, &LayerForm::updateTitle);
+    connect(ec->materialItems(), &MaterialItems::materialChanged, this, &LayerForm::updateTitle);
 
     updateLayerPositionDependentElements();
 }
diff --git a/GUI/View/SampleDesigner/MaterialInplaceForm.cpp b/GUI/View/SampleDesigner/MaterialInplaceForm.cpp
index fba8521b119..f2529e15d54 100644
--- a/GUI/View/SampleDesigner/MaterialInplaceForm.cpp
+++ b/GUI/View/SampleDesigner/MaterialInplaceForm.cpp
@@ -16,7 +16,7 @@
 #include "Base/Util/Assert.h"
 #include "GUI/Model/Item/ItemWithMaterial.h"
 #include "GUI/Model/Item/MaterialItem.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Model/Types/DoubleDescriptor.h"
 #include "GUI/Model/Types/VectorDescriptor.h"
 #include "GUI/View/Edit/DoubleLineEdit.h"
diff --git a/GUI/View/SampleDesigner/SampleEditorController.cpp b/GUI/View/SampleDesigner/SampleEditorController.cpp
index 632dd8c0747..0d0c9fdf2fc 100644
--- a/GUI/View/SampleDesigner/SampleEditorController.cpp
+++ b/GUI/View/SampleDesigner/SampleEditorController.cpp
@@ -22,7 +22,7 @@
 #include "GUI/Model/Item/ParticleItem.h"
 #include "GUI/Model/Item/ParticleLayoutItem.h"
 #include "GUI/Model/MakeItem/FormFactorItemCatalog.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Model/Project/ProjectDocument.h"
 #include "GUI/Model/Types/UIntDescriptor.h"
 #include "GUI/View/Edit/DoubleSpinBox.h"
@@ -101,7 +101,7 @@ void SampleEditorController::addLayer(LayerItem* before)
 
     // - create new layer
     LayerItem* layer = m_multiLayerItem->addLayer(rowInMultiLayer);
-    layer->setMaterial(materialModel()->defaultMaterial());
+    layer->setMaterial(materialItems()->defaultMaterial());
     layer->setColor(color);
 
     ASSERT(m_multiLayerForm);
@@ -212,30 +212,30 @@ void SampleEditorController::addParticle(ParticleCompositionItem* compositionIte
 ItemWithParticles*
 SampleEditorController::createAndInitParticle(FormFactorItemCatalog::Type formFactorType) const
 {
-    auto* newParticle = new ParticleItem(materialModel());
+    auto* newParticle = new ParticleItem(materialItems());
     newParticle->setFormFactor(FormFactorItemCatalog::create(formFactorType));
-    newParticle->setMaterial(materialModel()->defaultMaterial());
+    newParticle->setMaterial(materialItems()->defaultMaterial());
     return newParticle;
 }
 
 ItemWithParticles*
 SampleEditorController::createAndInitParticle(ItemWithParticlesCatalog::Type itemType) const
 {
-    auto* newItem = ItemWithParticlesCatalog::create(itemType, materialModel());
+    auto* newItem = ItemWithParticlesCatalog::create(itemType, materialItems());
 
     if (auto* p = dynamic_cast<ItemWithMaterial*>(newItem))
-        p->setMaterial(materialModel()->defaultMaterial());
+        p->setMaterial(materialItems()->defaultMaterial());
 
     if (auto* cs = dynamic_cast<ParticleCoreShellItem*>(newItem)) {
-        cs->createCore(materialModel());
-        cs->createShell(materialModel());
+        cs->createCore(materialItems());
+        cs->createShell(materialItems());
         cs->core()->setFormFactor(new CylinderItem());
         cs->shell()->setFormFactor(new CylinderItem());
     }
 
     if (auto* meso = dynamic_cast<MesoCrystalItem*>(newItem); meso && meso->basisParticle())
         if (auto* p = dynamic_cast<ItemWithMaterial*>(meso->basisParticle()))
-            p->setMaterial(materialModel()->defaultMaterial());
+            p->setMaterial(materialItems()->defaultMaterial());
 
     return newItem;
 }
@@ -246,7 +246,7 @@ void SampleEditorController::setCoreFormFactor(ParticleCoreShellForm* widget,
     auto* particleCoreShell = widget->coreShellItem();
 
     if (particleCoreShell->core() == nullptr)
-        particleCoreShell->createCore(materialModel());
+        particleCoreShell->createCore(materialItems());
 
     particleCoreShell->core()->setFormFactor(FormFactorItemCatalog::create(type));
     widget->createCoreWidgets();
@@ -260,7 +260,7 @@ void SampleEditorController::setShellFormFactor(ParticleCoreShellForm* widget,
     auto* particleCoreShell = widget->coreShellItem();
 
     if (particleCoreShell->shell() == nullptr)
-        particleCoreShell->createShell(materialModel());
+        particleCoreShell->createShell(materialItems());
 
     particleCoreShell->shell()->setFormFactor(FormFactorItemCatalog::create(type));
     widget->createShellWidgets();
@@ -346,7 +346,7 @@ QUndoStack* SampleEditorController::undoStack()
     return &m_undoStack;
 }
 
-MaterialItems* SampleEditorController::materialModel() const
+MaterialItems* SampleEditorController::materialItems() const
 {
     return &m_multiLayerItem->materialItems();
 }
diff --git a/GUI/View/SampleDesigner/SampleEditorController.h b/GUI/View/SampleDesigner/SampleEditorController.h
index 972409e0480..d3924778f18 100644
--- a/GUI/View/SampleDesigner/SampleEditorController.h
+++ b/GUI/View/SampleDesigner/SampleEditorController.h
@@ -68,7 +68,7 @@ public:
     QUndoStack* undoStack();
 
     //! The materials of the current document
-    MaterialItems* materialModel() const;
+    MaterialItems* materialItems() const;
 
     //! The current document
     ProjectDocument* projectDocument() const;
diff --git a/GUI/View/Toplevel/SessionModelView.cpp b/GUI/View/Toplevel/SessionModelView.cpp
index 0f1101e67c9..744e20d6dfb 100644
--- a/GUI/View/Toplevel/SessionModelView.cpp
+++ b/GUI/View/Toplevel/SessionModelView.cpp
@@ -15,7 +15,7 @@
 #include "GUI/View/Toplevel/SessionModelView.h"
 #include "GUI/Model/Item/ItemWithMaterial.h"
 #include "GUI/Model/Model/JobModel.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Model/Model/RealDataModel.h"
 #include "GUI/Model/Model/SampleModel.h"
 #include "GUI/Util/ComboProperty.h"
diff --git a/Tests/Functional/GUI/Check.cpp b/Tests/Functional/GUI/Check.cpp
index a8e45cb909b..2e68b9f4d5a 100644
--- a/Tests/Functional/GUI/Check.cpp
+++ b/Tests/Functional/GUI/Check.cpp
@@ -21,7 +21,7 @@
 #include "Device/Histo/SimulationResult.h"
 #include "GUI/Model/Item/InstrumentItems.h"
 #include "GUI/Model/Item/MultiLayerItem.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Model/Model/SampleModel.h"
 #include "GUI/Model/To/DomainSimulationBuilder.h"
 #include "GUI/Support/Data/SimulationOptionsItem.h"
diff --git a/Tests/Unit/GUI/TestMaterialModel.cpp b/Tests/Unit/GUI/TestMaterialItems.cpp
similarity index 92%
rename from Tests/Unit/GUI/TestMaterialModel.cpp
rename to Tests/Unit/GUI/TestMaterialItems.cpp
index b39a67508d5..bde0154730a 100644
--- a/Tests/Unit/GUI/TestMaterialModel.cpp
+++ b/Tests/Unit/GUI/TestMaterialItems.cpp
@@ -1,14 +1,14 @@
 #include "GUI/Model/Item/ItemUtils.h"
 #include "GUI/Model/Item/MaterialItem.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Model/Types/DoubleDescriptor.h"
 #include "Tests/GTestWrapper/google_test.h"
 #include <memory>
 
-class TestMaterialModel : public ::testing::Test {
+class TestMaterialItems : public ::testing::Test {
 };
 
-TEST_F(TestMaterialModel, addRefractiveMaterial)
+TEST_F(TestMaterialItems, addRefractiveMaterial)
 {
     std::unique_ptr<MaterialItems> model(new MaterialItems);
 
@@ -26,7 +26,7 @@ TEST_F(TestMaterialModel, addRefractiveMaterial)
     EXPECT_EQ(material->beta(), beta);
 }
 
-TEST_F(TestMaterialModel, addSLDMaterial)
+TEST_F(TestMaterialItems, addSLDMaterial)
 {
     std::unique_ptr<MaterialItems> model(new MaterialItems);
 
@@ -44,7 +44,7 @@ TEST_F(TestMaterialModel, addSLDMaterial)
     EXPECT_EQ(material->sldIm(), sld_imag);
 }
 
-TEST_F(TestMaterialModel, cloneMaterialRefractive)
+TEST_F(TestMaterialItems, cloneMaterialRefractive)
 {
     std::unique_ptr<MaterialItems> model(new MaterialItems);
 
@@ -71,7 +71,7 @@ TEST_F(TestMaterialModel, cloneMaterialRefractive)
     EXPECT_EQ(material->beta(), beta);
 }
 
-TEST_F(TestMaterialModel, cloneMaterialSLD)
+TEST_F(TestMaterialItems, cloneMaterialSLD)
 {
     std::unique_ptr<MaterialItems> model(new MaterialItems);
 
@@ -100,7 +100,7 @@ TEST_F(TestMaterialModel, cloneMaterialSLD)
 
 //! Checks the method which returns MaterialItem from known identifier.
 
-TEST_F(TestMaterialModel, materialFromIdentifier)
+TEST_F(TestMaterialItems, materialFromIdentifier)
 {
     MaterialItems model;
     MaterialItem* material1 = model.addRefractiveMaterial("aaa", 1.0, 2.0);
@@ -112,7 +112,7 @@ TEST_F(TestMaterialModel, materialFromIdentifier)
 
 //! Checks the method which returns MaterialItem from material name.
 
-TEST_F(TestMaterialModel, materialFromName)
+TEST_F(TestMaterialItems, materialFromName)
 {
     MaterialItems model;
     MaterialItem* material1 = model.addRefractiveMaterial("aaa", 1.0, 2.0);
@@ -124,7 +124,7 @@ TEST_F(TestMaterialModel, materialFromName)
 
 //! Default MaterialProperty construction.
 
-TEST_F(TestMaterialModel, defaultMaterialProperty)
+TEST_F(TestMaterialItems, defaultMaterialProperty)
 {
     MaterialItems model;
 
@@ -137,7 +137,7 @@ TEST_F(TestMaterialModel, defaultMaterialProperty)
     EXPECT_EQ(model.defaultMaterial(), mat1);
 }
 
-TEST_F(TestMaterialModel, serializeRefractiveMaterial)
+TEST_F(TestMaterialItems, serializeRefractiveMaterial)
 {
     MaterialItem material;
     material.setRefractiveIndex(11, 12);
@@ -162,7 +162,7 @@ TEST_F(TestMaterialModel, serializeRefractiveMaterial)
     EXPECT_EQ(target.magnetization(), R3(1, 2, 3));
 }
 
-TEST_F(TestMaterialModel, serializeSLDMaterial)
+TEST_F(TestMaterialItems, serializeSLDMaterial)
 {
     MaterialItem material;
     material.setScatteringLengthDensity(complex_t(11, 12));
diff --git a/Tests/Unit/GUI/TestRealSpaceBuilderUtils.cpp b/Tests/Unit/GUI/TestRealSpaceBuilderUtils.cpp
index a9ab93adb84..9aea6243d7f 100644
--- a/Tests/Unit/GUI/TestRealSpaceBuilderUtils.cpp
+++ b/Tests/Unit/GUI/TestRealSpaceBuilderUtils.cpp
@@ -3,7 +3,7 @@
 #include "GUI/Model/Item/ParticleItem.h"
 #include "GUI/Model/Item/ParticleLayoutItem.h"
 #include "GUI/Model/Model/ApplicationModels.h"
-#include "GUI/Model/Model/MaterialModel.h"
+#include "GUI/Model/Model/MaterialItems.h"
 #include "GUI/Model/Model/SampleModel.h"
 #include "GUI/View/Realspace/Particle3DContainer.h"
 #include "GUI/View/Realspace/RealSpaceBuilder.h"
@@ -34,19 +34,19 @@ TEST_F(TestRealSpaceBuilderUtils, RealSpaceModelandParticle)
 
 TEST_F(TestRealSpaceBuilderUtils, computeCumulativeAbundances)
 {
-    MaterialItems materialModel;
-    auto* layout = new ParticleLayoutItem(&materialModel);
+    MaterialItems materialItems;
+    auto* layout = new ParticleLayoutItem(&materialItems);
 
-    auto* particle1 = new ParticleItem(&materialModel);
+    auto* particle1 = new ParticleItem(&materialItems);
     layout->addParticle(particle1);
-    auto* particle2 = new ParticleItem(&materialModel);
+    auto* particle2 = new ParticleItem(&materialItems);
     layout->addParticle(particle2);
 
     particle1->setAbundance(8.0);
     particle2->setAbundance(2.0);
 
     EXPECT_EQ(GUI::RealSpace::BuilderUtils(
-                  [&](const QString& n) { return materialModel.materialFromName(n)->color(); })
+                  [&](const QString& n) { return materialItems.materialFromName(n)->color(); })
                   .computeCumulativeAbundances(*layout)
                   .last(),
               10.0);
@@ -151,11 +151,11 @@ TEST_F(TestRealSpaceBuilderUtils, Particle3DContainer)
 TEST_F(TestRealSpaceBuilderUtils, singleParticle3DContainer)
 {
     ApplicationModels models;
-    MaterialItems materialModel;
-    materialModel.addRefractiveMaterial("Default", 1e-3, 1e-5);
+    MaterialItems materialItems;
+    materialItems.addRefractiveMaterial("Default", 1e-3, 1e-5);
 
-    auto particleItem = std::make_unique<ParticleItem>(&materialModel);
-    particleItem->setMaterial(materialModel.defaultMaterial());
+    auto particleItem = std::make_unique<ParticleItem>(&materialItems);
+    particleItem->setMaterial(materialItems.defaultMaterial());
     EXPECT_EQ(particleItem->abundance(), 1.0);
     EXPECT_TRUE(dynamic_cast<CylinderItem*>(particleItem->formfactor_at_bottom()));
 
@@ -167,7 +167,7 @@ TEST_F(TestRealSpaceBuilderUtils, singleParticle3DContainer)
     // Create a 3D particle from particleItem and associate it to a Particle3DContainer object
     auto particle = particleItem->createParticle();
     auto singleParticle3DContainer = GUI::RealSpace::BuilderUtils([&](const QString& n) {
-                                         return materialModel.materialFromName(n)->color();
+                                         return materialItems.materialFromName(n)->color();
                                      }).singleParticle3DContainer(*particle, 8);
 
     EXPECT_EQ(singleParticle3DContainer.containerSize(), 1u);
@@ -179,16 +179,16 @@ TEST_F(TestRealSpaceBuilderUtils, singleParticle3DContainer)
 TEST_F(TestRealSpaceBuilderUtils, particle3DContainerVector)
 {
     ApplicationModels models;
-    MaterialItems materialModel;
-    materialModel.addRefractiveMaterial("Default", 1e-3, 1e-5);
+    MaterialItems materialItems;
+    materialItems.addRefractiveMaterial("Default", 1e-3, 1e-5);
 
-    auto layout = std::make_unique<ParticleLayoutItem>(&materialModel);
-    auto* particle1 = new ParticleItem(&materialModel);
-    auto* particle2 = new ParticleItem(&materialModel);
-    auto* particle3 = new ParticleItem(&materialModel);
-    particle1->setMaterial(materialModel.defaultMaterial());
-    particle2->setMaterial(materialModel.defaultMaterial());
-    particle3->setMaterial(materialModel.defaultMaterial());
+    auto layout = std::make_unique<ParticleLayoutItem>(&materialItems);
+    auto* particle1 = new ParticleItem(&materialItems);
+    auto* particle2 = new ParticleItem(&materialItems);
+    auto* particle3 = new ParticleItem(&materialItems);
+    particle1->setMaterial(materialItems.defaultMaterial());
+    particle2->setMaterial(materialItems.defaultMaterial());
+    particle3->setMaterial(materialItems.defaultMaterial());
 
     layout->addParticle(particle1);
     layout->addParticle(particle2);
@@ -199,7 +199,7 @@ TEST_F(TestRealSpaceBuilderUtils, particle3DContainerVector)
     particle3->setAbundance(2.0);
 
     double total_abundance = GUI::RealSpace::BuilderUtils([&](const QString& n) {
-                                 return materialModel.materialFromName(n)->color();
+                                 return materialItems.materialFromName(n)->color();
                              })
                                  .computeCumulativeAbundances(*layout)
                                  .last();
@@ -210,7 +210,7 @@ TEST_F(TestRealSpaceBuilderUtils, particle3DContainerVector)
     particle3->setFormFactorType<Pyramid4Item>();
 
     auto particle3DContainer_vector = GUI::RealSpace::BuilderUtils([&](const QString& n) {
-                                          return materialModel.materialFromName(n)->color();
+                                          return materialItems.materialFromName(n)->color();
                                       }).particle3DContainerVector(*layout);
 
     EXPECT_EQ(particle3DContainer_vector.size(), static_cast<size_t>(3));
diff --git a/Tests/Unit/GUI/TestSessionModel.cpp b/Tests/Unit/GUI/TestSessionModel.cpp
index b465ea5047f..4e67ec69c0f 100644
--- a/Tests/Unit/GUI/TestSessionModel.cpp
+++ b/Tests/Unit/GUI/TestSessionModel.cpp
@@ -5,7 +5,6 @@
 #include "GUI/Model/Item/MaskItems.h"
 #include "GUI/Model/Item/MultiLayerItem.h"
 #include "GUI/Model/Model/JobModel.h"
-#include "GUI/Model/Model/MaterialModel.h"
 #include "GUI/Model/Model/SampleModel.h"
 #include "GUI/Support/Data/SessionItemTags.h"
 #include "Tests/GTestWrapper/google_test.h"
@@ -48,8 +47,6 @@ TEST_F(TestSessionModel, setData)
 
 TEST_F(TestSessionModel, copyItem)
 {
-    std::unique_ptr<MaterialItems> P_materialModel(new MaterialItems());
-
     auto multilayer1 = std::make_unique<MultiLayerItem>();
     multilayer1->setSampleName("multilayer1");
     multilayer1->addStandardMaterials();
-- 
GitLab