QGIS API Documentation  2.17.0-Master (0497e4a)
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 "qgsgeometry.h"
19 #include "qgsfeature.h"
20 #include "qgsrectangle.h"
21 
22 #include <QMap>
23 
27 class CORE_EXPORT QgsGeometryCache
28 {
29  public:
31 
32  inline QgsGeometryMap& cachedGeometries() { return mCachedGeometries; }
33 
35  bool geometry( QgsFeatureId fid, QgsGeometry& geometry );
36 
38  void cacheGeometry( QgsFeatureId fid, const QgsGeometry& geom );
39 
41  void removeGeometry( QgsFeatureId fid ) { mCachedGeometries.remove( fid ); }
42 
44  void deleteCachedGeometries();
45 
46  void setCachedGeometriesRect( const QgsRectangle& extent ) { mCachedGeometriesRect = extent; }
47  const QgsRectangle& cachedGeometriesRect() { return mCachedGeometriesRect; }
48 
49  protected:
50 
53 
56 
57 };
58 
59 #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