16 #ifndef QGSPOINTLOCATOR_H
17 #define QGSPOINTLOCATOR_H
27 #include <spatialindex/SpatialIndex.h>
60 enum Type { Invalid = 0, Vertex = 1, Edge = 2, Area = 4, All = Vertex | Edge | Area };
66 bool init(
int maxFeaturesToIndex = -1 );
69 bool hasIndex()
const;
74 Match() : mType( Invalid ), mDist( 0 ), mPoint(), mLayer( 0 ), mFid( 0 ), mVertexIndex( 0 ) {}
77 : mType( t ), mDist( dist ), mPoint( pt ), mLayer( vl ), mFid( fid ), mVertexIndex( vertexIndex )
81 mEdgePoints[0] = edgePoints[0];
82 mEdgePoints[1] = edgePoints[1];
88 bool isValid()
const {
return mType != Invalid; }
90 bool hasEdge()
const {
return mType == Edge; }
91 bool hasArea()
const {
return mType == Area; }
112 pt1 = mEdgePoints[0];
113 pt2 = mEdgePoints[1];
133 virtual bool acceptMatch(
const Match& match ) = 0;
158 bool rebuildIndex(
int maxFeaturesToIndex = -1 );
168 SpatialIndex::IStorageManager* mStorage;
170 QHash<QgsFeatureId, QgsGeometry*> mGeoms;
171 SpatialIndex::ISpatialIndex* mRTree;
188 #endif // QGSPOINTLOCATOR_H