Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem authored and wonder-sk committed Apr 8, 2021
1 parent 4a0230f commit 1a60a45
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Expand Up @@ -26,7 +26,7 @@ Encapsulates the render context for a 2D point cloud rendering operation.
public:

QgsPointCloudRenderContext( QgsRenderContext &context, const QgsVector3D &scale, const QgsVector3D &offset,
double zValueScale, double zValueFixedOffset, QgsFeedback *feedback );
double zValueScale, double zValueFixedOffset, QgsFeedback *feedback = 0 );
%Docstring
Constructor for QgsPointCloudRenderContext.

Expand Down
5 changes: 3 additions & 2 deletions src/core/pointcloud/qgspointcloudlayerrenderer.cpp
Expand Up @@ -242,14 +242,15 @@ int QgsPointCloudLayerRenderer::renderNodesAsync( const QVector<IndexedPointClou
const int groupSize = 4;
for ( int groupIndex = 0; groupIndex < nodes.size(); groupIndex += groupSize )
{
if ( context.feedback()->isCanceled() )
if ( context.feedback() && context.feedback()->isCanceled() )
break;
// Async loading of nodes
const int currentGroupSize = std::min( std::max( nodes.size() - groupIndex, 0 ), groupSize );
QVector<QgsPointCloudBlockRequest *> blockRequests( currentGroupSize, nullptr );
QVector<bool> finishedLoadingBlock( currentGroupSize, false );
QEventLoop loop;
QObject::connect( context.feedback(), &QgsFeedback::canceled, &loop, &QEventLoop::quit );
if ( context.feedback() )
QObject::connect( context.feedback(), &QgsFeedback::canceled, &loop, &QEventLoop::quit );
// Note: All capture by reference warnings here shouldn't be an issue since we have an event loop, so locals won't be deallocated
for ( int i = 0; i < blockRequests.size(); ++i )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/pointcloud/qgspointcloudrenderer.h
Expand Up @@ -55,7 +55,7 @@ class CORE_EXPORT QgsPointCloudRenderContext
* taken from the point cloud index.
*/
QgsPointCloudRenderContext( QgsRenderContext &context, const QgsVector3D &scale, const QgsVector3D &offset,
double zValueScale, double zValueFixedOffset, QgsFeedback *feedback );
double zValueScale, double zValueFixedOffset, QgsFeedback *feedback = nullptr );

//! QgsPointCloudRenderContext cannot be copied.
QgsPointCloudRenderContext( const QgsPointCloudRenderContext &rh ) = delete;
Expand Down

0 comments on commit 1a60a45

Please sign in to comment.