Skip to content
Permalink
Browse files

qDebug & QString cleanup

  • Loading branch information
NEDJIMAbelgacem committed Jul 22, 2020
1 parent e13619e commit 752a271674166c58c4bfdb0624e313edb2a7076e
Showing with 9 additions and 16 deletions.
  1. +8 −8 src/3d/qgs3dexportobject.cpp
  2. +1 −8 src/3d/qgs3dsceneexporter.cpp
@@ -88,10 +88,10 @@ void Qgs3DExportObject::setupPhongMaterial( const QgsPhongMaterialSettings &mate
QColor specular = material.specular();
QColor ambient = material.ambient();
float shininess = material.shininess();
setMaterialParameter( QString( "Kd" ), QString( "%1 %2 %3" ).arg( diffuse.redF() ).arg( diffuse.greenF() ).arg( diffuse.blueF() ) );
setMaterialParameter( QString( "Ka" ), QString( "%1 %2 %3" ).arg( ambient.redF() ).arg( ambient.greenF() ).arg( ambient.blueF() ) );
setMaterialParameter( QString( "Ks" ), QString( "%1 %2 %3" ).arg( specular.redF() ).arg( specular.greenF() ).arg( specular.blueF() ) );
setMaterialParameter( QString( "Ns" ), QString( "%1" ).arg( shininess ) );
setMaterialParameter( QStringLiteral( "Kd" ), QStringLiteral( "%1 %2 %3" ).arg( diffuse.redF() ).arg( diffuse.greenF() ).arg( diffuse.blueF() ) );
setMaterialParameter( QStringLiteral( "Ka" ), QStringLiteral( "%1 %2 %3" ).arg( ambient.redF() ).arg( ambient.greenF() ).arg( ambient.blueF() ) );
setMaterialParameter( QStringLiteral( "Ks" ), QStringLiteral( "%1 %2 %3" ).arg( specular.redF() ).arg( specular.greenF() ).arg( specular.blueF() ) );
setMaterialParameter( QStringLiteral( "Ns" ), QStringLiteral( "%1" ).arg( shininess ) );
}

void Qgs3DExportObject::objectBounds( float &minX, float &minY, float &minZ, float &maxX, float &maxY, float &maxZ )
@@ -154,12 +154,12 @@ void Qgs3DExportObject::saveTo( QTextStream &out, float scale, const QVector3D &
{
int negativeIndex = -1 - ( verticesCount - i );
if ( hasNormals && !hasTextures )
return QString( "%1//%2" ).arg( negativeIndex ).arg( negativeIndex );
return QStringLiteral( "%1//%2" ).arg( negativeIndex ).arg( negativeIndex );
if ( !hasNormals && hasTextures )
return QString( "%1/%2" ).arg( negativeIndex ).arg( negativeIndex );
return QStringLiteral( "%1/%2" ).arg( negativeIndex ).arg( negativeIndex );
if ( hasNormals && hasTextures )
return QString( "%1/%2/%3" ).arg( negativeIndex ).arg( negativeIndex ).arg( negativeIndex );
return QString( "%1" ).arg( negativeIndex );
return QStringLiteral( "%1/%2/%3" ).arg( negativeIndex ).arg( negativeIndex ).arg( negativeIndex );
return QStringLiteral( "%1" ).arg( negativeIndex );
};

if ( mType == TriangularFaces )
@@ -336,7 +336,6 @@ void Qgs3DSceneExporter::processEntityMaterial( Qt3DCore::QEntity *entity, Qgs3D
}
if ( imageTexture != nullptr )
{
qDebug() << "Exporting image texture";
QImage image = imageTexture->getImage();
object->setTextureImage( image );
}
@@ -652,12 +651,6 @@ Qgs3DExportObject *Qgs3DSceneExporter::processGeometryRenderer( Qt3DRender::QGeo
return nullptr;
}

if ( positionData.size() == 0 )
{
qDebug() << "positionData.size()==" << positionData.size();
qDebug() << "indexData.size()==" << indexData.size();
}

Qgs3DExportObject *object = new Qgs3DExportObject( getObjectName( QStringLiteral( "mesh_geometry" ) ), "", this );
object->setupPositionCoordinates( positionData, scale * sceneScale, translation + sceneTranslation );
object->setupFaces( indexData );
@@ -792,7 +785,7 @@ QString Qgs3DSceneExporter::getObjectName( const QString &name )
QString ret = name;
if ( usedObjectNamesCounter.contains( name ) )
{
ret = QString( "%1%2" ).arg( name ).arg( usedObjectNamesCounter[name] );
ret = QStringLiteral( "%1%2" ).arg( name ).arg( usedObjectNamesCounter[name] );
usedObjectNamesCounter[name]++;
}
else

0 comments on commit 752a271

Please sign in to comment.
You can’t perform that action at this time.