diff --git a/.github/workflows/actions/runCPPTests/runAllTests/action.yml b/.github/workflows/actions/runCPPTests/runAllTests/action.yml
index a52adbd355..bdb434c220 100644
--- a/.github/workflows/actions/runCPPTests/runAllTests/action.yml
+++ b/.github/workflows/actions/runCPPTests/runAllTests/action.yml
@@ -47,6 +47,13 @@ runs:
testCommand: ${{ inputs.builddir }}/tests/Tests_run --gtest_output=json:${{ inputs.reportdir }}core_gtest_results.json
testLogFile: ${{ inputs.reportdir }}core_gtest_test_log.txt
testName: Core
+ - name: C++ Material tests
+ id: material
+ uses: ./.github/workflows/actions/runCPPTests/runSingleTest
+ with:
+ testCommand: ${{ inputs.builddir }}/tests/Material_tests_run --gtest_output=json:${{ inputs.reportdir }}material_gtest_results.json
+ testLogFile: ${{ inputs.reportdir }}material_gtest_test_log.txt
+ testName: Material
- name: C++ Mesh tests
id: mesh
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d1536fbc72..6e25357391 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,6 +51,7 @@ CheckInterModuleDependencies()
FreeCADLibpackChecks()
SetupDoxygen()
SetupLibFmt()
+SetupYamlCpp()
if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
SetupPython()
SetupPCL()
diff --git a/cMake/FreeCAD_Helpers/SetupLibYaml.cmake b/cMake/FreeCAD_Helpers/SetupLibYaml.cmake
new file mode 100644
index 0000000000..dcbc6439c7
--- /dev/null
+++ b/cMake/FreeCAD_Helpers/SetupLibYaml.cmake
@@ -0,0 +1,4 @@
+macro(SetupYamlCpp)
+ # -------------------------------- YamlCpp --------------------------------
+ find_package(yaml-cpp REQUIRED)
+endmacro(SetupYamlCpp)
diff --git a/src/Mod/Fem/Gui/AppFemGui.cpp b/src/Mod/Fem/Gui/AppFemGui.cpp
index d1dd8acf3f..c4f36d46a2 100644
--- a/src/Mod/Fem/Gui/AppFemGui.cpp
+++ b/src/Mod/Fem/Gui/AppFemGui.cpp
@@ -25,8 +25,8 @@
#include
#include
#include
-#include
#include
+#include
#include "DlgSettingsFemCcxImp.h"
#include "DlgSettingsFemElmerImp.h"
@@ -34,18 +34,25 @@
#include "DlgSettingsFemGeneralImp.h"
#include "DlgSettingsFemGmshImp.h"
#include "DlgSettingsFemInOutVtkImp.h"
-#include "DlgSettingsFemMaterialImp.h"
#include "DlgSettingsFemMystranImp.h"
#include "DlgSettingsFemZ88Imp.h"
#include "PropertyFemMeshItem.h"
#include "ViewProviderAnalysis.h"
+#include "ViewProviderFemMesh.h"
+#include "ViewProviderFemMeshShape.h"
+#include "ViewProviderFemMeshShapeNetgen.h"
+#include "ViewProviderSetElements.h"
+#include "ViewProviderSetFaces.h"
+#include "ViewProviderSetGeometry.h"
+#include "ViewProviderSetNodes.h"
+#include "ViewProviderSolver.h"
#include "ViewProviderFemConstraint.h"
#include "ViewProviderFemConstraintBearing.h"
#include "ViewProviderFemConstraintContact.h"
#include "ViewProviderFemConstraintDisplacement.h"
#include "ViewProviderFemConstraintFixed.h"
-#include "ViewProviderFemConstraintFluidBoundary.h"
#include "ViewProviderFemConstraintForce.h"
+#include "ViewProviderFemConstraintFluidBoundary.h"
#include "ViewProviderFemConstraintGear.h"
#include "ViewProviderFemConstraintHeatflux.h"
#include "ViewProviderFemConstraintInitialTemperature.h"
@@ -56,15 +63,7 @@
#include "ViewProviderFemConstraintSpring.h"
#include "ViewProviderFemConstraintTemperature.h"
#include "ViewProviderFemConstraintTransform.h"
-#include "ViewProviderFemMesh.h"
-#include "ViewProviderFemMeshShape.h"
-#include "ViewProviderFemMeshShapeNetgen.h"
#include "ViewProviderResult.h"
-#include "ViewProviderSetElements.h"
-#include "ViewProviderSetFaces.h"
-#include "ViewProviderSetGeometry.h"
-#include "ViewProviderSetNodes.h"
-#include "ViewProviderSolver.h"
#include "Workbench.h"
#ifdef FC_USE_VTK
@@ -178,7 +177,6 @@ PyMOD_INIT_FUNC(FemGui)
new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "FEM"));
new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "FEM"));
new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "FEM"));
- new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "FEM"));
// register preferences pages on Import-Export
new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "Import-Export"));
diff --git a/src/Mod/Fem/Gui/CMakeLists.txt b/src/Mod/Fem/Gui/CMakeLists.txt
index 625c85150f..af0fb7fcd6 100755
--- a/src/Mod/Fem/Gui/CMakeLists.txt
+++ b/src/Mod/Fem/Gui/CMakeLists.txt
@@ -1,8 +1,8 @@
-
# Many warnings caused by vtk
if(CMAKE_COMPILER_IS_CLANGXX)
add_compile_options(-Wno-pedantic) # needed for vtk headers
- if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.0)
+
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.0)
add_compile_options(-Wno-inconsistent-missing-override)
endif()
elseif(CMAKE_COMPILER_IS_GNUCXX)
@@ -15,12 +15,10 @@ else(MSVC)
add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H)
endif(MSVC)
-
if(BUILD_FEM_NETGEN)
add_definitions(-DFCWithNetgen)
endif(BUILD_FEM_NETGEN)
-
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/src
@@ -37,18 +35,15 @@ include_directories(
link_directories(${OCC_LIBRARY_DIR})
link_directories(${SMESH_LIB_PATH})
-
set(FemGui_LIBS
Fem
FreeCADGui
PartGui
)
-
generate_from_xml(ViewProviderFemMeshPy)
generate_from_xml(ViewProviderFemPostPipelinePy)
-
SET(Python_SRCS
ViewProviderFemMeshPy.xml
ViewProviderFemMeshPyImp.cpp
@@ -57,7 +52,6 @@ SET(Python_SRCS
)
SOURCE_GROUP("Python" FILES ${Python_SRCS})
-
set(FemGui_UIC_SRCS
DlgSettingsFemCcx.ui
DlgSettingsFemElmer.ui
@@ -65,7 +59,6 @@ set(FemGui_UIC_SRCS
DlgSettingsFemGeneral.ui
DlgSettingsFemGmsh.ui
DlgSettingsFemInOutVtk.ui
- DlgSettingsFemMaterial.ui
DlgSettingsFemMystran.ui
DlgSettingsFemZ88.ui
TaskCreateNodeSet.ui
@@ -88,6 +81,7 @@ set(FemGui_UIC_SRCS
TaskAnalysisInfo.ui
TaskDriver.ui
)
+
if(BUILD_FEM_VTK)
set(FemGui_UIC_SRCS
${FemGui_UIC_SRCS}
@@ -126,9 +120,6 @@ SET(FemGui_DLG_SRCS
DlgSettingsFemInOutVtk.ui
DlgSettingsFemInOutVtkImp.cpp
DlgSettingsFemInOutVtkImp.h
- DlgSettingsFemMaterial.ui
- DlgSettingsFemMaterialImp.cpp
- DlgSettingsFemMaterialImp.h
DlgSettingsFemMystran.ui
DlgSettingsFemMystranImp.cpp
DlgSettingsFemMystranImp.h
@@ -186,14 +177,13 @@ SET(FemGui_DLG_SRCS
)
SOURCE_GROUP("Constraint-Dialogs" FILES ${FemGui_DLG_SRCS})
-set (Fem_TR_QRC ${CMAKE_CURRENT_BINARY_DIR}/Resources/Fem_translation.qrc)
+set(Fem_TR_QRC ${CMAKE_CURRENT_BINARY_DIR}/Resources/Fem_translation.qrc)
qt_find_and_add_translation(QM_SRCS "Resources/translations/*_*.ts"
${CMAKE_CURRENT_BINARY_DIR}/Resources/translations)
qt_create_resource_file(${Fem_TR_QRC} ${QM_SRCS})
qt_add_resources(FemResource_SRCS Resources/Fem.qrc ${Fem_TR_QRC})
SOURCE_GROUP("Resources" FILES ${FemResource_SRCS})
-
SET(FemGui_SRCS_ViewProvider
ViewProviderFemMesh.cpp
ViewProviderFemMesh.h
@@ -254,7 +244,6 @@ SET(FemGui_SRCS_ViewProvider
)
SOURCE_GROUP("ViewProvider" FILES ${FemGui_SRCS_ViewProvider})
-
SET(FemGui_SRCS_TaskBoxes
TaskObjectName.ui
TaskObjectName.cpp
@@ -272,6 +261,7 @@ SET(FemGui_SRCS_TaskBoxes
TaskTetParameter.cpp
TaskTetParameter.h
)
+
if(BUILD_FEM_VTK)
SET(FemGui_SRCS_TaskBoxes
${FemGui_SRCS_TaskBoxes}
@@ -291,8 +281,8 @@ if(BUILD_FEM_VTK)
TaskPostWarpVector.ui
)
endif(BUILD_FEM_VTK)
-SOURCE_GROUP("Task_Boxes" FILES ${FemGui_SRCS_TaskBoxes})
+SOURCE_GROUP("Task_Boxes" FILES ${FemGui_SRCS_TaskBoxes})
SET(FemGui_SRCS_TaskDlg
TaskDlgCreateNodeSet.h
@@ -304,7 +294,6 @@ SET(FemGui_SRCS_TaskDlg
)
SOURCE_GROUP("Task_Dialogs" FILES ${FemGui_SRCS_TaskDlg})
-
SET(FemGui_SRCS_Module
AppFemGui.cpp
AppFemGuiPy.cpp
@@ -325,7 +314,6 @@ SET(FemGui_SRCS_Module
)
SOURCE_GROUP("Module" FILES ${FemGui_SRCS_Module})
-
if(BUILD_FEM_VTK)
SET(FemGui_SRCS_Post
ViewProviderFemPostObject.h
@@ -336,11 +324,10 @@ if(BUILD_FEM_VTK)
ViewProviderFemPostFunction.cpp
ViewProviderFemPostFilter.h
ViewProviderFemPostFilter.cpp
- )
+ )
SOURCE_GROUP("PostObjects" FILES ${FemGui_SRCS_Post})
endif(BUILD_FEM_VTK)
-
SET(FemGui_SRCS
${Python_SRCS}
${FemGui_DLG_SRCS}
@@ -365,13 +352,10 @@ SET(FemGuiIcon_SVG
add_library(FemGui SHARED ${FemGui_SRCS} ${FemGuiIcon_SVG})
target_link_libraries(FemGui ${FemGui_LIBS} ${VTK_LIBRARIES})
-
fc_copy_sources(FemGui "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Fem" ${FemGuiIcon_SVG})
-
INSTALL(FILES ${FemGuiIcon_SVG} DESTINATION "${CMAKE_INSTALL_DATADIR}/Mod/Fem/Resources/icons")
-
# Python modules ui files, they are copied as they are, thus the need not to be added to Fem.qrc
# see https://forum.freecad.org/viewtopic.php?f=10&t=25833
SET(FemGuiPythonUI_SRCS
@@ -409,10 +393,7 @@ fc_copy_sources(FemPythonUi "${CMAKE_BINARY_DIR}/Mod/Fem" ${FemGuiPythonUI_SRCS}
INSTALL(FILES ${FemGuiPythonUI_SRCS} DESTINATION Mod/Fem/Resources/ui)
-
-
SET_BIN_DIR(FemGui FemGui /Mod/Fem)
SET_PYTHON_PREFIX_SUFFIX(FemGui)
-
INSTALL(TARGETS FemGui DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.cpp b/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.cpp
deleted file mode 100644
index 9451f8ea01..0000000000
--- a/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2018 FreeCAD Developers *
- * Author: Bernd Hahnebach *
- * Based on src/Mod/Fem/Gui/DlgSettingsFemElmerImp.cpp *
- * *
- * This file is part of the FreeCAD CAx development system. *
- * *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Library General Public *
- * License as published by the Free Software Foundation; either *
- * version 2 of the License, or (at your option) any later version. *
- * *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Library General Public License for more details. *
- * *
- * You should have received a copy of the GNU Library General Public *
- * License along with this library; see the file COPYING.LIB. If not, *
- * write to the Free Software Foundation, Inc., 59 Temple Place, *
- * Suite 330, Boston, MA 02111-1307, USA *
- * *
- ***************************************************************************/
-
-#include "PreCompiled.h"
-
-#include "DlgSettingsFemMaterialImp.h"
-#include "ui_DlgSettingsFemMaterial.h"
-
-
-using namespace FemGui;
-
-DlgSettingsFemMaterialImp::DlgSettingsFemMaterialImp(QWidget* parent)
- : PreferencePage(parent)
- , ui(new Ui_DlgSettingsFemMaterialImp)
-{
- ui->setupUi(this);
-}
-
-DlgSettingsFemMaterialImp::~DlgSettingsFemMaterialImp() = default;
-
-void DlgSettingsFemMaterialImp::saveSettings()
-{
- ui->cb_use_built_in_materials->onSave();
- ui->cb_use_mat_from_config_dir->onSave();
- ui->cb_use_mat_from_custom_dir->onSave();
- ui->fc_custom_mat_dir->onSave();
- ui->cb_delete_duplicates->onSave();
- ui->cb_sort_by_resources->onSave();
-}
-
-void DlgSettingsFemMaterialImp::loadSettings()
-{
- ui->cb_use_built_in_materials->onRestore();
- ui->cb_use_mat_from_config_dir->onRestore();
- ui->cb_use_mat_from_custom_dir->onRestore();
- ui->fc_custom_mat_dir->onRestore();
- ui->cb_delete_duplicates->onRestore();
- ui->cb_sort_by_resources->onRestore();
-}
-
-/**
- * Sets the strings of the subwidgets using the current language.
- */
-void DlgSettingsFemMaterialImp::changeEvent(QEvent* e)
-{
- if (e->type() == QEvent::LanguageChange) {
- ui->retranslateUi(this);
- }
- else {
- QWidget::changeEvent(e);
- }
-}
-
-#include "moc_DlgSettingsFemMaterialImp.cpp"
diff --git a/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.h b/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.h
deleted file mode 100644
index 9a72a3eca0..0000000000
--- a/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/**************************************************************************
- * Copyright (c) 2018 FreeCAD Developers *
- * Author: Bernd Hahnebach *
- * Based on src/Mod/Fem/Gui/DlgSettingsFemElmer.h *
- * *
- * This file is part of the FreeCAD CAx development system. *
- * *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Library General Public *
- * License as published by the Free Software Foundation; either *
- * version 2 of the License, or (at your option) any later version. *
- * *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Library General Public License for more details. *
- * *
- * You should have received a copy of the GNU Library General Public *
- * License along with this library; see the file COPYING.LIB. If not, *
- * write to the Free Software Foundation, Inc., 59 Temple Place, *
- * Suite 330, Boston, MA 02111-1307, USA *
- * *
- ***************************************************************************/
-
-#ifndef FEMGUI_DLGSETTINGSFEMMATERIALIMP_H
-#define FEMGUI_DLGSETTINGSFEMMATERIALIMP_H
-
-#include
-#include
-
-
-namespace FemGui
-{
-class Ui_DlgSettingsFemMaterialImp;
-
-class DlgSettingsFemMaterialImp: public Gui::Dialog::PreferencePage
-{
- Q_OBJECT
-
-public:
- explicit DlgSettingsFemMaterialImp(QWidget* parent = nullptr);
- ~DlgSettingsFemMaterialImp() override;
-
-protected:
- void saveSettings() override;
- void loadSettings() override;
- void changeEvent(QEvent* e) override;
-
-private:
- std::unique_ptr ui;
-};
-
-} // namespace FemGui
-
-#endif // FEMGUI_DLGSETTINGSFEMMATERIALIMP_H
diff --git a/src/Mod/Material/App/AppMaterial.cpp b/src/Mod/Material/App/AppMaterial.cpp
new file mode 100644
index 0000000000..ced297ec95
--- /dev/null
+++ b/src/Mod/Material/App/AppMaterial.cpp
@@ -0,0 +1,73 @@
+/***************************************************************************
+ * Copyright (c) 2023 David Carter *
+ * *
+ * This file is part of FreeCAD. *
+ * *
+ * FreeCAD is free software: you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation, either version 2.1 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * FreeCAD is distributed in the hope that it will be useful, but *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with FreeCAD. If not, see *
+ * . *
+ * *
+ **************************************************************************/
+
+#include "PreCompiled.h"
+#ifndef _PreComp_
+#endif
+
+#include
+#include
+#include
+
+// #include "Model.h"
+#include "MaterialManagerPy.h"
+#include "MaterialPy.h"
+#include "ModelManagerPy.h"
+#include "ModelPropertyPy.h"
+#include "ModelPy.h"
+
+namespace Materials
+{
+class Module: public Py::ExtensionModule
+{
+public:
+ Module()
+ : Py::ExtensionModule("Material")
+ {
+ initialize("This module is the Material module."); // register with Python
+ }
+
+ ~Module() override = default;
+
+private:
+};
+
+PyObject* initModule()
+{
+ return Base::Interpreter().addModule(new Module);
+}
+
+} // namespace Materials
+
+PyMOD_INIT_FUNC(Material)
+{
+ PyObject* module = Materials::initModule();
+
+ Base::Console().Log("Loading Material module... done\n");
+
+ Base::Interpreter().addType(&Materials::MaterialManagerPy ::Type, module, "MaterialManager");
+ Base::Interpreter().addType(&Materials::MaterialPy ::Type, module, "Material");
+ Base::Interpreter().addType(&Materials::ModelManagerPy ::Type, module, "ModelManager");
+ Base::Interpreter().addType(&Materials::ModelPropertyPy ::Type, module, "ModelProperty");
+ Base::Interpreter().addType(&Materials::ModelPy ::Type, module, "Model");
+
+ PyMOD_Return(module);
+}
diff --git a/src/Mod/Material/App/CMakeLists.txt b/src/Mod/Material/App/CMakeLists.txt
new file mode 100644
index 0000000000..21258ea53a
--- /dev/null
+++ b/src/Mod/Material/App/CMakeLists.txt
@@ -0,0 +1,99 @@
+if(MSVC)
+ add_definitions(-DFCAppMaterial -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH)
+else(MSVC)
+ add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H)
+endif(MSVC)
+
+add_definitions(-DYAML_CPP_STATIC_DEFINE)
+
+include_directories(
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${Boost_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${XercesC_INCLUDE_DIRS}
+ ${ZLIB_INCLUDE_DIR}
+ ${YAML_CPP_INCLUDE_DIR}
+)
+link_directories(${YAML_CPP_LIBRARY_DIR})
+
+set(Material_LIBS
+ ${Boost_LIBRARIES}
+ FreeCADApp
+)
+
+include_directories(
+ ${QtConcurrent_INCLUDE_DIRS}
+)
+list(APPEND Material_LIBS
+ ${QtConcurrent_LIBRARIES}
+ ${YAML_CPP_LIBRARIES}
+)
+
+generate_from_xml(MaterialManagerPy)
+generate_from_xml(MaterialPy)
+generate_from_xml(ModelManagerPy)
+generate_from_xml(ModelPropertyPy)
+generate_from_xml(ModelPy)
+
+SET(Python_SRCS
+ Exceptions.h
+ MaterialManagerPy.xml
+ MaterialManagerPyImpl.cpp
+ MaterialPy.xml
+ MaterialPyImpl.cpp
+ ModelManagerPy.xml
+ ModelManagerPyImpl.cpp
+ ModelPropertyPy.xml
+ ModelPropertyPyImpl.cpp
+ ModelPy.xml
+ ModelPyImpl.cpp
+)
+SOURCE_GROUP("Python" FILES ${Python_SRCS})
+
+SET(Material_SRCS
+ ${Python_SRCS}
+ AppMaterial.cpp
+ FolderTree.h
+ MaterialConfigLoader.cpp
+ MaterialConfigLoader.h
+ MaterialLibrary.cpp
+ MaterialLibrary.h
+ MaterialLoader.cpp
+ MaterialLoader.h
+ MaterialManager.cpp
+ MaterialManager.h
+ Materials.cpp
+ Materials.h
+ MaterialValue.cpp
+ MaterialValue.h
+ Model.cpp
+ Model.h
+ ModelLibrary.cpp
+ ModelLibrary.h
+ ModelLoader.cpp
+ ModelLoader.h
+ ModelManager.cpp
+ ModelManager.h
+ ModelUuids.h
+ PreCompiled.cpp
+ PreCompiled.h
+ trim.h
+)
+
+if(FREECAD_USE_PCH)
+ add_definitions(-D_PreComp_)
+ GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${Material_SRCS})
+ ADD_MSVC_PRECOMPILED_HEADER(Material PreCompiled.h PreCompiled.cpp PCH_SRCS)
+endif(FREECAD_USE_PCH)
+
+add_library(Material SHARED ${Material_SRCS})
+target_link_libraries(Material ${Material_LIBS})
+
+SET_BIN_DIR(Material Material /Mod/Material)
+SET_PYTHON_PREFIX_SUFFIX(Material)
+
+INSTALL(TARGETS Material DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/src/Mod/Material/App/Exceptions.h b/src/Mod/Material/App/Exceptions.h
new file mode 100644
index 0000000000..c67e9df4eb
--- /dev/null
+++ b/src/Mod/Material/App/Exceptions.h
@@ -0,0 +1,153 @@
+/***************************************************************************
+ * Copyright (c) 2023 David Carter *
+ * *
+ * This file is part of FreeCAD. *
+ * *
+ * FreeCAD is free software: you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation, either version 2.1 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * FreeCAD is distributed in the hope that it will be useful, but *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with FreeCAD. If not, see *
+ * . *
+ * *
+ **************************************************************************/
+
+#ifndef MATERIAL_EXCEPTIONS_H
+#define MATERIAL_EXCEPTIONS_H
+
+#include
+#include
+
+namespace Materials
+{
+
+class Uninitialized: public Base::Exception
+{
+public:
+ Uninitialized()
+ {}
+ explicit Uninitialized(const char* msg)
+ {
+ this->setMessage(msg);
+ }
+ ~Uninitialized() noexcept override = default;
+};
+
+class ModelNotFound: public Base::Exception
+{
+public:
+ ModelNotFound()
+ {}
+ explicit ModelNotFound(const char* msg)
+ {
+ this->setMessage(msg);
+ }
+ ~ModelNotFound() noexcept override = default;
+};
+
+class MaterialNotFound: public Base::Exception
+{
+public:
+ MaterialNotFound()
+ {}
+ explicit MaterialNotFound(const char* msg)
+ {
+ this->setMessage(msg);
+ }
+ ~MaterialNotFound() noexcept override = default;
+};
+
+class PropertyNotFound: public Base::Exception
+{
+public:
+ PropertyNotFound()
+ {}
+ explicit PropertyNotFound(const char* msg)
+ {
+ this->setMessage(msg);
+ }
+ ~PropertyNotFound() noexcept override = default;
+};
+
+class LibraryNotFound: public Base::Exception
+{
+public:
+ LibraryNotFound()
+ {}
+ explicit LibraryNotFound(const char* msg)
+ {
+ this->setMessage(msg);
+ }
+ ~LibraryNotFound() noexcept override = default;
+};
+
+class InvalidModel: public Base::Exception
+{
+public:
+ InvalidModel()
+ {}
+ explicit InvalidModel(const char* msg)
+ {
+ this->setMessage(msg);
+ }
+ ~InvalidModel() noexcept override = default;
+};
+
+class InvalidRow: public Base::Exception
+{
+public:
+ InvalidRow()
+ {}
+ explicit InvalidRow(char* msg)
+ {
+ this->setMessage(msg);
+ }
+ ~InvalidRow() noexcept override = default;
+};
+
+class InvalidColumn: public Base::Exception
+{
+public:
+ InvalidColumn()
+ {}
+ explicit InvalidColumn(char* msg)
+ {
+ this->setMessage(msg);
+ }
+ ~InvalidColumn() noexcept override = default;
+};
+
+class InvalidIndex: public Base::Exception
+{
+public:
+ InvalidIndex()
+ {}
+ explicit InvalidIndex(char* msg)
+ {
+ this->setMessage(msg);
+ }
+ ~InvalidIndex() noexcept override = default;
+};
+
+class UnknownValueType: public Base::Exception
+{
+public:
+ UnknownValueType()
+ {}
+ explicit UnknownValueType(char* msg)
+ {
+ this->setMessage(msg);
+ }
+ ~UnknownValueType() noexcept override = default;
+};
+
+} // namespace Materials
+
+#endif // MATERIAL_EXCEPTIONS_H
diff --git a/src/Mod/Material/App/FolderTree.h b/src/Mod/Material/App/FolderTree.h
new file mode 100644
index 0000000000..75dd3dfcc7
--- /dev/null
+++ b/src/Mod/Material/App/FolderTree.h
@@ -0,0 +1,86 @@
+/***************************************************************************
+ * Copyright (c) 2023 David Carter *
+ * *
+ * This file is part of FreeCAD. *
+ * *
+ * FreeCAD is free software: you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation, either version 2.1 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * FreeCAD is distributed in the hope that it will be useful, but *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with FreeCAD. If not, see *
+ * . *
+ * *
+ **************************************************************************/
+
+#ifndef MATERIAL_FOLDERTREE_H
+#define MATERIAL_FOLDERTREE_H
+
+#include
+#include