QGIS API Documentation
2.2.0-Valmiera
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
src
core
qgsgeometrycache.cpp
Go to the documentation of this file.
1
#include "
qgsgeometrycache.h
"
2
3
#include "
qgsvectorlayereditbuffer.h
"
4
5
QgsGeometryCache::QgsGeometryCache
(
QgsVectorLayer
* layer )
6
: L( layer )
7
{
8
}
9
10
QgsGeometryCache::~QgsGeometryCache
()
11
{
12
// Destroy any cached geometries and clear the references to them
13
deleteCachedGeometries
();
14
}
15
16
bool
QgsGeometryCache::geometry
(
QgsFeatureId
fid,
QgsGeometry
& geometry )
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
28
void
QgsGeometryCache::cacheGeometry
(
QgsFeatureId
fid,
const
QgsGeometry
& geom )
29
{
30
mCachedGeometries
[fid] = geom;
31
}
32
33
34
void
QgsGeometryCache::deleteCachedGeometries
()
35
{
36
// Destroy any cached geometries
37
mCachedGeometries
.clear();
38
mCachedGeometriesRect
=
QgsRectangle
();
39
}
Generated on Sun Feb 23 2014 14:27:19 for QGIS API Documentation by
1.8.1.2