QGIS API Documentation
2.8.2-Wien
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
()
6
{
7
}
8
9
QgsGeometryCache::~QgsGeometryCache
()
10
{
11
// Destroy any cached geometries and clear the references to them
12
deleteCachedGeometries
();
13
}
14
15
bool
QgsGeometryCache::geometry
(
QgsFeatureId
fid,
QgsGeometry
& geometry )
16
{
17
// no need to check changed geometries because all changed geometries are also cached
18
19
// first time this geometry has changed since last commit
20
if
( !
mCachedGeometries
.contains( fid ) )
21
return
false
;
22
23
geometry =
mCachedGeometries
[fid];
24
return
true
;
25
}
26
27
void
QgsGeometryCache::cacheGeometry
(
QgsFeatureId
fid,
const
QgsGeometry
& geom )
28
{
29
mCachedGeometries
[fid] = geom;
30
}
31
32
33
void
QgsGeometryCache::deleteCachedGeometries
()
34
{
35
// Destroy any cached geometries
36
mCachedGeometries
.clear();
37
mCachedGeometriesRect
=
QgsRectangle
();
38
}
Generated on Sun May 10 2015 16:33:24 for QGIS API Documentation by
1.8.1.2