QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
qgssensorthingsfeatureiterator.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssensorthingsfeatureiterator.h
3 ----------------
4 begin : November 2023
5 copyright : (C) 2013 Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15#ifndef QGSSENSORTHINGSFEATUREITERATOR_H
16#define QGSSENSORTHINGSFEATUREITERATOR_H
17
19#include "qgsfeatureiterator.h"
21
22#define SIP_NO_FILE
23
25
26class QgsSensorThingsFeatureSource : public QgsAbstractFeatureSource
27{
28 public:
29 QgsSensorThingsFeatureSource( const std::shared_ptr<QgsSensorThingsSharedData> &sharedData );
30 QgsFeatureIterator getFeatures( const QgsFeatureRequest &request ) override;
31
32 QgsSensorThingsSharedData *sharedData() const;
33
34 protected:
35 std::shared_ptr<QgsSensorThingsSharedData> mSharedData;
36
37 friend class QgsSensorThingsFeatureIterator;
38};
39
40class QgsSensorThingsFeatureIterator : public QgsAbstractFeatureIteratorFromSource<QgsSensorThingsFeatureSource>
41{
42 public:
43 QgsSensorThingsFeatureIterator( QgsSensorThingsFeatureSource *source, bool ownSource, const QgsFeatureRequest &request );
44 ~QgsSensorThingsFeatureIterator() override;
45 bool rewind() final;
46 bool close() final;
47 void setInterruptionChecker( QgsFeedback *interruptionChecker ) final;
48
49 protected:
50 bool fetchFeature( QgsFeature &f ) final;
51
52 private:
53 QgsFeatureId mFeatureIterator = 0;
54
55 QList< QgsFeatureId > mRequestFeatureIdList;
56
57 // Feature IDs from current page to fetch
58 QList< QgsFeatureId > mCurrentPageFeatureIdList;
59 // Remaining feature IDs which haven't yet been fetched
60 QList< QgsFeatureId > mRemainingFeatureIds;
61
62 QgsFeatureIds mAlreadyFetchedIds;
63
64 QgsCoordinateTransform mTransform;
65 QgsRectangle mFilterRect;
66 QgsRectangle mGeometryTestFilterRect;
67 QgsGeometry mDistanceWithinGeom;
68 std::unique_ptr< QgsGeometryEngine > mDistanceWithinEngine;
69
70 QgsFeedback *mInterruptionChecker = nullptr;
71 bool mDeferredFeaturesInFilterRectCheck = false;
72
73 QString mCurrentPage;
74 QString mNextPage;
75};
76
78
79#endif // QGSSENSORTHINGSFEATUREITERATOR_H
Helper template that cares of two things: 1.
virtual bool rewind()=0
Resets the iterator to the starting position.
Base class that can be used for any class that is capable of returning features.
virtual QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())=0
Gets an iterator for features matching the specified request.
Wrapper for iterator of features from vector data provider or vector layer.
Wraps a request for features to a vector layer (or directly its vector data provider).
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features