2017-05-14 09:48:41 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsmaplayerrenderer.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-05 18:27:45 +07:00
|
|
|
|
|
|
|
class QgsMapLayerRenderer
|
|
|
|
{
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Base class for utility classes that encapsulate information necessary
|
|
|
|
for rendering of map layers. The rendering is typically done in a background
|
|
|
|
thread, so it is necessary to keep all structures required for rendering away
|
|
|
|
from the original map layer because it may change any time.
|
|
|
|
|
|
|
|
Because the data needs to be copied (to avoid the need for locking),
|
|
|
|
is is highly desirable to use copy-on-write where possible. This way,
|
|
|
|
the overhead of copying (both memory and CPU) will be kept low.
|
|
|
|
Qt containers and various Qt classes use implicit sharing.
|
|
|
|
|
|
|
|
The scenario will be:
|
|
|
|
1. renderer job (doing preparation in the GUI thread) calls
|
|
|
|
QgsMapLayer.createMapRenderer() and gets instance of this class.
|
|
|
|
The instance is initialized at that point and should not need
|
|
|
|
additional calls to QgsVectorLayer.
|
|
|
|
2. renderer job (still in GUI thread) stores the renderer for later use.
|
|
|
|
3. renderer job (in worker thread) calls QgsMapLayerRenderer.render()
|
|
|
|
4. renderer job (again in GUI thread) will check errors() and report them
|
|
|
|
|
|
|
|
.. versionadded:: 2.4
|
2013-12-05 18:27:45 +07:00
|
|
|
%End
|
|
|
|
|
2017-05-14 09:48:41 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsmaplayerrenderer.h"
|
|
|
|
%End
|
2014-05-27 23:22:50 +02:00
|
|
|
public:
|
2017-05-01 16:42:33 +02:00
|
|
|
QgsMapLayerRenderer( const QString &layerID );
|
2014-05-27 23:22:50 +02:00
|
|
|
virtual ~QgsMapLayerRenderer();
|
2013-12-05 18:27:45 +07:00
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
virtual bool render() = 0;
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Do the rendering (based on data stored in the class)
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2013-12-05 18:27:45 +07:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsFeedback *feedback() const;
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
2017-10-05 11:51:04 +10:00
|
|
|
Access to feedback object of the layer renderer (may be null)
|
2017-05-14 09:48:41 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
:rtype: QgsFeedback
|
|
|
|
%End
|
2016-07-22 23:26:47 +02:00
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
QStringList errors() const;
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Return list of errors (problems) that happened during the rendering
|
|
|
|
:rtype: list of str
|
|
|
|
%End
|
2013-12-05 18:27:45 +07:00
|
|
|
|
2016-07-19 11:45:47 +10:00
|
|
|
QString layerId() const;
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Get access to the ID of the layer rendered by this class
|
|
|
|
:rtype: str
|
|
|
|
%End
|
|
|
|
|
|
|
|
protected:
|
2013-12-05 18:27:45 +07:00
|
|
|
};
|
2017-05-14 09:48:41 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsmaplayerrenderer.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|