File: qgsrulebasedlabeling.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 (342 lines) | stat: -rw-r--r-- 9,170 bytes parent folder | download | duplicates (6)
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/labeling/qgsrulebasedlabeling.h                             *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsRuleBasedLabeling : QgsAbstractVectorLayerLabeling
{
%Docstring(signature="appended")
Rule based labeling for a vector layer.
%End

%TypeHeaderCode
#include "qgsrulebasedlabeling.h"
%End
  public:
    typedef QList<QgsRuleBasedLabeling::Rule *> RuleList;
    typedef QMap<QgsRuleBasedLabeling::Rule *, QgsVectorLayerLabelProvider *> RuleToProviderMap;

    class Rule
{
%Docstring(signature="appended")
A child rule for QgsRuleBasedLabeling.
%End

%TypeHeaderCode
#include "qgsrulebasedlabeling.h"
%End
      public:
        Rule( QgsPalLayerSettings *settings /Transfer/, double maximumScale = 0, double minimumScale = 0, const QString &filterExp = QString(), const QString &description = QString(), bool elseRule = false );
%Docstring
takes ownership of settings, settings may be ``None``
%End
        ~Rule();


        enum RegisterResult /BaseType=IntEnum/
        {
          Filtered,
          Inactive,
          Registered
        };

        QgsPalLayerSettings *settings() const;
%Docstring
Returns the labeling settings. May return ``None``.
%End

        bool dependsOnScale() const;
%Docstring
Determines if scale based labeling is active

:return: ``True`` if scale based labeling is active
%End

        double maximumScale() const;
%Docstring
Returns the maximum map scale (i.e. most "zoomed in" scale) at which the
label rule will be active. The scale value indicates the scale
denominator, e.g. 1000.0 for a 1:1000 map. A scale of 0 indicates no
maximum scale visibility.

.. seealso:: :py:func:`minimumScale`

.. seealso:: :py:func:`setMaximumScale`
%End

        double minimumScale() const;
%Docstring
Returns the minimum map scale (i.e. most "zoomed out" scale) at which
the label rule will be active. The scale value indicates the scale
denominator, e.g. 1000.0 for a 1:1000 map. A scale of 0 indicates no
minimum scale visibility.

.. seealso:: :py:func:`maximumScale`

.. seealso:: :py:func:`setMinimumScale`
%End

        QString filterExpression() const;
%Docstring
A filter that will check if this rule applies

:return: An expression
%End

        QString description() const;
%Docstring
A human readable description for this rule

:return: Description
%End

        bool active() const;
%Docstring
Returns if this rule is active

:return: ``True`` if the rule is active
%End

        bool isElse() const;
%Docstring
Check if this rule is an ELSE rule

:return: ``True`` if this rule is an else rule
%End

        QString ruleKey() const;
%Docstring
Unique rule identifier (for identification of rule within labeling, used
as provider ID)
%End

        void setSettings( QgsPalLayerSettings *settings /Transfer/ );
%Docstring
Sets new settings (or ``None``). Deletes old settings if any.
%End

        void setMinimumScale( double scale );
%Docstring
Sets the minimum map ``scale`` (i.e. most "zoomed out" scale) at which
the label rule will be active. The ``scale`` value indicates the scale
denominator, e.g. 1000.0 for a 1:1000 map. A ``scale`` of 0 indicates no
minimum scale visibility.

.. seealso:: :py:func:`minimumScale`

.. seealso:: :py:func:`setMaximumScale`
%End

        void setMaximumScale( double scale );
%Docstring
Sets the maximum map ``scale`` (i.e. most "zoomed in" scale) at which
the rule will be active. The ``scale`` value indicates the scale
denominator, e.g. 1000.0 for a 1:1000 map. A ``scale`` of 0 indicates no
maximum scale visibility.

.. seealso:: :py:func:`maximumScale`

.. seealso:: :py:func:`setMinimumScale`
%End

        void setFilterExpression( const QString &filterExp );
%Docstring
Set the expression used to check if a given feature shall be rendered
with this rule

:param filterExp: An expression
%End

        void setDescription( const QString &description );
%Docstring
Set a human readable description for this rule

:param description: Description
%End

        void setActive( bool state );
%Docstring
Sets if this rule is active

:param state: Determines if the rule should be activated or deactivated
%End

        void setIsElse( bool iselse );
%Docstring
Sets if this rule is an ELSE rule

:param iselse: If ``True``, this rule is an ELSE rule
%End

        void setRuleKey( const QString &key );
%Docstring
Override the assigned rule key (should be used just internally by
rule-based labeling)
%End


        const QgsRuleBasedLabeling::RuleList &children() const;
%Docstring
Returns all children rules of this rule

:return: A list of rules
%End


        QgsRuleBasedLabeling::RuleList descendants() const;
%Docstring
Returns all children, grand-children, grand-grand-children, grand-gra...
you get it

:return: A list of descendant rules
%End


        QgsRuleBasedLabeling::Rule *parent();
%Docstring
The parent rule

:return: Parent rule
%End

        void appendChild( QgsRuleBasedLabeling::Rule *rule /Transfer/ );
%Docstring
add child rule, take ownership, sets this as parent
%End

        void insertChild( int i, QgsRuleBasedLabeling::Rule *rule /Transfer/ );
%Docstring
add child rule, take ownership, sets this as parent
%End

        void removeChildAt( int i );
%Docstring
delete child rule
%End

        const QgsRuleBasedLabeling::Rule *findRuleByKey( const QString &key ) const;
%Docstring
Try to find a rule given its unique key
%End


        QgsRuleBasedLabeling::Rule *clone( bool resetRuleKey = true ) const /Factory/;
%Docstring
clone this rule

:param resetRuleKey: ``True`` if this rule and its children rule key
                     need to be reset to new unique ones.

:return: new instance
%End


        static QgsRuleBasedLabeling::Rule *create( const QDomElement &ruleElem, const QgsReadWriteContext &context, bool reuseId = true ) /Factory/;
%Docstring
Create a rule from an XML definition

:param ruleElem: The XML rule element
:param context: reading context
:param reuseId: set to ``True`` to create an exact copy of the original
                symbol or ``False`` to create a new rule with the same
                parameters as the original but a new unique
                :py:func:`~Rule.ruleKey`. (Since QGIS 3.30)

:return: A new rule
%End

        QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const;
%Docstring
store labeling info to XML element
%End






        bool requiresAdvancedEffects() const;
%Docstring
Returns ``True`` if this rule or any of its children requires advanced
composition effects to render.
%End

        bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
%Docstring
Accepts the specified symbology ``visitor``, causing it to visit all
child rules associated with the rule.

Returns ``True`` if the visitor should continue visiting other objects,
or ``False`` if visiting should be canceled.

.. versionadded:: 3.10
%End

      private:
        Rule( const QgsRuleBasedLabeling::Rule &rh );
    };


    explicit QgsRuleBasedLabeling( QgsRuleBasedLabeling::Rule *root /Transfer/ );
%Docstring
Constructs the labeling from given tree of rules (takes ownership)
%End
    ~QgsRuleBasedLabeling();

    QgsRuleBasedLabeling::Rule *rootRule();

    static QgsRuleBasedLabeling *create( const QDomElement &element, const QgsReadWriteContext &context ) /Factory/;
%Docstring
Create the instance from a DOM element with saved configuration
%End


    virtual QString type() const;

    virtual QgsRuleBasedLabeling *clone() const /Factory/;

    virtual QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const;

    virtual QStringList subProviders() const;

    virtual QgsPalLayerSettings settings( const QString &providerId = QString() ) const;

    virtual bool accept( QgsStyleEntityVisitorInterface *visitor ) const;


    virtual void setSettings( QgsPalLayerSettings *settings /Transfer/, const QString &providerId = QString() );

%Docstring
Set pal settings for a specific provider (takes ownership).

:param settings: Pal layer settings
:param providerId: The id of the provider
%End
    virtual bool requiresAdvancedEffects() const;

    virtual void toSld( QDomNode &parent, const QVariantMap &props ) const;

    virtual void multiplyOpacity( double opacityFactor );



  protected:


};


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