Skip to content

Commit

Permalink
qDebug & QString cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem committed Jul 22, 2020
1 parent e13619e commit 752a271
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
16 changes: 8 additions & 8 deletions src/3d/qgs3dexportobject.cpp
Expand Up @@ -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 )
Expand Down Expand Up @@ -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 )
Expand Down
9 changes: 1 addition & 8 deletions src/3d/qgs3dsceneexporter.cpp
Expand Up @@ -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 );
}
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 752a271

Please sign in to comment.