Skip to content

Commit

Permalink
Don't cache failed blocks
Browse files Browse the repository at this point in the history
Address review
  • Loading branch information
uclaros authored and wonder-sk committed Feb 5, 2024
1 parent 9ea3725 commit a09b3d0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ Ctor
%End
virtual ~QgsPointCloudBlock();

QgsPointCloudBlock *clone() const;
QgsPointCloudBlock *clone() const /Factory/;
%Docstring
Clones the QgsPointCloudBlock returning a new copy.
Caller takes ownership of the returned object.

.. versionadded:: 3.36
%End

const char *data() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ Ctor
%End
virtual ~QgsPointCloudBlock();

QgsPointCloudBlock *clone() const;
QgsPointCloudBlock *clone() const /Factory/;
%Docstring
Clones the QgsPointCloudBlock returning a new copy.
Caller takes ownership of the returned object.

.. versionadded:: 3.36
%End

const char *data() const;
Expand Down
3 changes: 2 additions & 1 deletion src/core/pointcloud/qgspointcloudblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ class CORE_EXPORT QgsPointCloudBlock
/**
* Clones the QgsPointCloudBlock returning a new copy.
* Caller takes ownership of the returned object.
* \since QGIS 3.36
*/
QgsPointCloudBlock *clone() const;
QgsPointCloudBlock *clone() const SIP_FACTORY;

//! Returns raw pointer to data
const char *data() const;
Expand Down
3 changes: 3 additions & 0 deletions src/core/pointcloud/qgspointcloudindex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ void QgsPointCloudIndex::storeNodeDataToCache( QgsPointCloudBlock *data, const I

void QgsPointCloudIndex::storeNodeDataToCacheStatic( QgsPointCloudBlock *data, const IndexedPointCloudNode &node, const QgsPointCloudRequest &request, const QgsPointCloudExpression &expression, const QString &uri )
{
if ( !data )
return;

QgsPointCloudCacheKey key( node, request, expression, uri );

const int cost = data->pointCount() * data->pointRecordSize();
Expand Down
2 changes: 1 addition & 1 deletion src/core/pointcloud/qgspointcloudrequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ QgsPointCloudRequest::QgsPointCloudRequest() = default;
bool QgsPointCloudRequest::operator==( const QgsPointCloudRequest &other ) const
{
return mFilterRect == other.filterRect() &&
mAttributes.toFields() == other.attributes().toFields(); //todo: QgsPointCloudAttributeCollection::operator==
mAttributes.toFields() == other.attributes().toFields();
}

QgsPointCloudAttributeCollection QgsPointCloudRequest::attributes() const
Expand Down

0 comments on commit a09b3d0

Please sign in to comment.