Expose point cloud class statistics to Python

This commit is contained in:
David Koňařík 2024-11-28 11:01:04 +01:00 committed by Martin Dobias
parent 8745c936b0
commit f2afd6a498
4 changed files with 15 additions and 0 deletions

View File

@ -18,6 +18,10 @@ struct QgsPointCloudAttributeStatistics
double mean;
double stDev;
int count;
int singleClassCount( int cls ) const;
%Docstring
Returns the count of points in given class or -1 on error
%End
};
class QgsPointCloudStatistics

View File

@ -18,6 +18,10 @@ struct QgsPointCloudAttributeStatistics
double mean;
double stDev;
int count;
int singleClassCount( int cls ) const;
%Docstring
Returns the count of points in given class or -1 on error
%End
};
class QgsPointCloudStatistics

View File

@ -50,6 +50,11 @@ void QgsPointCloudAttributeStatistics::cumulateStatistics( const QgsPointCloudAt
}
}
int QgsPointCloudAttributeStatistics::singleClassCount( int cls ) const
{
return classCount.value( cls, -1 );
}
// QgsPointCloudStatistics
QgsPointCloudStatistics::QgsPointCloudStatistics()

View File

@ -48,6 +48,8 @@ struct CORE_EXPORT QgsPointCloudAttributeStatistics
//! Updates the current point cloud statistics to hold the cumulation of the current statistics and \a stats
void cumulateStatistics( const QgsPointCloudAttributeStatistics &stats );
#endif
//! Returns the count of points in given class or -1 on error
int singleClassCount( int cls ) const;
};
/**