Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qgspointcloud3dsymbol small cleanup #57699

Merged
merged 5 commits into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions src/3d/symbols/qgspointcloud3dsymbol_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,9 +607,8 @@ 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() ) );
const QgsVector3D point = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) );
outNormal.positions.push_back( QVector3D( static_cast<float>( point.x() ), static_cast<float>( point.y() ), static_cast<float>( point.z() ) ) );
}
}

Expand Down Expand Up @@ -728,9 +727,8 @@ void QgsColorRampPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *pc,
alreadyPrintedDebug = true;
}
}
QgsVector3D point( x, y, z );
point = context.map().mapToWorldCoordinates( point );
outNormal.positions.push_back( QVector3D( point.x(), point.y(), point.z() ) );
const QgsVector3D point = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) );
outNormal.positions.push_back( QVector3D( static_cast<float>( point.x() ), static_cast<float>( point.y() ), static_cast<float>( point.z() ) ) );

if ( attrIsX )
outNormal.parameter.push_back( x );
Expand Down Expand Up @@ -848,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 point = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) );

QVector3D color( 0.0f, 0.0f, 0.0f );

Expand Down Expand Up @@ -883,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( static_cast<float>( point.x() ), static_cast<float>( point.y() ), static_cast<float>( point.z() ) ) );
outNormal.colors.push_back( color );
}
}
Expand Down Expand Up @@ -1013,8 +1010,7 @@ void QgsClassificationPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex
alreadyPrintedDebug = true;
}
}
const QgsVector3D point( x, y, z );
const QgsVector3D p = context.map().mapToWorldCoordinates( point );
const QgsVector3D point = context.map().mapToWorldCoordinates( QgsVector3D( x, y, z ) );
float iParam = 0.0f;
if ( attrIsX )
iParam = x;
Expand All @@ -1028,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( static_cast<float>( point.x() ), static_cast<float>( point.y() ), static_cast<float>( point.z() ) ) );

// find iParam actual index in the categories list
float iParam2 = categoriesValues.indexOf( ( int )iParam ) + 1;
Expand Down
Loading