File: qgsmaplayerrenderer.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (156 lines) | stat: -rw-r--r-- 4,987 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsmaplayerrenderer.h                                       *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsMapLayerRenderer
{
%Docstring(signature="appended")
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), it
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 :py:func:`QgsMapLayer.createMapRenderer()` and gets instance of this class. The instance is initialized at that point and should not need additional calls to :py:class:`QgsVectorLayer`.
2. renderer job (still in GUI thread) stores the renderer for later use.
3. renderer job (in worker thread) calls :py:func:`QgsMapLayerRenderer.render()`
4. renderer job (again in GUI thread) will check :py:func:`~errors` and report them
%End

%TypeHeaderCode
#include "qgsmaplayerrenderer.h"
%End
  public:

    QgsMapLayerRenderer( const QString &layerID, QgsRenderContext *context = 0 );
%Docstring
Constructor for QgsMapLayerRenderer, with the associated ``layerID`` and
render ``context``.
%End

    virtual ~QgsMapLayerRenderer();

    virtual bool render() = 0;
%Docstring
Do the rendering (based on data stored in the class).

Returns ``True`` if the layer was completely rendered successfully (i.e.
the render was not canceled early).
%End

    virtual bool forceRasterRender() const;
%Docstring
Returns ``True`` if the renderer must be rendered to a raster paint
device (e.g. QImage).

Some layer settings require layers to be effectively "flattened" while
rendering maps, which is achieved by first rendering the layer onto a
raster paint device and then compositing the resultant image onto the
final map render.

E.g. if a layer contains features with transparency or alternative
blending modes, and the effects of these opacity or blending modes
should be restricted to only affect other features within the SAME
layer, then a flattened raster based render is required.

Subclasses should return ``True`` whenever their corresponding layer
settings require the layer to always be rendered using a raster paint
device.

.. versionadded:: 3.18
%End

    virtual Qgis::MapLayerRendererFlags flags() const;
%Docstring
Returns flags which control how the map layer rendering behaves.

.. versionadded:: 3.34
%End

    virtual QgsFeedback *feedback() const;
%Docstring
Access to feedback object of the layer renderer (may be ``None``)
%End

    QStringList errors() const;
%Docstring
Returns list of errors (problems) that happened during the rendering
%End

    QString layerId() const;
%Docstring
Gets access to the ID of the layer rendered by this class
%End

    QgsRenderContext *renderContext();
%Docstring
Returns the render context associated with the renderer.

.. versionadded:: 3.10
%End


    bool isReadyToCompose() const;
%Docstring
Returns whether the renderer has already drawn (at least partially) some
data

.. versionadded:: 3.18
%End


    QList< QgsRenderedItemDetails * > takeRenderedItemDetails() /TransferBack/;
%Docstring
Takes the list of rendered item details from the renderer.

Ownership of items is transferred to the caller.

.. seealso:: :py:func:`appendRenderedItemDetails`

.. versionadded:: 3.22
%End

  protected:




    void appendRenderedItemDetails( QgsRenderedItemDetails *details /Transfer/ );
%Docstring
Appends the ``details`` of a rendered item to the renderer.

Rendered item details can be retrieved by calling
:py:func:`~QgsMapLayerRenderer.takeRenderedItemDetails`.

Ownership of ``details`` is transferred to the renderer.

.. seealso:: :py:func:`takeRenderedItemDetails`

.. versionadded:: 3.22
%End

};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsmaplayerrenderer.h                                       *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/