QGIS/python/core/auto_generated/qgsmaprenderercache.sip.in
2021-03-28 06:29:24 +10:00

183 lines
6.4 KiB
Plaintext

/************************************************************************
* 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
{
%Docstring(signature="appended")
This class is responsible for keeping cache of rendered images resulting from
a map rendering job.
Once a job has a rendered image stored in the cache (using setCacheImage(...)),
the cache listens to :py:func:`~repaintRequested` signals from dependent layers.
If triggered, the cache removes the rendered image (and disconnects from the
layers).
When user pans/zooms the canvas, the cache is also used in rendering period
for particular layers between the first render update and the moment the layer
actually has partially rendered something in the resulting image.
The class is thread-safe (multiple classes can access the same instance safely).
.. versionadded:: 2.4
%End
%TypeHeaderCode
#include "qgsmaprenderercache.h"
%End
public:
QgsMapRendererCache();
void clear();
%Docstring
Invalidates the cache contents, clearing all cached images.
.. seealso:: :py:func:`clearCacheImage`
%End
bool init( const QgsRectangle &extent, double scale ) /Deprecated/;
%Docstring
Initialize cache: sets extent and scale parameters and clears the cache if any
parameters have changed since last initialization.
:return: flag whether the parameters are the same as last time
.. deprecated:: QGIS 3.18
- will be removed in QGIS 4.0. Use the :py:func:`~QgsMapRendererCache.updateParameters` and :py:func:`~QgsMapRendererCache.clear`
%End
bool updateParameters( const QgsRectangle &extent, const QgsMapToPixel &mtp );
%Docstring
Sets extent and scale parameters
:return: flag whether the parameters are the same as last time
.. versionadded:: 3.18
%End
void setCacheImage( const QString &cacheKey, const QImage &image, const QList< QgsMapLayer * > &dependentLayers = QList< QgsMapLayer * >() );
%Docstring
Set the cached ``image`` for a particular ``cacheKey``, using the current cache parameters.
The ``cacheKey`` usually matches the :py:func:`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:`setCacheImageWithParameters`
.. seealso:: :py:func:`cacheImage`
%End
void setCacheImageWithParameters( const QString &cacheKey,
const QImage &image,
const QgsRectangle &extent,
const QgsMapToPixel &mapToPixel,
const QList< QgsMapLayer * > &dependentLayers = QList< QgsMapLayer * >() );
%Docstring
Set the cached ``image`` for a particular ``cacheKey``, using a specific ``extent`` and ``mapToPixel``
(which may differ from the current cache parameters).
The ``cacheKey`` usually matches the :py:func:`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`
.. versionadded:: 3.18
%End
bool hasCacheImage( const QString &cacheKey ) const;
%Docstring
Returns ``True`` if the cache contains an image with the specified ``cacheKey``
that has the same extent and scale as the cache's global extent and scale
.. seealso:: :py:func:`cacheImage`
.. versionadded:: 3.0
%End
bool hasAnyCacheImage( const QString &cacheKey, double minimumScaleThreshold = 0, double maximumScaleThreshold = 0 ) const;
%Docstring
Returns ``True`` if the cache contains an image with the specified ``cacheKey``
with any cache's parameters (extent and scale)
The optional ``minimumScaleThreshold`` and ``maximumScaleThreshold`` arguments can be used to
specify a range of acceptable cached scales vs current cache scale parameter. E.g. if the
``minimumScaleThreshold`` is 0.5 and ``maximumScaleThreshold`` is 2.0, then only cached images
with a scale between 0.5 * current cache scale and 2.0 * current cache scale will be considered.
.. seealso:: :py:func:`transformedCacheImage`
.. versionadded:: 3.18
%End
QImage cacheImage( const QString &cacheKey ) const;
%Docstring
Returns the cached image for the specified ``cacheKey``. The ``cacheKey`` usually
matches the :py:func:`QgsMapLayer.id()` which the image is a render of.
Returns a null image if it is not cached.
.. seealso:: :py:func:`setCacheImage`
.. seealso:: :py:func:`hasCacheImage`
%End
QImage transformedCacheImage( const QString &cacheKey, const QgsMapToPixel &mtp ) const;
%Docstring
Returns the cached image for the specified ``cacheKey`` transformed
to the particular extent and scale.
The ``cacheKey`` usually matches the :py:func:`QgsMapLayer.id()` which
the image is a render of.
Returns a null image if it is not cached.
.. seealso:: :py:func:`hasAnyCacheImage`
.. versionadded:: 3.18
%End
QList< QgsMapLayer * > dependentLayers( const QString &cacheKey ) const;
%Docstring
Returns a list of map layers on which an image in the cache depends.
.. versionadded:: 3.0
%End
void clearCacheImage( const QString &cacheKey );
%Docstring
Removes an image from the cache with matching ``cacheKey``.
.. seealso:: :py:func:`clear`
%End
void invalidateCacheForLayer( QgsMapLayer *layer );
%Docstring
Invalidates cached images which relate to the specified map ``layer``.
.. versionadded:: 3.14
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaprenderercache.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/