QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsgeometrycache.cpp
Go to the documentation of this file.
1 #include "qgsgeometrycache.h"
2 
4 
6  : L( layer )
7 {
8 }
9 
11 {
12  // Destroy any cached geometries and clear the references to them
14 }
15 
17 {
18  // no need to check changed geometries because all changed geometries are also cached
19 
20  // first time this geometry has changed since last commit
21  if ( !mCachedGeometries.contains( fid ) )
22  return false;
23 
24  geometry = mCachedGeometries[fid];
25  return true;
26 }
27 
29 {
30  mCachedGeometries[fid] = geom;
31 }
32 
33 
35 {
36  // Destroy any cached geometries
37  mCachedGeometries.clear();
39 }
A rectangle specified with double values.
Definition: qgsrectangle.h:35
QgsGeometryCache(QgsVectorLayer *layer)
void deleteCachedGeometries()
Deletes the geometries in mCachedGeometries.
QgsRectangle mCachedGeometriesRect
extent for which there are cached geometries
bool geometry(QgsFeatureId fid, QgsGeometry &geometry)
fetch geometry from cache, return true if successful
QgsGeometryMap mCachedGeometries
cache of the committed geometries retrieved for the current display
void cacheGeometry(QgsFeatureId fid, const QgsGeometry &geom)
store a geometry in the cache
qint64 QgsFeatureId
Definition: qgsfeature.h:30
Represents a vector layer which manages a vector based data sets.