QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsgeometrycache.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsgeometrycache.cpp
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 #include "qgsgeometrycache.h"
16 
18 
20 {
21 }
22 
24 {
25  // no need to check changed geometries because all changed geometries are also cached
26 
27  // first time this geometry has changed since last commit
28  if ( !mCachedGeometries.contains( fid ) )
29  return false;
30 
31  geometry = mCachedGeometries[fid];
32  return true;
33 }
34 
36 {
37  mCachedGeometries[fid] = geom;
38 }
39 
40 
42 {
43  // Destroy any cached geometries
46 }
A rectangle specified with double values.
Definition: qgsrectangle.h:35
bool contains(const Key &key) const
void deleteCachedGeometries()
Deletes the geometries in mCachedGeometries.
QgsRectangle mCachedGeometriesRect
Extent for which there are cached geometries.
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:76
void clear()
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:31