Skip to content

Commit

Permalink
make clang-tidy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros committed Jan 30, 2025
1 parent 8d036a9 commit ae91411
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/3d/qgs3dmaptoolpointcloudchangeattribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ QVector<int> Qgs3DMapToolPointCloudChangeAttribute::selectedPointsInNode( const
if ( filterIsValid )
{
double eval = filterExpression.evaluate( i );
if ( !eval || std::isnan( eval ) )
if ( eval == 0.0 || std::isnan( eval ) )
{
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/3d/qgs3dmaptoolpointcloudchangeattribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct MapToPixel3D

QPointF transform( double x, double y, double z, bool *isInView = nullptr ) const
{
const QVector4D cClip = VP * QVector4D( x - origin.x(), y - origin.y(), z - origin.z(), 1 );
QVector4D cClip = VP * QVector4D( static_cast<float>( x - origin.x() ), static_cast<float>( y - origin.y() ), static_cast<float>( z - origin.z() ), 1 );
// normalized device coordinates (-1 to +1)
// z == -1 is near plane, z == +1 is far plane
const float xNdc = cClip.x() / cClip.w();
Expand All @@ -47,8 +47,8 @@ struct MapToPixel3D
*isInView = !( zNdc < -1 || zNdc > 1 || yNdc < -1 || yNdc > 1 || zNdc < -1 || xNdc > 1 );

// window / sceen space coordinates
const float xScreen = ( xNdc + 1 ) * 0.5 * canvasSize.width();
const float yScreen = ( -yNdc + 1 ) * 0.5 * canvasSize.height();
const float xScreen = ( xNdc + 1 ) * 0.5f * canvasSize.width();
const float yScreen = ( -yNdc + 1 ) * 0.5f * canvasSize.height();

return QPointF( xScreen, yScreen );
}
Expand Down

0 comments on commit ae91411

Please sign in to comment.