diff --git a/src/Mod/Material/App/MaterialFilter.cpp b/src/Mod/Material/App/MaterialFilter.cpp index c0448b8c60..60fdc18e35 100644 --- a/src/Mod/Material/App/MaterialFilter.cpp +++ b/src/Mod/Material/App/MaterialFilter.cpp @@ -34,12 +34,15 @@ using namespace Materials; MaterialFilterOptions::MaterialFilterOptions() - : _includeFavorites(true) - , _includeRecent(true) - , _includeFolders(true) - , _includeLibraries(true) - , _includeLegacy(false) -{} +{ + auto param = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material/Editor"); + _includeFavorites = param->GetBool("ShowFavorites", true); + _includeRecent = param->GetBool("ShowRecent", true); + _includeFolders = param->GetBool("ShowEmptyFolders", false); + _includeLibraries = param->GetBool("ShowEmptyLibraries", true); + _includeLegacy = param->GetBool("ShowLegacy", false); +} MaterialFilterTreeWidgetOptions::MaterialFilterTreeWidgetOptions() { diff --git a/src/Mod/Material/App/MaterialManager.cpp b/src/Mod/Material/App/MaterialManager.cpp index 74ccb970ec..8d3496c210 100644 --- a/src/Mod/Material/App/MaterialManager.cpp +++ b/src/Mod/Material/App/MaterialManager.cpp @@ -79,8 +79,11 @@ void MaterialManager::initLibraries() void MaterialManager::cleanup() { + QMutexLocker locker(&_mutex); + if (_libraryList) { _libraryList->clear(); + _libraryList = nullptr; } if (_materialMap) { @@ -89,9 +92,17 @@ void MaterialManager::cleanup() it.second->setLibrary(nullptr); } _materialMap->clear(); + _materialMap = nullptr; } } +void MaterialManager::refresh() +{ + // This is very expensive and can be improved using observers? + cleanup(); + initLibraries(); +} + void MaterialManager::saveMaterial(const std::shared_ptr& library, const std::shared_ptr& material, const QString& path, @@ -166,6 +177,9 @@ std::shared_ptr MaterialManager::defaultMaterial() long initialShininess = hGrp->GetInt("DefaultShapeShininess", 90); auto material = manager.getMaterial(defaultMaterialUUID()); + if (!material) { + material = manager.getMaterial(QLatin1String("7f9fd73b-50c9-41d8-b7b2-575a030c1eeb")); + } if (material->hasAppearanceModel(ModelUUIDs::ModelUUID_Rendering_Basic)) { material->getAppearanceProperty(QString::fromLatin1("DiffuseColor")) ->setColor(mat.diffuseColor); @@ -187,7 +201,10 @@ std::shared_ptr MaterialManager::defaultMaterial() QString MaterialManager::defaultMaterialUUID() { // Make this a preference - return QString::fromLatin1("7f9fd73b-50c9-41d8-b7b2-575a030c1eeb"); + auto param = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Material"); + auto uuid = param->GetASCII("DefaultMaterial", "7f9fd73b-50c9-41d8-b7b2-575a030c1eeb"); + return QString::fromStdString(uuid); } std::shared_ptr MaterialManager::getMaterial(const QString& uuid) const diff --git a/src/Mod/Material/App/MaterialManager.h b/src/Mod/Material/App/MaterialManager.h index 34e762789d..dafd663b76 100644 --- a/src/Mod/Material/App/MaterialManager.h +++ b/src/Mod/Material/App/MaterialManager.h @@ -55,6 +55,7 @@ public: ~MaterialManager() override = default; static void cleanup(); + static void refresh(); static std::shared_ptr defaultMaterial(); static QString defaultMaterialUUID(); diff --git a/src/Mod/Material/CMakeLists.txt b/src/Mod/Material/CMakeLists.txt index fc6113bd21..de9a075915 100644 --- a/src/Mod/Material/CMakeLists.txt +++ b/src/Mod/Material/CMakeLists.txt @@ -297,6 +297,23 @@ fc_target_copy_resource(MaterialTest ${CMAKE_BINARY_DIR}/Mod/Material ${MaterialTest_Files}) +set(MaterialTestData_Files + materialtests/Materials/TestAcrylicLegacy.FCMat + materialtests/Materials/TestAluminumAppearance.FCMat + materialtests/Materials/TestAluminumMixed.FCMat + materialtests/Materials/TestAluminumPhysical.FCMat + materialtests/Materials/TestBrassAppearance.FCMat +) + +ADD_CUSTOM_TARGET(MaterialTestData ALL + SOURCES ${MaterialTestData_Files} +) + +fc_target_copy_resource(MaterialTestData + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR}/Mod/Material + ${MaterialTestData_Files}) + ADD_CUSTOM_TARGET(MaterialScripts ALL SOURCES ${MaterialScripts_Files} ${Material_Ui_Files} ${Material_QRC_SRCS} ) diff --git a/src/Mod/Material/Gui/AppMatGui.cpp b/src/Mod/Material/Gui/AppMatGui.cpp index db053bcb5f..68973a0084 100644 --- a/src/Mod/Material/Gui/AppMatGui.cpp +++ b/src/Mod/Material/Gui/AppMatGui.cpp @@ -31,6 +31,7 @@ #include #include +#include "DlgSettingsDefaultMaterial.h" #include "DlgSettingsMaterial.h" #include "Workbench.h" #include "WorkbenchManipulator.h" @@ -105,6 +106,8 @@ PyMOD_INIT_FUNC(MatGui) QObject::tr("Material workbench")); new Gui::PrefPageProducer( QT_TRANSLATE_NOOP("QObject", "Material")); + new Gui::PrefPageProducer( + QT_TRANSLATE_NOOP("QObject", "Material")); // add resources and reloads the translators loadMaterialResource(); diff --git a/src/Mod/Material/Gui/CMakeLists.txt b/src/Mod/Material/Gui/CMakeLists.txt index 6c754a369c..1c5f5b50d1 100644 --- a/src/Mod/Material/Gui/CMakeLists.txt +++ b/src/Mod/Material/Gui/CMakeLists.txt @@ -49,6 +49,7 @@ set(MatGui_UIC_SRCS Array3D.ui DlgDisplayProperties.ui DlgMaterial.ui + DlgSettingsDefaultMaterial.ui DlgSettingsMaterial.ui ImageEdit.ui ListEdit.ui @@ -87,6 +88,9 @@ SET(MatGui_SRCS DlgMaterialImp.cpp DlgMaterialImp.h DlgMaterial.ui + DlgSettingsDefaultMaterial.cpp + DlgSettingsDefaultMaterial.h + DlgSettingsDefaultMaterial.ui DlgSettingsMaterial.cpp DlgSettingsMaterial.h DlgSettingsMaterial.ui diff --git a/src/Mod/Material/Gui/DlgSettingsDefaultMaterial.cpp b/src/Mod/Material/Gui/DlgSettingsDefaultMaterial.cpp new file mode 100644 index 0000000000..92b4c4b9bd --- /dev/null +++ b/src/Mod/Material/Gui/DlgSettingsDefaultMaterial.cpp @@ -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 * + * . * + * * + **************************************************************************/ + +#include "PreCompiled.h" + +#include + +#include "DlgSettingsDefaultMaterial.h" +#include "ui_DlgSettingsDefaultMaterial.h" + + +using namespace MatGui; + +DlgSettingsDefaultMaterial::DlgSettingsDefaultMaterial(QWidget* parent) + : PreferencePage(parent) + , ui(new Ui_DlgSettingsDefaultMaterial) +{ + ui->setupUi(this); + + ui->widgetMaterial->setParamGrpPath("Mod/Material"); + ui->widgetMaterial->setEntryName("DefaultMaterial"); + + setupFilters(); +} + +void DlgSettingsDefaultMaterial::setupFilters() +{ + // Create a filter to only include current format materials + // that contain at a minimum the Density model + auto filterList = std::make_shared>>(); + + auto filter = std::make_shared(); + filter->setName(tr("Physical")); + filter->addRequiredComplete(Materials::ModelUUIDs::ModelUUID_Mechanical_Density); + filterList->push_back(filter); + + ui->widgetMaterial->setIncludeFavorites(false); + ui->widgetMaterial->setIncludeRecent(false); + ui->widgetMaterial->setIncludeEmptyFolders(false); + ui->widgetMaterial->setIncludeLegacy(false); + + ui->widgetMaterial->setFilter(filterList); +} + +void DlgSettingsDefaultMaterial::saveSettings() +{ + ui->widgetMaterial->onSave(); +} + +void DlgSettingsDefaultMaterial::loadSettings() +{ + ui->widgetMaterial->onRestore(); +} + +/** + * Sets the strings of the subwidgets using the current language. + */ +void DlgSettingsDefaultMaterial::changeEvent(QEvent* e) +{ + if (e->type() == QEvent::LanguageChange) { + ui->retranslateUi(this); + } + else { + QWidget::changeEvent(e); + } +} + +#include "moc_DlgSettingsDefaultMaterial.cpp" diff --git a/src/Mod/Material/Gui/DlgSettingsDefaultMaterial.h b/src/Mod/Material/Gui/DlgSettingsDefaultMaterial.h new file mode 100644 index 0000000000..82b12aedf8 --- /dev/null +++ b/src/Mod/Material/Gui/DlgSettingsDefaultMaterial.h @@ -0,0 +1,54 @@ +/*************************************************************************** + * 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 MATGUI_DLGSETTINGSDEFAULTMATERIAL_H +#define MATGUI_DLGSETTINGSDEFAULTMATERIAL_H + +#include +#include + + +namespace MatGui +{ +class Ui_DlgSettingsDefaultMaterial; + +class DlgSettingsDefaultMaterial: public Gui::Dialog::PreferencePage +{ + Q_OBJECT + +public: + explicit DlgSettingsDefaultMaterial(QWidget* parent = nullptr); + ~DlgSettingsDefaultMaterial() override = default; + +protected: + void saveSettings() override; + void loadSettings() override; + void changeEvent(QEvent* e) override; + +private: + std::unique_ptr ui; + + void setupFilters(); +}; + +} // namespace MatGui + +#endif // MATGUI_DLGSETTINGSDEFAULTMATERIAL_H diff --git a/src/Mod/Material/Gui/DlgSettingsDefaultMaterial.ui b/src/Mod/Material/Gui/DlgSettingsDefaultMaterial.ui new file mode 100644 index 0000000000..08b47d927b --- /dev/null +++ b/src/Mod/Material/Gui/DlgSettingsDefaultMaterial.ui @@ -0,0 +1,41 @@ + + + MatGui::DlgSettingsDefaultMaterial + + + + 0 + 0 + 400 + 300 + + + + Default Material + + + + + + Default Material + + + + + + + + + + + + + MatGui::PrefMaterialTreeWidget + QWidget +
Mod/Material/Gui/MaterialTreeWidget.h
+ 1 +
+
+ + +
diff --git a/src/Mod/Material/Gui/DlgSettingsMaterial.cpp b/src/Mod/Material/Gui/DlgSettingsMaterial.cpp index 882687c857..560c4ad3d8 100644 --- a/src/Mod/Material/Gui/DlgSettingsMaterial.cpp +++ b/src/Mod/Material/Gui/DlgSettingsMaterial.cpp @@ -48,9 +48,14 @@ void DlgSettingsMaterial::saveSettings() ui->cb_show_empty_libraries->onSave(); ui->cb_show_empty_folders->onSave(); ui->cb_show_legacy->onSave(); + ui->cb_show_favorites_editor->onSave(); + ui->cb_show_recent_editor->onSave(); + ui->cb_show_empty_libraries_editor->onSave(); + ui->cb_show_empty_folders_editor->onSave(); + ui->cb_show_legacy_editor->onSave(); // Temporary for testing - ui->cb_legacy_editor->onSave(); + // ui->cb_legacy_editor->onSave(); } void DlgSettingsMaterial::loadSettings() @@ -67,9 +72,14 @@ void DlgSettingsMaterial::loadSettings() ui->cb_show_empty_libraries->onRestore(); ui->cb_show_empty_folders->onRestore(); ui->cb_show_legacy->onRestore(); + ui->cb_show_favorites_editor->onRestore(); + ui->cb_show_recent_editor->onRestore(); + ui->cb_show_empty_libraries_editor->onRestore(); + ui->cb_show_empty_folders_editor->onRestore(); + ui->cb_show_legacy_editor->onRestore(); // Temporary for testing - ui->cb_legacy_editor->onRestore(); + // ui->cb_legacy_editor->onRestore(); } /** diff --git a/src/Mod/Material/Gui/DlgSettingsMaterial.ui b/src/Mod/Material/Gui/DlgSettingsMaterial.ui index 9a96f2fd6d..addfb31dc2 100644 --- a/src/Mod/Material/Gui/DlgSettingsMaterial.ui +++ b/src/Mod/Material/Gui/DlgSettingsMaterial.ui @@ -206,31 +206,6 @@ If unchecked, they will be sorted by their name. - - - - Testing - - - - - - Use legacy editor - - - true - - - LegacyEditor - - - Mod/Material/Cards - - - - - - @@ -314,6 +289,92 @@ If unchecked, they will be sorted by their name. + + + + Material Editor + + + + + + Show favorites + + + true + + + ShowFavorites + + + Mod/Material/Editor + + + + + + + Show recent + + + true + + + ShowRecent + + + Mod/Material/Editor + + + + + + + Show empty libraries + + + true + + + ShowEmptyLibraries + + + Mod/Material/Editor + + + + + + + Show empty folders + + + ShowEmptyFolders + + + Mod/Material/Editor + + + + + + + Show legacy files + + + true + + + ShowLegacy + + + Mod/Material/Editor + + + + + + diff --git a/src/Mod/Material/Gui/MaterialTreeWidget.cpp b/src/Mod/Material/Gui/MaterialTreeWidget.cpp index aa49c94733..6e3a2eb494 100644 --- a/src/Mod/Material/Gui/MaterialTreeWidget.cpp +++ b/src/Mod/Material/Gui/MaterialTreeWidget.cpp @@ -709,3 +709,34 @@ void MaterialTreeWidget::saveMaterialTreeChildren(const Base::ReferenceGetASCII(entryName(), defaultUuid)); + setMaterial(uuid); +} + +void PrefMaterialTreeWidget::savePreferences() +{ + if (getWindowParameter().isNull()) { + failedToSave(objectName()); + return; + } + + getWindowParameter()->SetASCII(entryName(), getMaterialUUID().toStdString()); +} diff --git a/src/Mod/Material/Gui/MaterialTreeWidget.h b/src/Mod/Material/Gui/MaterialTreeWidget.h index af7a1be11b..707e278960 100644 --- a/src/Mod/Material/Gui/MaterialTreeWidget.h +++ b/src/Mod/Material/Gui/MaterialTreeWidget.h @@ -37,6 +37,7 @@ #include #include +#include #include @@ -250,6 +251,28 @@ protected: } }; +/** + * The PrefColorButton class. + */ +class MatGuiExport PrefMaterialTreeWidget: public MaterialTreeWidget, public Gui::PrefWidget +{ + Q_OBJECT + + Q_PROPERTY(QByteArray prefEntry READ entryName WRITE + setEntryName) // clazy:exclude=qproperty-without-notify + Q_PROPERTY(QByteArray prefPath READ paramGrpPath WRITE + setParamGrpPath) // clazy:exclude=qproperty-without-notify + +public: + explicit PrefMaterialTreeWidget(QWidget* parent = nullptr); + ~PrefMaterialTreeWidget() override; + +protected: + // restore from/save to parameters + void restorePreferences() override; + void savePreferences() override; +}; + } // namespace MatGui #endif // MATGUI_MATERIALTREEWIDGET_H \ No newline at end of file diff --git a/src/Mod/Material/Gui/MaterialsEditor.cpp b/src/Mod/Material/Gui/MaterialsEditor.cpp index e33630d84b..fc7687f685 100644 --- a/src/Mod/Material/Gui/MaterialsEditor.cpp +++ b/src/Mod/Material/Gui/MaterialsEditor.cpp @@ -831,27 +831,39 @@ void MaterialsEditor::fillMaterialTree() auto tree = ui->treeMaterials; auto model = dynamic_cast(tree->model()); - auto lib = new QStandardItem(tr("Favorites")); - lib->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); - addExpanded(tree, model, lib, param); - addFavorites(lib); + if (_filterOptions.includeFavorites()) { + auto lib = new QStandardItem(tr("Favorites")); + lib->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + addExpanded(tree, model, lib, param); + addFavorites(lib); + } - lib = new QStandardItem(tr("Recent")); - lib->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); - addExpanded(tree, model, lib, param); - addRecents(lib); + if (_filterOptions.includeRecent()) { + auto lib = new QStandardItem(tr("Recent")); + lib->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + addExpanded(tree, model, lib, param); + addRecents(lib); + } auto libraries = getMaterialManager().getMaterialLibraries(); for (const auto& library : *libraries) { - lib = new QStandardItem(library->getName()); - lib->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); - addExpanded(tree, model, lib, param); - - QIcon icon(library->getIconPath()); - QIcon folderIcon(QString::fromStdString(":/icons/folder.svg")); - auto modelTree = getMaterialManager().getMaterialTree(library); - addMaterials(*lib, modelTree, folderIcon, icon, param); + + bool showLibraries = _filterOptions.includeEmptyLibraries(); + if (!_filterOptions.includeEmptyLibraries() && modelTree->size() > 0) { + showLibraries = true; + } + + if (showLibraries) { + auto lib = new QStandardItem(library->getName()); + lib->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + addExpanded(tree, model, lib, param); + + QIcon icon(library->getIconPath()); + QIcon folderIcon(QString::fromStdString(":/icons/folder.svg")); + + addMaterials(*lib, modelTree, folderIcon, icon, param); + } } } diff --git a/src/Mod/Material/Gui/MaterialsEditor.h b/src/Mod/Material/Gui/MaterialsEditor.h index 2378625a6b..f5311d58e0 100644 --- a/src/Mod/Material/Gui/MaterialsEditor.h +++ b/src/Mod/Material/Gui/MaterialsEditor.h @@ -124,6 +124,7 @@ private: int _recentMax; QIcon _warningIcon; std::shared_ptr _filter; + Materials::MaterialFilterOptions _filterOptions; void setup(); @@ -179,6 +180,62 @@ private: const QIcon& folderIcon, const QIcon& icon, const Base::Reference& param); + + /* Indicates if we should show favourite materials + */ + bool includeFavorites() const + { + return _filterOptions.includeFavorites(); + } + void setIncludeFavorites(bool value) + { + _filterOptions.setIncludeFavorites(value); + } + + /* Indicates if we should show recent materials + */ + bool includeRecent() const + { + return _filterOptions.includeRecent(); + } + void setIncludeRecent(bool value) + { + _filterOptions.setIncludeRecent(value); + } + + /* Indicates if we should include empty folders + */ + bool includeEmptyFolders() const + { + return _filterOptions.includeEmptyFolders(); + } + void setIncludeEmptyFolders(bool value) + { + _filterOptions.setIncludeEmptyFolders(value); + } + + /* Indicates if we should include empty libraries + */ + bool includeEmptyLibraries() const + { + return _filterOptions.includeEmptyLibraries(); + } + void setIncludeEmptyLibraries(bool value) + { + Base::Console().Log("setIncludeEmptyLibraries(%s)\n", (value ? "true" : "false")); + _filterOptions.setIncludeEmptyLibraries(value); + } + + /* Indicates if we should include materials in the older format + */ + bool includeLegacy() const + { + return _filterOptions.includeLegacy(); + } + void setIncludeLegacy(bool legacy) + { + _filterOptions.setIncludeLegacy(legacy); + } }; } // namespace MatGui diff --git a/src/Mod/Material/MaterialEditor.py b/src/Mod/Material/MaterialEditor.py index 28dbe83bc0..ee8f1f9d02 100644 --- a/src/Mod/Material/MaterialEditor.py +++ b/src/Mod/Material/MaterialEditor.py @@ -944,13 +944,13 @@ def translate(context, text): def openEditor(obj=None, prop=None): """openEditor([obj,prop]): opens the editor, optionally with an object name and material property name to edit""" - param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Material/Cards") - legacy = param.GetBool("LegacyEditor", True) - if legacy: - editor = MaterialEditor(obj, prop) - editor.exec_() - else: - FreeCADGui.runCommand('Materials_Edit',0) + # param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Material/Cards") + # legacy = param.GetBool("LegacyEditor", True) + # if legacy: + # editor = MaterialEditor(obj, prop) + # editor.exec_() + # else: + FreeCADGui.runCommand('Materials_Edit',0) def editMaterial(material=None, card_path=None, category="Solid"): diff --git a/src/Mod/Material/materialtests/Materials/TestAcrylicLegacy.FCMat b/src/Mod/Material/materialtests/Materials/TestAcrylicLegacy.FCMat new file mode 100644 index 0000000000..2ee4db5583 --- /dev/null +++ b/src/Mod/Material/materialtests/Materials/TestAcrylicLegacy.FCMat @@ -0,0 +1,12 @@ +; Acrylic +; Automatically generated by the Rocket Workbench +; information about the content of such cards can be found on the wiki: +; https://www.freecadweb.org/wiki/Material + +[General] +Name = TestAcrylicLegacy +Description = Acrylic +KindOfMaterial = Solid + +[Mechanical] +Density = 1190.0 kg/m^3 diff --git a/src/Mod/Material/materialtests/Materials/TestAluminumAppearance.FCMat b/src/Mod/Material/materialtests/Materials/TestAluminumAppearance.FCMat new file mode 100644 index 0000000000..b374cce1e5 --- /dev/null +++ b/src/Mod/Material/materialtests/Materials/TestAluminumAppearance.FCMat @@ -0,0 +1,17 @@ +--- +# File created by ConvertFCMat.py +General: + UUID: "3c6d0407-66b3-48ea-a2e8-ee843edf0311" + Author: "David Carter" + License: "GPL-2.0-or-later" + Name: "TestAluminumAppearance" + Description: "Defines the Aluminum appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.3000, 0.3000, 0.3000, 1.0)" + DiffuseColor: "(0.3000, 0.3000, 0.3000, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.0900" + SpecularColor: "(0.3000, 0.3000, 0.3000, 1.0)" + Transparency: "0.0" diff --git a/src/Mod/Material/materialtests/Materials/TestAluminumMixed.FCMat b/src/Mod/Material/materialtests/Materials/TestAluminumMixed.FCMat new file mode 100644 index 0000000000..400ac77812 --- /dev/null +++ b/src/Mod/Material/materialtests/Materials/TestAluminumMixed.FCMat @@ -0,0 +1,33 @@ +--- +# File created by ConvertFCMat.py +General: + UUID: "5f546608-fcbb-40db-98d7-d8e104eb33ce" + Author: "M. Münch" + License: "LGPL-2.0-or-later" + Name: "TestAluminumMixed" +Inherits: + Aluminum: + UUID: "3c6d0407-66b3-48ea-a2e8-ee843edf0311" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Aluminium" + MaterialNumber: "3.3535.26" + StandardCode: "DIN 1725" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "2700 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "27000 MPa" + UltimateStrain: "5" + UltimateTensileStrength: "250 MPa" + YieldStrength: "180 MPa" + YoungsModulus: "70000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "900 J/kg/K" + ThermalConductivity: "150 W/m/K" + ThermalExpansionCoefficient: "23 µm/m/K" diff --git a/src/Mod/Material/materialtests/Materials/TestAluminumPhysical.FCMat b/src/Mod/Material/materialtests/Materials/TestAluminumPhysical.FCMat new file mode 100644 index 0000000000..9173fcac1a --- /dev/null +++ b/src/Mod/Material/materialtests/Materials/TestAluminumPhysical.FCMat @@ -0,0 +1,30 @@ +--- +# File created by ConvertFCMat.py +General: + UUID: "a8e60089-550d-4370-8e7e-1734db12a3a9" + Author: "M. Münch" + License: "LGPL-2.0-or-later" + Name: "TestAluminumPhysical" +Models: + Father: + UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67' + Father: "Metal" + MaterialStandard: + UUID: '1e2c0088-904a-4537-925f-64064c07d700' + KindOfMaterial: "Aluminium" + MaterialNumber: "3.3535.26" + StandardCode: "DIN 1725" + LinearElastic: + UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536' + Density: "2700 kg/m^3" + PoissonRatio: "0.3" + ShearModulus: "27000 MPa" + UltimateStrain: "5" + UltimateTensileStrength: "250 MPa" + YieldStrength: "180 MPa" + YoungsModulus: "70000 MPa" + Thermal: + UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7' + SpecificHeat: "900 J/kg/K" + ThermalConductivity: "150 W/m/K" + ThermalExpansionCoefficient: "23 µm/m/K" diff --git a/src/Mod/Material/materialtests/Materials/TestBrassAppearance.FCMat b/src/Mod/Material/materialtests/Materials/TestBrassAppearance.FCMat new file mode 100644 index 0000000000..d188a9d853 --- /dev/null +++ b/src/Mod/Material/materialtests/Materials/TestBrassAppearance.FCMat @@ -0,0 +1,17 @@ +--- +# File created by ConvertFCMat.py +General: + UUID: "fff3d5c8-98c3-4ee2-8fe5-7e17403c48fcc" + Author: "David Carter" + License: "GPL-2.0-or-later" + Name: "TestBrassAppearance" + Description: "Defines the Brass appearance properties" +AppearanceModels: + BasicRendering: + UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e' + AmbientColor: "(0.3294, 0.2235, 0.0275, 1.0)" + DiffuseColor: "(0.7804, 0.5686, 0.1137, 1.0)" + EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)" + Shininess: "0.2179" + SpecularColor: "(0.9922, 0.9412, 0.8078, 1.0)" + Transparency: "0.0"