QGIS API Documentation  2.99.0-Master (08c2e66)
qgsgeometrycache.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsgeometrycache.h
3  ---------------------
4  begin : March 2013
5  copyright : (C) 2013 by Matthias Kuhn
6  email : matthias at opengis dot ch
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 QGSGEOMETRYCACHE_H
16 #define QGSGEOMETRYCACHE_H
17 
18 #include "qgis_core.h"
19 #include "qgsgeometry.h"
20 #include "qgsfeature.h"
21 #include "qgsrectangle.h"
22 
23 #include <QMap>
24 
28 class CORE_EXPORT QgsGeometryCache
29 {
30  public:
32 
33  inline QgsGeometryMap& cachedGeometries() { return mCachedGeometries; }
34 
36  bool geometry( QgsFeatureId fid, QgsGeometry& geometry );
37 
39  void cacheGeometry( QgsFeatureId fid, const QgsGeometry& geom );
40 
42  void removeGeometry( QgsFeatureId fid ) { mCachedGeometries.remove( fid ); }
43 
45  void deleteCachedGeometries();
46 
47  void setCachedGeometriesRect( const QgsRectangle& extent ) { mCachedGeometriesRect = extent; }
48  const QgsRectangle& cachedGeometriesRect() { return mCachedGeometriesRect; }
49 
50  protected:
51 
54 
57 
58 };
59 
60 #endif // QGSGEOMETRYCACHE_H
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Definition: qgsfeature.h:353
A rectangle specified with double values.
Definition: qgsrectangle.h:36
QgsRectangle mCachedGeometriesRect
Extent for which there are cached geometries.
const QgsRectangle & cachedGeometriesRect()
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:79
void setCachedGeometriesRect(const QgsRectangle &extent)
QgsGeometryMap & cachedGeometries()
void removeGeometry(QgsFeatureId fid)
get rid of the cached geometry
QgsGeometryMap mCachedGeometries
Cache of the committed geometries retrieved for the current display
qint64 QgsFeatureId
Definition: qgsfeature.h:33