QGIS API Documentation  2.12.0-Lyon
qgsgeometrycache.h
Go to the documentation of this file.
1 #ifndef QGSGEOMETRYCACHE_H
2 #define QGSGEOMETRYCACHE_H
3 
4 #include "qgsgeometry.h"
5 #include "qgsfeature.h"
6 #include "qgsrectangle.h"
7 
8 #include <QMap>
9 
10 class CORE_EXPORT QgsGeometryCache
11 {
12  public:
15 
16  inline QgsGeometryMap& cachedGeometries() { return mCachedGeometries; }
17 
19  bool geometry( QgsFeatureId fid, QgsGeometry& geometry );
20 
22  void cacheGeometry( QgsFeatureId fid, const QgsGeometry& geom );
23 
25  void removeGeometry( QgsFeatureId fid ) { mCachedGeometries.remove( fid ); }
26 
27 
29  void deleteCachedGeometries();
30 
31  void setCachedGeometriesRect( const QgsRectangle& extent ) { mCachedGeometriesRect = extent; }
32  const QgsRectangle& cachedGeometriesRect() { return mCachedGeometriesRect; }
33 
34  protected:
35 
38 
41 
42 };
43 
44 #endif // QGSGEOMETRYCACHE_H
A rectangle specified with double values.
Definition: qgsrectangle.h:35
QgsRectangle mCachedGeometriesRect
Extent for which there are cached geometries.
const QgsRectangle & cachedGeometriesRect()
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:76
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:31