QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsspatialindexkdbush.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsspatialindexkdbush.h
3  -----------------
4  begin : July 2018
5  copyright : (C) 2018 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSSPATIALINDEXKDBUSH_H
19 #define QGSSPATIALINDEXKDBUSH_H
20 
21 class QgsFeatureIterator;
22 class QgsFeedback;
23 class QgsFeatureSource;
24 class QgsSpatialIndexKDBushPrivate;
25 class QgsRectangle;
26 
27 #include "qgis_core.h"
29 #include "qgspointxy.h"
30 #include <memory>
31 #include <QList>
32 #include <functional>
33 
53 class CORE_EXPORT QgsSpatialIndexKDBush
54 {
55  public:
56 
66  explicit QgsSpatialIndexKDBush( QgsFeatureIterator &fi, QgsFeedback *feedback = nullptr );
67 
77  explicit QgsSpatialIndexKDBush( const QgsFeatureSource &source, QgsFeedback *feedback = nullptr );
78 
81 
83  QgsSpatialIndexKDBush &operator=( const QgsSpatialIndexKDBush &other );
84 
86 
90  QList<QgsSpatialIndexKDBushData> intersects( const QgsRectangle &rectangle ) const;
91 
97  void intersects( const QgsRectangle &rectangle, const std::function<void( QgsSpatialIndexKDBushData )> &visitor ) const SIP_SKIP;
98 
103  QList<QgsSpatialIndexKDBushData> within( const QgsPointXY &point, double radius ) const;
104 
111  void within( const QgsPointXY &point, double radius, const std::function<void( QgsSpatialIndexKDBushData )> &visitor ) SIP_SKIP;
112 
116  qgssize size() const;
117 
118  private:
119 
121  QgsSpatialIndexKDBushPrivate *d = nullptr;
122 
123  friend class TestQgsSpatialIndexKdBush;
124 };
125 
126 #endif // QGSSPATIALINDEXKDBUSH_H
QgsFeatureSource
Definition: qgsfeaturesource.h:37
QgsRectangle
Definition: qgsrectangle.h:41
qgsspatialindexkdbushdata.h
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsFeedback
Definition: qgsfeedback.h:43
QgsPointXY
Definition: qgspointxy.h:43
QgsFeatureIterator
Definition: qgsfeatureiterator.h:263
QgsSpatialIndexKDBush
Definition: qgsspatialindexkdbush.h:53
qgspointxy.h
QgsSpatialIndexKDBushData
Definition: qgsspatialindexkdbushdata.h:32
qgssize
unsigned long long qgssize
Qgssize is used instead of size_t, because size_t is stdlib type, unknown by SIP, and it would be har...
Definition: qgis.h:723