15 #ifndef QGSFEATUREREQUEST_H
16 #define QGSFEATUREREQUEST_H
18 #include "qgis_core.h"
90 SubsetOfAttributes = 2,
92 IgnoreStaticNodesDuringExpressionCompilation = 8,
95 Q_DECLARE_FLAGS( Flags,
Flag )
112 GeometrySkipInvalid = 1,
113 GeometryAbortOnInvalid = 2,
151 OrderByClause(
const QString &expression,
bool ascending =
true );
160 OrderByClause(
const QString &expression,
bool ascending,
bool nullsfirst );
200 bool ascending()
const;
205 void setAscending(
bool ascending );
211 bool nullsFirst()
const;
216 void setNullsFirst(
bool nullsFirst );
221 QString dump()
const;
227 return mExpression == v.mExpression &&
228 mAscending == v.mAscending &&
229 mNullsFirst == v.mNullsFirst;
234 return !( v == *this );
251 class OrderBy :
public QList<QgsFeatureRequest::OrderByClause>
263 CORE_EXPORT
OrderBy(
const QList<QgsFeatureRequest::OrderByClause> &other );
271 QList<QgsFeatureRequest::OrderByClause> CORE_EXPORT list()
const;
276 void CORE_EXPORT save( QDomElement &elem )
const;
281 void CORE_EXPORT load(
const QDomElement &elem );
287 QSet<QString> CORE_EXPORT usedAttributes()
const;
293 QSet<int> CORE_EXPORT usedAttributeIndices(
const QgsFields &fields )
const;
298 QString CORE_EXPORT dump()
const;
304 static const QString ALL_ATTRIBUTES;
342 FilterType filterType()
const {
return mFilter; }
420 QgsGeometry referenceGeometry()
const {
return mReferenceGeometry; }
430 std::shared_ptr< QgsGeometryEngine > referenceGeometryEngine() const
SIP_SKIP {
return mReferenceGeometryEngine; }
443 double distanceWithin()
const {
return mDistanceWithin; }
479 const QgsFeatureIds &filterFids()
const {
return mFilterFids; }
495 InvalidGeometryCheck invalidGeometryCheck()
const {
return mInvalidGeometryFilter; }
509 Py_BEGIN_ALLOW_THREADS
511 sipCpp->setInvalidGeometryCallback( [a0](
const QgsFeature &arg )
514 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
531 std::function< void(
const QgsFeature & ) > invalidGeometryCallback()
const {
return mInvalidGeometryCallback; }
SIP_SKIP
549 QgsExpression *filterExpression()
const {
return mFilterExpression.get(); }
589 QgsFeatureRequest &disableFilter() { mFilter = FilterNone; mFilterExpression.reset();
return *
this; }
613 QgsFeatureRequest &addOrderBy(
const QString &expression,
bool ascending,
bool nullsfirst );
643 long long limit()
const {
return mLimit; }
645 long long limit()
const;
660 Flags flags()
const {
return mFlags; }
811 Py_BEGIN_ALLOW_THREADS
813 sipCpp->setTransformErrorCallback( [a0](
const QgsFeature &arg )
816 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
834 std::function< void(
const QgsFeature & ) > transformErrorCallback()
const {
return mTransformErrorCallback; }
SIP_SKIP
846 bool acceptFeature(
const QgsFeature &feature );
905 bool requestMayBeNested() const;
957 Qgis::SpatialFilterType mSpatialFilter =
Qgis::SpatialFilterType::NoFilter;
977 double mDistanceWithin = 0;
983 Flags mFlags = Flags();
986 long long mLimit = -1;
989 std::function<
void( const
QgsFeature & ) > mInvalidGeometryCallback;
990 std::function<
void( const
QgsFeature & ) > mTransformErrorCallback;
994 int mRequestMayBeNested = false;
1037 #endif // QGSFEATUREREQUEST_H