Skip to content

Commit 752a271

Browse files
committedJul 22, 2020
qDebug & QString cleanup
1 parent e13619e commit 752a271

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed
 

‎src/3d/qgs3dexportobject.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ void Qgs3DExportObject::setupPhongMaterial( const QgsPhongMaterialSettings &mate
8888
QColor specular = material.specular();
8989
QColor ambient = material.ambient();
9090
float shininess = material.shininess();
91-
setMaterialParameter( QString( "Kd" ), QString( "%1 %2 %3" ).arg( diffuse.redF() ).arg( diffuse.greenF() ).arg( diffuse.blueF() ) );
92-
setMaterialParameter( QString( "Ka" ), QString( "%1 %2 %3" ).arg( ambient.redF() ).arg( ambient.greenF() ).arg( ambient.blueF() ) );
93-
setMaterialParameter( QString( "Ks" ), QString( "%1 %2 %3" ).arg( specular.redF() ).arg( specular.greenF() ).arg( specular.blueF() ) );
94-
setMaterialParameter( QString( "Ns" ), QString( "%1" ).arg( shininess ) );
91+
setMaterialParameter( QStringLiteral( "Kd" ), QStringLiteral( "%1 %2 %3" ).arg( diffuse.redF() ).arg( diffuse.greenF() ).arg( diffuse.blueF() ) );
92+
setMaterialParameter( QStringLiteral( "Ka" ), QStringLiteral( "%1 %2 %3" ).arg( ambient.redF() ).arg( ambient.greenF() ).arg( ambient.blueF() ) );
93+
setMaterialParameter( QStringLiteral( "Ks" ), QStringLiteral( "%1 %2 %3" ).arg( specular.redF() ).arg( specular.greenF() ).arg( specular.blueF() ) );
94+
setMaterialParameter( QStringLiteral( "Ns" ), QStringLiteral( "%1" ).arg( shininess ) );
9595
}
9696

9797
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 &
154154
{
155155
int negativeIndex = -1 - ( verticesCount - i );
156156
if ( hasNormals && !hasTextures )
157-
return QString( "%1//%2" ).arg( negativeIndex ).arg( negativeIndex );
157+
return QStringLiteral( "%1//%2" ).arg( negativeIndex ).arg( negativeIndex );
158158
if ( !hasNormals && hasTextures )
159-
return QString( "%1/%2" ).arg( negativeIndex ).arg( negativeIndex );
159+
return QStringLiteral( "%1/%2" ).arg( negativeIndex ).arg( negativeIndex );
160160
if ( hasNormals && hasTextures )
161-
return QString( "%1/%2/%3" ).arg( negativeIndex ).arg( negativeIndex ).arg( negativeIndex );
162-
return QString( "%1" ).arg( negativeIndex );
161+
return QStringLiteral( "%1/%2/%3" ).arg( negativeIndex ).arg( negativeIndex ).arg( negativeIndex );
162+
return QStringLiteral( "%1" ).arg( negativeIndex );
163163
};
164164

165165
if ( mType == TriangularFaces )

‎src/3d/qgs3dsceneexporter.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ void Qgs3DSceneExporter::processEntityMaterial( Qt3DCore::QEntity *entity, Qgs3D
336336
}
337337
if ( imageTexture != nullptr )
338338
{
339-
qDebug() << "Exporting image texture";
340339
QImage image = imageTexture->getImage();
341340
object->setTextureImage( image );
342341
}
@@ -652,12 +651,6 @@ Qgs3DExportObject *Qgs3DSceneExporter::processGeometryRenderer( Qt3DRender::QGeo
652651
return nullptr;
653652
}
654653

655-
if ( positionData.size() == 0 )
656-
{
657-
qDebug() << "positionData.size()==" << positionData.size();
658-
qDebug() << "indexData.size()==" << indexData.size();
659-
}
660-
661654
Qgs3DExportObject *object = new Qgs3DExportObject( getObjectName( QStringLiteral( "mesh_geometry" ) ), "", this );
662655
object->setupPositionCoordinates( positionData, scale * sceneScale, translation + sceneTranslation );
663656
object->setupFaces( indexData );
@@ -792,7 +785,7 @@ QString Qgs3DSceneExporter::getObjectName( const QString &name )
792785
QString ret = name;
793786
if ( usedObjectNamesCounter.contains( name ) )
794787
{
795-
ret = QString( "%1%2" ).arg( name ).arg( usedObjectNamesCounter[name] );
788+
ret = QStringLiteral( "%1%2" ).arg( name ).arg( usedObjectNamesCounter[name] );
796789
usedObjectNamesCounter[name]++;
797790
}
798791
else

0 commit comments

Comments
 (0)
Please sign in to comment.