QGIS/python/core/auto_generated/qgsmaprenderercache.sip.in

106 lines
3.4 KiB
Plaintext
Raw Normal View History

2017-05-14 09:48:41 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaprenderercache.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapRendererCache : QObject
{
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
This class is responsible for keeping cache of rendered images resulting from
a map rendering job.
2017-05-14 09:48:41 +02:00
2017-12-15 10:36:55 -04:00
Once a job has a rendered image stored in the cache (using setCacheImage(...)),
the cache listens to repaintRequested() signals from dependent layers.
If triggered, the cache removes the rendered image (and disconnects from the
layers).
2017-05-14 09:48:41 +02:00
2017-12-15 10:36:55 -04:00
The class is thread-safe (multiple classes can access the same instance safely).
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.4
%End
2017-05-14 09:48:41 +02:00
%TypeHeaderCode
#include "qgsmaprenderercache.h"
%End
public:
QgsMapRendererCache();
void clear();
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Invalidates the cache contents, clearing all cached images.
.. seealso:: :py:func:`clearCacheImage`
2017-05-14 09:48:41 +02:00
%End
bool init( const QgsRectangle &extent, double scale );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Initialize cache: set new parameters and clears the cache if any
parameters have changed since last initialization.
:return: flag whether the parameters are the same as last time
2017-05-14 09:48:41 +02:00
%End
2017-05-14 09:48:41 +02:00
void setCacheImage( const QString &cacheKey, const QImage &image, const QList< QgsMapLayer * > &dependentLayers = QList< QgsMapLayer * >() );
%Docstring
2017-12-15 10:36:55 -04:00
Set the cached ``image`` for a particular ``cacheKey``. The ``cacheKey`` usually
matches the QgsMapLayer.id() which the image is a render of.
A list of ``dependentLayers`` should be passed containing all layer
on which this cache image is dependent. If any of these layers triggers a
repaint then the cache image will be cleared.
.. seealso:: :py:func:`cacheImage`
2017-05-14 09:48:41 +02:00
%End
bool hasCacheImage( const QString &cacheKey ) const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if the cache contains an image with the specified ``cacheKey``.
.. seealso:: :py:func:`cacheImage`
2018-05-28 11:31:08 -04:00
.. versionadded:: 3.0
2017-05-14 09:48:41 +02:00
%End
QImage cacheImage( const QString &cacheKey ) const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the cached image for the specified ``cacheKey``. The ``cacheKey`` usually
matches the QgsMapLayer.id() which the image is a render of.
Returns a null image if it is not cached.
.. seealso:: :py:func:`setCacheImage`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`hasCacheImage`
2017-05-14 09:48:41 +02:00
%End
2017-05-14 09:48:41 +02:00
QList< QgsMapLayer * > dependentLayers( const QString &cacheKey ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of map layers on which an image in the cache depends.
2017-05-14 09:48:41 +02:00
.. versionadded:: 3.0
%End
void clearCacheImage( const QString &cacheKey );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Removes an image from the cache with matching ``cacheKey``.
.. seealso:: :py:func:`clear`
2017-05-14 09:48:41 +02:00
%End
};
2017-05-14 09:48:41 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaprenderercache.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/