From 289c73d3e89ea832b789dffa1113bcae61c2d118 Mon Sep 17 00:00:00 2001 From: Jean Felder Date: Thu, 6 Jun 2024 16:03:30 +0200 Subject: [PATCH 1/5] qgspointcloud3dsymbol: remove unused variable point --- src/3d/symbols/qgspointcloud3dsymbol_p.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/3d/symbols/qgspointcloud3dsymbol_p.cpp b/src/3d/symbols/qgspointcloud3dsymbol_p.cpp index be64d38785f5..a88673094bd9 100644 --- a/src/3d/symbols/qgspointcloud3dsymbol_p.cpp +++ b/src/3d/symbols/qgspointcloud3dsymbol_p.cpp @@ -607,7 +607,6 @@ void QgsSingleColorPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *p alreadyPrintedDebug = true; } } - const QgsVector3D point( x, y, z ); const QgsVector3D p = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); outNormal.positions.push_back( QVector3D( p.x(), p.y(), p.z() ) ); } From 33f9a7244eae24506bd732c1d6572a54df1c65e2 Mon Sep 17 00:00:00 2001 From: Jean Felder Date: Thu, 6 Jun 2024 16:07:15 +0200 Subject: [PATCH 2/5] qgspointcloud3dsymbol: Remove intermediate point variable --- src/3d/symbols/qgspointcloud3dsymbol_p.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/3d/symbols/qgspointcloud3dsymbol_p.cpp b/src/3d/symbols/qgspointcloud3dsymbol_p.cpp index a88673094bd9..9ec44124fcc8 100644 --- a/src/3d/symbols/qgspointcloud3dsymbol_p.cpp +++ b/src/3d/symbols/qgspointcloud3dsymbol_p.cpp @@ -727,8 +727,7 @@ void QgsColorRampPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *pc, alreadyPrintedDebug = true; } } - QgsVector3D point( x, y, z ); - point = context.map().mapToWorldCoordinates( point ); + QgsVector3D point = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); outNormal.positions.push_back( QVector3D( point.x(), point.y(), point.z() ) ); if ( attrIsX ) @@ -847,8 +846,7 @@ void QgsRGBPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *pc, const alreadyPrintedDebug = true; } } - const QgsVector3D point( x, y, z ); - const QgsVector3D p = context.map().mapToWorldCoordinates( point ); + const QgsVector3D p = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); QVector3D color( 0.0f, 0.0f, 0.0f ); @@ -1012,8 +1010,7 @@ void QgsClassificationPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex alreadyPrintedDebug = true; } } - const QgsVector3D point( x, y, z ); - const QgsVector3D p = context.map().mapToWorldCoordinates( point ); + const QgsVector3D p = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); float iParam = 0.0f; if ( attrIsX ) iParam = x; From 45509c69d24bb61b82c41bf0c7d302f167205ad3 Mon Sep 17 00:00:00 2001 From: Jean Felder Date: Thu, 6 Jun 2024 16:08:48 +0200 Subject: [PATCH 3/5] qgspointcloud3dsymbol: Rename p variables to point --- src/3d/symbols/qgspointcloud3dsymbol_p.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/3d/symbols/qgspointcloud3dsymbol_p.cpp b/src/3d/symbols/qgspointcloud3dsymbol_p.cpp index 9ec44124fcc8..aab7f51fe1ef 100644 --- a/src/3d/symbols/qgspointcloud3dsymbol_p.cpp +++ b/src/3d/symbols/qgspointcloud3dsymbol_p.cpp @@ -607,8 +607,8 @@ void QgsSingleColorPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *p alreadyPrintedDebug = true; } } - const QgsVector3D p = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); - outNormal.positions.push_back( QVector3D( p.x(), p.y(), p.z() ) ); + const QgsVector3D point = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); + outNormal.positions.push_back( QVector3D( point.x(), point.y(), point.z() ) ); } } @@ -846,7 +846,7 @@ void QgsRGBPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *pc, const alreadyPrintedDebug = true; } } - const QgsVector3D p = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); + const QgsVector3D point = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); QVector3D color( 0.0f, 0.0f, 0.0f ); @@ -880,7 +880,7 @@ void QgsRGBPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *pc, const color.setY( ig / 255.0f ); color.setZ( ib / 255.0f ); - outNormal.positions.push_back( QVector3D( p.x(), p.y(), p.z() ) ); + outNormal.positions.push_back( QVector3D( point.x(), point.y(), point.z() ) ); outNormal.colors.push_back( color ); } } @@ -1010,7 +1010,7 @@ void QgsClassificationPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex alreadyPrintedDebug = true; } } - const QgsVector3D p = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); + const QgsVector3D point = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); float iParam = 0.0f; if ( attrIsX ) iParam = x; @@ -1024,7 +1024,7 @@ void QgsClassificationPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex if ( filteredOutValues.contains( ( int ) iParam ) || ! categoriesValues.contains( ( int ) iParam ) ) continue; - outNormal.positions.push_back( QVector3D( p.x(), p.y(), p.z() ) ); + outNormal.positions.push_back( QVector3D( point.x(), point.y(), point.z() ) ); // find iParam actual index in the categories list float iParam2 = categoriesValues.indexOf( ( int )iParam ) + 1; From 568691f08f0c2367b09810144ac50dfb497d6bea Mon Sep 17 00:00:00 2001 From: Jean Felder Date: Thu, 6 Jun 2024 20:28:46 +0200 Subject: [PATCH 4/5] qgspointcloud3dsymbol: Fix clang-tidy warning --- src/3d/symbols/qgspointcloud3dsymbol_p.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/3d/symbols/qgspointcloud3dsymbol_p.cpp b/src/3d/symbols/qgspointcloud3dsymbol_p.cpp index aab7f51fe1ef..3475a41efd89 100644 --- a/src/3d/symbols/qgspointcloud3dsymbol_p.cpp +++ b/src/3d/symbols/qgspointcloud3dsymbol_p.cpp @@ -608,7 +608,7 @@ void QgsSingleColorPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *p } } const QgsVector3D point = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); - outNormal.positions.push_back( QVector3D( point.x(), point.y(), point.z() ) ); + outNormal.positions.push_back( QVector3D( static_cast( point.x() ), static_cast( point.y() ), static_cast( point.z() ) ) ); } } @@ -728,7 +728,7 @@ void QgsColorRampPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *pc, } } QgsVector3D point = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); - outNormal.positions.push_back( QVector3D( point.x(), point.y(), point.z() ) ); + outNormal.positions.push_back( QVector3D( static_cast( point.x() ), static_cast( point.y() ), static_cast( point.z() ) ) ); if ( attrIsX ) outNormal.parameter.push_back( x ); @@ -880,7 +880,7 @@ void QgsRGBPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *pc, const color.setY( ig / 255.0f ); color.setZ( ib / 255.0f ); - outNormal.positions.push_back( QVector3D( point.x(), point.y(), point.z() ) ); + outNormal.positions.push_back( QVector3D( static_cast( point.x() ), static_cast( point.y() ), static_cast( point.z() ) ) ); outNormal.colors.push_back( color ); } } @@ -1024,7 +1024,7 @@ void QgsClassificationPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex if ( filteredOutValues.contains( ( int ) iParam ) || ! categoriesValues.contains( ( int ) iParam ) ) continue; - outNormal.positions.push_back( QVector3D( point.x(), point.y(), point.z() ) ); + outNormal.positions.push_back( QVector3D( static_cast( point.x() ), static_cast( point.y() ), static_cast( point.z() ) ) ); // find iParam actual index in the categories list float iParam2 = categoriesValues.indexOf( ( int )iParam ) + 1; From 29520b6085c001a23fe363ee9a1125616a58020c Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 7 Jun 2024 08:10:21 +1000 Subject: [PATCH 5/5] Update src/3d/symbols/qgspointcloud3dsymbol_p.cpp --- src/3d/symbols/qgspointcloud3dsymbol_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3d/symbols/qgspointcloud3dsymbol_p.cpp b/src/3d/symbols/qgspointcloud3dsymbol_p.cpp index 3475a41efd89..1e9663383dca 100644 --- a/src/3d/symbols/qgspointcloud3dsymbol_p.cpp +++ b/src/3d/symbols/qgspointcloud3dsymbol_p.cpp @@ -727,7 +727,7 @@ void QgsColorRampPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *pc, alreadyPrintedDebug = true; } } - QgsVector3D point = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); + const QgsVector3D point = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) ); outNormal.positions.push_back( QVector3D( static_cast( point.x() ), static_cast( point.y() ), static_cast( point.z() ) ) ); if ( attrIsX )