QGIS API Documentation  2.3.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Definition: qgsfeature.h:324
A rectangle specified with double values.
Definition: qgsrectangle.h:35
QgsRectangle mCachedGeometriesRect
extent for which there are cached geometries
const QgsRectangle & cachedGeometriesRect()
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:30