Material: fixes several issues

* fix warning -Wunused-variable
* fix warning -Wreorder-ctor
* fix warning -Wunused-but-set-variable
* fix uic warning for DlgDisplayProperties.ui
* rename the target MateriaTestLib ALL (note the typo and the already existing MaterialTestLib ALL) to MaterialTest ALL
  drop the hard dependency to the Part module: The document is checked for a property ShapeMaterial of type Materials::PropertyMaterial.
  An alternative could be to cast to GeoFeature and use the methods getMaterialAppearance() and setMaterialAppearance()
This commit is contained in:
wmayer
2024-04-05 00:06:28 +02:00
committed by wwmayer
parent 7a44179529
commit d5cfdb1f1e
7 changed files with 15 additions and 19 deletions

View File

@@ -335,7 +335,7 @@ void DlgDisplayPropertiesImp::slotChangedObject(const Gui::ViewProvider& obj,
}
}
else if (prop.isDerivedFrom<App::PropertyMaterialList>()) {
auto& value = static_cast<const App::PropertyMaterialList&>(prop).getValue();
//auto& value = static_cast<const App::PropertyMaterialList&>(prop).getValue();
if (prop_name == "ShapeAppearance") {
// bool blocked = d->ui.buttonColor->blockSignals(true);
// auto color = value.diffuseColor;
@@ -566,12 +566,12 @@ void DlgDisplayPropertiesImp::setDisplayModes(const std::vector<Gui::ViewProvide
void DlgDisplayPropertiesImp::setMaterial(const std::vector<Gui::ViewProvider*>& views)
{
bool material = false;
App::Material::MaterialType matType = App::Material::DEFAULT;
//App::Material::MaterialType matType = App::Material::DEFAULT;
for (auto view : views) {
if (auto* prop =
dynamic_cast<App::PropertyMaterial*>(view->getPropertyByName("ShapeMaterial"))) {
material = true;
matType = prop->getValue().getType();
// matType = prop->getValue().getType();
break;
}
}