QGIS API Documentation 3.41.0-Master (af5edcb665c)
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
18#include "qgsfeatureiterator.h"
21
22#define SIP_NO_FILE
23
25
26class QgsSensorThingsFeatureSource : public QgsAbstractFeatureSource
27{
28
29 public:
30 QgsSensorThingsFeatureSource( const std::shared_ptr<QgsSensorThingsSharedData> &sharedData );
31 QgsFeatureIterator getFeatures( const QgsFeatureRequest &request ) override;
32
33 QgsSensorThingsSharedData *sharedData() const;
34
35 protected:
36 std::shared_ptr<QgsSensorThingsSharedData> mSharedData;
37
38 friend class QgsSensorThingsFeatureIterator;
39};
40
41class QgsSensorThingsFeatureIterator : public QgsAbstractFeatureIteratorFromSource<QgsSensorThingsFeatureSource>
42{
43 public:
44 QgsSensorThingsFeatureIterator( QgsSensorThingsFeatureSource *source, bool ownSource, const QgsFeatureRequest &request );
45 ~QgsSensorThingsFeatureIterator() override;
46 bool rewind() final;
47 bool close() final;
48 void setInterruptionChecker( QgsFeedback *interruptionChecker ) final;
49
50 protected:
51 bool fetchFeature( QgsFeature &f ) final;
52
53 private:
54 QgsFeatureId mFeatureIterator = 0;
55
56 QList< QgsFeatureId > mRequestFeatureIdList;
57
58 // Feature IDs from current page to fetch
59 QList< QgsFeatureId > mCurrentPageFeatureIdList;
60 // Remaining feature IDs which haven't yet been fetched
61 QList< QgsFeatureId > mRemainingFeatureIds;
62
63 QgsFeatureIds mAlreadyFetchedIds;
64
65 QgsCoordinateTransform mTransform;
66 QgsRectangle mFilterRect;
67 QgsRectangle mGeometryTestFilterRect;
68 QgsGeometry mDistanceWithinGeom;
69 std::unique_ptr< QgsGeometryEngine > mDistanceWithinEngine;
70
71 QgsFeedback *mInterruptionChecker = nullptr;
72 bool mDeferredFeaturesInFilterRectCheck = false;
73
74 QString mCurrentPage;
75 QString mNextPage;
76};
77
79
80#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.
Class for doing transforms between two map coordinate systems.
Wrapper for iterator of features from vector data provider or vector layer.
This class wraps a request for features to a vector layer (or directly its vector data provider).
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
A geometry engine is a low-level representation of a QgsAbstractGeometry object, optimised for use wi...
A geometry is the spatial representation of a feature.
A rectangle specified with double values.
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features