Skip to content

Commit

Permalink
Add pointCount to QgsPointCloudLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson authored and PeterPetrik committed Dec 3, 2020
1 parent 3d4a682 commit 26fb54e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Expand Up @@ -106,6 +106,11 @@ QgsPointCloudLayer cannot be copied.
QgsPointCloudAttributeCollection attributes() const;
%Docstring
Returns the attributes available from the layer.
%End

int pointCount() const;
%Docstring
Returns the total number of points available in the layer.
%End

QgsPointCloudRenderer *renderer();
Expand Down
5 changes: 5 additions & 0 deletions src/core/pointcloud/qgspointcloudlayer.cpp
Expand Up @@ -493,6 +493,11 @@ QgsPointCloudAttributeCollection QgsPointCloudLayer::attributes() const
return mDataProvider ? mDataProvider->attributes() : QgsPointCloudAttributeCollection();
}

int QgsPointCloudLayer::pointCount() const
{
return mDataProvider ? mDataProvider->pointCount() : 0;
}

QgsPointCloudRenderer *QgsPointCloudLayer::renderer()
{
return mRenderer.get();
Expand Down
5 changes: 5 additions & 0 deletions src/core/pointcloud/qgspointcloudlayer.h
Expand Up @@ -133,6 +133,11 @@ class CORE_EXPORT QgsPointCloudLayer : public QgsMapLayer
*/
QgsPointCloudAttributeCollection attributes() const;

/**
* Returns the total number of points available in the layer.
*/
int pointCount() const;

/**
* Returns the 2D renderer for the point cloud.
*
Expand Down

0 comments on commit 26fb54e

Please sign in to comment.