QGIS API Documentation  2.2.0-Valmiera
 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 "qgsfeature.h"
5 
6 #include "qgsvectorlayer.h"
7 
8 class CORE_EXPORT QgsGeometryCache
9 {
10  public:
13 
14  inline QgsGeometryMap& cachedGeometries() { return mCachedGeometries; }
15 
17  bool geometry( QgsFeatureId fid, QgsGeometry& geometry );
18 
20  void cacheGeometry( QgsFeatureId fid, const QgsGeometry& geom );
21 
23  void removeGeometry( QgsFeatureId fid ) { mCachedGeometries.remove( fid ); }
24 
25 
27  void deleteCachedGeometries();
28 
29  void setCachedGeometriesRect( const QgsRectangle& extent ) { mCachedGeometriesRect = extent; }
30  const QgsRectangle& cachedGeometriesRect() { return mCachedGeometriesRect; }
31 
32  protected:
33 
34  inline QgsVectorLayerEditBuffer* editBuffer() { return L->editBuffer(); }
35 
37 
40 
43 
44 };
45 
46 #endif // QGSGEOMETRYCACHE_H
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Definition: qgsfeature.h:320
A rectangle specified with double values.
Definition: qgsrectangle.h:35
QgsVectorLayerEditBuffer * editBuffer()
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
QgsVectorLayer * L
QgsGeometryMap mCachedGeometries
cache of the committed geometries retrieved for the current display
qint64 QgsFeatureId
Definition: qgsfeature.h:30
Represents a vector layer which manages a vector based data sets.