From d75bd029713698f63bd191e5f53342b3750beed9 Mon Sep 17 00:00:00 2001 From: Uwe Date: Sun, 6 Nov 2022 03:36:53 +0100 Subject: [PATCH] [skip ci] [Gui] DlgMaterialPropertiesImp: Clang formatting --- src/Gui/DlgMaterialPropertiesImp.cpp | 57 ++++++++++++++-------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/src/Gui/DlgMaterialPropertiesImp.cpp b/src/Gui/DlgMaterialPropertiesImp.cpp index ec0a7d8fa7..7e8ab45d4a 100644 --- a/src/Gui/DlgMaterialPropertiesImp.cpp +++ b/src/Gui/DlgMaterialPropertiesImp.cpp @@ -41,7 +41,8 @@ using namespace Gui::Dialog; * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ -DlgMaterialPropertiesImp::DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent, Qt::WindowFlags fl) +DlgMaterialPropertiesImp::DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent, + Qt::WindowFlags fl) : QDialog(parent, fl) , ui(new Ui_DlgMaterialProperties) , material(mat) @@ -76,10 +77,10 @@ QColor DlgMaterialPropertiesImp::diffuseColor() const void DlgMaterialPropertiesImp::on_ambientColor_changed() { QColor col = ui->ambientColor->color(); - float r = (float)col.red()/255.0f; - float g = (float)col.green()/255.0f; - float b = (float)col.blue()/255.0f; - App::Color ambient(r,g,b); + float r = (float)col.red() / 255.0f; + float g = (float)col.green() / 255.0f; + float b = (float)col.blue() / 255.0f; + App::Color ambient(r, g, b); for (std::vector::iterator it= Objects.begin(); it != Objects.end(); ++it) { App::Property* prop = (*it)->getPropertyByName(material.c_str()); @@ -98,12 +99,12 @@ void DlgMaterialPropertiesImp::on_ambientColor_changed() void DlgMaterialPropertiesImp::on_diffuseColor_changed() { QColor col = ui->diffuseColor->color(); - float r = (float)col.red()/255.0f; - float g = (float)col.green()/255.0f; - float b = (float)col.blue()/255.0f; - App::Color diffuse(r,g,b); + float r = (float)col.red() / 255.0f; + float g = (float)col.green() / 255.0f; + float b = (float)col.blue() / 255.0f; + App::Color diffuse(r, g, b); - for (std::vector::iterator it= Objects.begin();it!=Objects.end();++it) { + for (std::vector::iterator it = Objects.begin(); it != Objects.end(); ++it) { App::Property* prop = (*it)->getPropertyByName(material.c_str()); if (prop && prop->getTypeId().isDerivedFrom(App::PropertyMaterial::getClassTypeId())) { auto ShapeMaterial = static_cast(prop); @@ -120,12 +121,12 @@ void DlgMaterialPropertiesImp::on_diffuseColor_changed() void DlgMaterialPropertiesImp::on_emissiveColor_changed() { QColor col = ui->emissiveColor->color(); - float r = (float)col.red()/255.0f; - float g = (float)col.green()/255.0f; - float b = (float)col.blue()/255.0f; - App::Color emissive(r,g,b); + float r = (float)col.red() / 255.0f; + float g = (float)col.green() / 255.0f; + float b = (float)col.blue() / 255.0f; + App::Color emissive(r, g, b); - for (std::vector::iterator it= Objects.begin();it!=Objects.end();++it) { + for (std::vector::iterator it = Objects.begin(); it != Objects.end(); ++it) { App::Property* prop = (*it)->getPropertyByName(material.c_str()); if (prop && prop->getTypeId().isDerivedFrom(App::PropertyMaterial::getClassTypeId())) { auto ShapeMaterial = static_cast(prop); @@ -142,12 +143,12 @@ void DlgMaterialPropertiesImp::on_emissiveColor_changed() void DlgMaterialPropertiesImp::on_specularColor_changed() { QColor col = ui->specularColor->color(); - float r = (float)col.red()/255.0f; - float g = (float)col.green()/255.0f; - float b = (float)col.blue()/255.0f; - App::Color specular(r,g,b); + float r = (float)col.red() / 255.0f; + float g = (float)col.green() / 255.0f; + float b = (float)col.blue() / 255.0f; + App::Color specular(r, g, b); - for (std::vector::iterator it= Objects.begin();it!=Objects.end();++it) { + for (std::vector::iterator it = Objects.begin(); it != Objects.end(); ++it) { App::Property* prop = (*it)->getPropertyByName(material.c_str()); if (prop && prop->getTypeId().isDerivedFrom(App::PropertyMaterial::getClassTypeId())) { auto ShapeMaterial = static_cast(prop); @@ -163,8 +164,8 @@ void DlgMaterialPropertiesImp::on_specularColor_changed() */ void DlgMaterialPropertiesImp::on_shininess_valueChanged(int sh) { - float shininess = (float)sh/100.0f; - for (std::vector::iterator it= Objects.begin();it!=Objects.end();++it) { + float shininess = (float)sh / 100.0f; + for (std::vector::iterator it = Objects.begin(); it != Objects.end(); ++it) { App::Property* prop = (*it)->getPropertyByName(material.c_str()); if (prop && prop->getTypeId().isDerivedFrom(App::PropertyMaterial::getClassTypeId())) { auto ShapeMaterial = static_cast(prop); @@ -182,7 +183,7 @@ void DlgMaterialPropertiesImp::setViewProviders(const std::vector::iterator it= Objects.begin();it!=Objects.end();++it) { + for (std::vector::iterator it = Objects.begin(); it != Objects.end(); ++it) { App::Property* prop = (*it)->getPropertyByName(material.c_str()); if (prop && prop->getTypeId().isDerivedFrom(App::PropertyMaterial::getClassTypeId())) { auto ShapeMaterial = static_cast(prop); @@ -190,21 +191,21 @@ void DlgMaterialPropertiesImp::setViewProviders(const std::vectorambientColor->setColor( QColor(r,g,b) ); + ui->ambientColor->setColor(QColor(r, g, b)); r = int(mat.diffuseColor.r * 255.0f); g = int(mat.diffuseColor.g * 255.0f); b = int(mat.diffuseColor.b * 255.0f); - ui->diffuseColor->setColor( QColor(r,g,b) ); + ui->diffuseColor->setColor(QColor(r, g, b)); r = int(mat.emissiveColor.r * 255.0f); g = int(mat.emissiveColor.g * 255.0f); b = int(mat.emissiveColor.b * 255.0f); - ui->emissiveColor->setColor( QColor(r,g,b) ); + ui->emissiveColor->setColor(QColor(r, g, b)); r = int(mat.specularColor.r * 255.0f); g = int(mat.specularColor.g * 255.0f); b = int(mat.specularColor.b * 255.0f); - ui->specularColor->setColor( QColor(r,g,b) ); + ui->specularColor->setColor(QColor(r, g, b)); ui->shininess->blockSignals(true); - ui->shininess->setValue((int)(100.0f * (mat.shininess+0.001f))); + ui->shininess->setValue((int)(100.0f * (mat.shininess + 0.001f))); ui->shininess->blockSignals(false); break; }