Skip to content

Commit

Permalink
Use -180 to 180 range for ScanAngleRank
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros committed Feb 10, 2025
1 parent 72ab6a4 commit 259615c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/app/3d/qgs3dmapcanvaswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -920,10 +920,10 @@ void Qgs3DMapCanvasWidget::onPointCloudChangeAttributeSettingsChanged()
}
else if ( attributeName == QLatin1String( "ScanAngleRank" ) )
{
mSpinChangeAttributeValue->setMinimum( -30'000 );
mSpinChangeAttributeValue->setMaximum( 30'000 );
mSpinChangeAttributeValue->setDecimals( 0 );
mSpinChangeAttributeValue->setDecimals( 0 );
mSpinChangeAttributeValue->setMinimum( -180 );
mSpinChangeAttributeValue->setMaximum( 180 );
mSpinChangeAttributeValue->setDecimals( 3 );
mSpinChangeAttributeValue->setSuffix( QStringLiteral( " (%1)" ).arg( tr( "degrees" ) ) );
}
else if ( attributeName == QLatin1String( "GpsTime" ) )
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/pointcloud/qgspointcloudlayereditutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static void updatePoint( char *pointBuffer, int pointFormat, const QString &attr
}
else if ( attributeName == QLatin1String( "ScanAngleRank" ) ) // short
{
qint16 newValueShort = static_cast<qint16>( newValue );
qint16 newValueShort = static_cast<qint16>( std::round( newValue / 0.006 ) ); // copc stores angle in 0.006deg increments
memcpy( pointBuffer + 18, &newValueShort, sizeof( qint16 ) );
}
else if ( attributeName == QLatin1String( "PointSourceId" ) ) // unsigned short
Expand Down Expand Up @@ -182,7 +182,7 @@ bool QgsPointCloudLayerEditUtils::isAttributeValueValid( const QgsPointCloudAttr
if ( name == QLatin1String( "USERDATA" ) )
return value >= 0 && value <= 255;
if ( name == QLatin1String( "SCANANGLERANK" ) )
return value >= -30'000 && value <= 30'000;
return value >= -180 && value <= 180;
if ( name == QLatin1String( "POINTSOURCEID" ) )
return value >= 0 && value <= 65535;
if ( name == QLatin1String( "GPSTIME" ) )
Expand Down

0 comments on commit 259615c

Please sign in to comment.