Skip to content
Permalink
Browse files

Older sip versions DO require custom conversion code!

  • Loading branch information
nyalldawson authored and wonder-sk committed Jan 4, 2021
1 parent e3e8af7 commit 923af4e8333cf42d6f1428b39400842ee90fee44
@@ -56,7 +56,8 @@ Ctor

~QgsPointCloudDataProvider();

QVector<QVariantMap> identify( double maxError, const QgsGeometry &extentGeometry, const QgsDoubleRange &extentZRange = QgsDoubleRange(), int pointsLimit = 1000 );

SIP_PYLIST identify( float maxErrorInMapCoords, QgsGeometry extentGeometry, const QgsDoubleRange extentZRange = QgsDoubleRange(), int pointsLimit = 1000 );
%Docstring
Returns the list of points of the point cloud according to a zoom level
defined by ``maxError`` (in layer coordinates), an extent ``geometry`` in the 2D plane
@@ -70,6 +71,23 @@ the number of points returned to ``pointsLimit`` points
this function does not handle elevation properties and you need to
change elevation coordinates yourself after returning from the function
%End
%MethodCode
{
QVector<QMap<QString, QVariant>> res = sipCpp->identify( a0, *a1, *a2, a3 );
sipRes = PyList_New( res.size() );
for ( int i = 0; i < res.size(); ++i )
{
PyObject *dict = PyDict_New();
for ( QString key : res[i].keys() )
{
PyObject *keyObj = sipConvertFromNewType( new QString( key ), sipType_QString, Py_None );
PyObject *valObj = sipConvertFromNewType( new QVariant( res[i][key] ), sipType_QVariant, Py_None );
PyDict_SetItem( dict, keyObj, valObj );
}
PyList_SET_ITEM( sipRes, i, dict );
}
}
%End

virtual QgsPointCloudDataProvider::Capabilities capabilities() const;
%Docstring
@@ -74,6 +74,8 @@ class CORE_EXPORT QgsPointCloudDataProvider: public QgsDataProvider

~QgsPointCloudDataProvider() override;

#ifndef SIP_RUN

/**
* Returns the list of points of the point cloud according to a zoom level
* defined by \a maxError (in layer coordinates), an extent \a geometry in the 2D plane
@@ -86,6 +88,38 @@ class CORE_EXPORT QgsPointCloudDataProvider: public QgsDataProvider
* change elevation coordinates yourself after returning from the function
*/
QVector<QVariantMap> identify( double maxError, const QgsGeometry &extentGeometry, const QgsDoubleRange &extentZRange = QgsDoubleRange(), int pointsLimit = 1000 );
#else

/**
* Returns the list of points of the point cloud according to a zoom level
* defined by \a maxError (in layer coordinates), an extent \a geometry in the 2D plane
* and a range \a extentZRange for z values. The function will try to limit
* the number of points returned to \a pointsLimit points
*
* \a maxErrorPixels : maximum accepted error factor in pixels
*
* \note this function does not handle elevation properties and you need to
* change elevation coordinates yourself after returning from the function
*/
SIP_PYLIST identify( float maxErrorInMapCoords, QgsGeometry extentGeometry, const QgsDoubleRange extentZRange = QgsDoubleRange(), int pointsLimit = 1000 );
% MethodCode
{
QVector<QMap<QString, QVariant>> res = sipCpp->identify( a0, *a1, *a2, a3 );
sipRes = PyList_New( res.size() );
for ( int i = 0; i < res.size(); ++i )
{
PyObject *dict = PyDict_New();
for ( QString key : res[i].keys() )
{
PyObject *keyObj = sipConvertFromNewType( new QString( key ), sipType_QString, Py_None );
PyObject *valObj = sipConvertFromNewType( new QVariant( res[i][key] ), sipType_QVariant, Py_None );
PyDict_SetItem( dict, keyObj, valObj );
}
PyList_SET_ITEM( sipRes, i, dict );
}
}
% End
#endif

/**
* Returns flags containing the supported capabilities for the data provider.

0 comments on commit 923af4e

Please sign in to comment.
You can’t perform that action at this time.