Skip to content

Commit

Permalink
Add missing const
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 28, 2019
1 parent e8b8867 commit 2a7f9c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion python/core/auto_generated/geometry/qgsgeometry.sip.in
Expand Up @@ -1466,7 +1466,7 @@ Returns an extruded version of this geometry.
%End


SIP_PYOBJECT randomPointsInPolygon( int count, unsigned long seed = 0 ) /TypeHint="QgsPolylineXY"/;
SIP_PYOBJECT randomPointsInPolygon( int count, unsigned long seed = 0 ) const /TypeHint="QgsPolylineXY"/;
%Docstring
Returns a list of ``count`` random points generated inside a (multi)polygon geometry.

Expand Down
4 changes: 2 additions & 2 deletions src/core/geometry/qgsgeometry.cpp
Expand Up @@ -2330,15 +2330,15 @@ QgsGeometry QgsGeometry::extrude( double x, double y )
}

///@cond PRIVATE // avoid dox warning
QVector<QgsPointXY> QgsGeometry::randomPointsInPolygon( int count, const std::function< bool( const QgsPointXY & ) > &acceptPoint, unsigned long seed, QgsFeedback *feedback )
QVector<QgsPointXY> QgsGeometry::randomPointsInPolygon( int count, const std::function< bool( const QgsPointXY & ) > &acceptPoint, unsigned long seed, QgsFeedback *feedback ) const
{
if ( type() != QgsWkbTypes::PolygonGeometry )
return QVector< QgsPointXY >();

return QgsInternalGeometryEngine::randomPointsInPolygon( *this, count, acceptPoint, seed, feedback );
}

QVector<QgsPointXY> QgsGeometry::randomPointsInPolygon( int count, unsigned long seed, QgsFeedback *feedback )
QVector<QgsPointXY> QgsGeometry::randomPointsInPolygon( int count, unsigned long seed, QgsFeedback *feedback ) const
{
if ( type() != QgsWkbTypes::PolygonGeometry )
return QVector< QgsPointXY >();
Expand Down
6 changes: 3 additions & 3 deletions src/core/geometry/qgsgeometry.h
Expand Up @@ -1466,7 +1466,7 @@ class CORE_EXPORT QgsGeometry
*
* \since QGIS 3.10
*/
QVector< QgsPointXY > randomPointsInPolygon( int count, const std::function< bool( const QgsPointXY & ) > &acceptPoint, unsigned long seed = 0, QgsFeedback *feedback = nullptr );
QVector< QgsPointXY > randomPointsInPolygon( int count, const std::function< bool( const QgsPointXY & ) > &acceptPoint, unsigned long seed = 0, QgsFeedback *feedback = nullptr ) const;

/**
* Returns a list of \a count random points generated inside a (multi)polygon geometry.
Expand All @@ -1481,7 +1481,7 @@ class CORE_EXPORT QgsGeometry
*
* \since QGIS 3.10
*/
QVector< QgsPointXY > randomPointsInPolygon( int count, unsigned long seed = 0, QgsFeedback *feedback = nullptr );
QVector< QgsPointXY > randomPointsInPolygon( int count, unsigned long seed = 0, QgsFeedback *feedback = nullptr ) const;
///@cond PRIVATE
#else

Expand All @@ -1497,7 +1497,7 @@ class CORE_EXPORT QgsGeometry
*
* \since QGIS 3.10
*/
SIP_PYOBJECT randomPointsInPolygon( int count, unsigned long seed = 0 ) SIP_TYPEHINT( QgsPolylineXY );
SIP_PYOBJECT randomPointsInPolygon( int count, unsigned long seed = 0 ) const SIP_TYPEHINT( QgsPolylineXY );
% MethodCode
const QgsWkbTypes::GeometryType type = sipCpp->type();
if ( sipCpp->isNull() )
Expand Down

0 comments on commit 2a7f9c3

Please sign in to comment.