1/************************************************************************
2 * This file has been generated automatically from                      *
3 *                                                                      *
4 * src/3d/qgsrulebased3drenderer.h                                      *
5 *                                                                      *
6 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
7 ************************************************************************/
8
9
10
11
12
13
14
15class QgsRuleBased3DRendererMetadata : Qgs3DRendererAbstractMetadata
16{
17%Docstring
18Metadata for rule-based 3D renderer to allow creation of its instances from XML
19
20.. warning::
21
22   This is not considered stable API, and may change in future QGIS releases. It is
23   exposed to the Python bindings as a tech preview only.
24
25.. versionadded:: 3.6
26%End
27
28%TypeHeaderCode
29#include "qgsrulebased3drenderer.h"
30%End
31  public:
32    QgsRuleBased3DRendererMetadata();
33
34    virtual QgsAbstract3DRenderer *createRenderer( QDomElement &elem, const QgsReadWriteContext &context ) /Factory/;
35
36%Docstring
37Creates an instance of a 3D renderer based on a DOM element with renderer configuration
38%End
39};
40
41
42class QgsRuleBased3DRenderer : QgsAbstractVectorLayer3DRenderer
43{
44%Docstring
45Rule-based 3D renderer.
46
47Similar to rule-based 2D renderer and rule-based labeling, it allows specification of rules for 3D symbols.
48
49.. warning::
50
51   This is not considered stable API, and may change in future QGIS releases. It is
52   exposed to the Python bindings as a tech preview only.
53
54.. versionadded:: 3.6
55%End
56
57%TypeHeaderCode
58#include "qgsrulebased3drenderer.h"
59%End
60  public:
61
62    typedef QList<QgsRuleBased3DRenderer::Rule *> RuleList;
63    typedef QHash<const QgsRuleBased3DRenderer::Rule *, QgsFeature3DHandler *> RuleToHandlerMap;
64
65    class Rule
66{
67%Docstring
68A child rule for a QgsRuleBased3DRenderer
69
70.. versionadded:: 3.6
71%End
72
73%TypeHeaderCode
74#include "qgsrulebased3drenderer.h"
75%End
76      public:
77        Rule( QgsAbstract3DSymbol *symbol /Transfer/, const QString &filterExp = QString(), const QString &description = QString(), bool elseRule = false );
78%Docstring
79takes ownership of symbol, symbol may be ``None``
80%End
81        ~Rule();
82
83
84        enum RegisterResult
85        {
86          Filtered,
87          Inactive,
88          Registered
89        };
90
91        QgsAbstract3DSymbol *symbol() const;
92%Docstring
93Returns the labeling settings. May return ``None``.
94%End
95
96        QString filterExpression() const;
97%Docstring
98A filter that will check if this rule applies
99
100:return: An expression
101%End
102
103        QString description() const;
104%Docstring
105A human readable description for this rule
106
107:return: Description
108%End
109
110        bool active() const;
111%Docstring
112Returns if this rule is active
113
114:return: ``True`` if the rule is active
115%End
116
117        bool isElse() const;
118%Docstring
119Check if this rule is an ELSE rule
120
121:return: ``True`` if this rule is an else rule
122%End
123
124        QString ruleKey() const;
125%Docstring
126Unique rule identifier (for identification of rule within labeling, used as provider ID)
127%End
128
129        void setSymbol( QgsAbstract3DSymbol *symbol /Transfer/ );
130%Docstring
131Sets new symbol (or ``None``). Deletes old symbol if any.
132%End
133
134        void setFilterExpression( const QString &filterExp );
135%Docstring
136Set the expression used to check if a given feature shall be rendered with this rule
137
138:param filterExp: An expression
139%End
140
141        void setDescription( const QString &description );
142%Docstring
143Set a human readable description for this rule
144
145:param description: Description
146%End
147
148        void setActive( bool state );
149%Docstring
150Sets if this rule is active
151
152:param state: Determines if the rule should be activated or deactivated
153%End
154
155        void setIsElse( bool iselse );
156%Docstring
157Sets if this rule is an ELSE rule
158
159:param iselse: If ``True``, this rule is an ELSE rule
160%End
161
162        void setRuleKey( const QString &key );
163%Docstring
164Override the assigned rule key (should be used just internally by rule-based renderer)
165%End
166
167
168        const QgsRuleBased3DRenderer::RuleList &children() const;
169%Docstring
170Returns all children rules of this rule
171
172:return: A list of rules
173%End
174
175
176        QgsRuleBased3DRenderer::RuleList descendants() const;
177%Docstring
178Returns all children, grand-children, grand-grand-children, grand-gra... you get it
179
180:return: A list of descendant rules
181%End
182
183
184        QgsRuleBased3DRenderer::Rule *parent();
185%Docstring
186The parent rule
187
188:return: Parent rule
189%End
190
191        void appendChild( QgsRuleBased3DRenderer::Rule *rule /Transfer/ );
192%Docstring
193add child rule, take ownership, sets this as parent
194%End
195
196        void insertChild( int i, QgsRuleBased3DRenderer::Rule *rule /Transfer/ );
197%Docstring
198add child rule, take ownership, sets this as parent
199%End
200
201        void removeChildAt( int i );
202%Docstring
203delete child rule
204%End
205
206        const QgsRuleBased3DRenderer::Rule *findRuleByKey( const QString &key ) const;
207%Docstring
208Try to find a rule given its unique key
209%End
210
211
212        QgsRuleBased3DRenderer::Rule *clone() const /Factory/;
213%Docstring
214clone this rule, return new instance
215%End
216
217
218        static QgsRuleBased3DRenderer::Rule *create( const QDomElement &ruleElem, const QgsReadWriteContext &context ) /Factory/;
219%Docstring
220Create a rule from an XML definition
221
222:param ruleElem: The XML rule element
223:param context: reading context
224
225:return: A new rule
226%End
227
228        QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const;
229%Docstring
230store labeling info to XML element
231%End
232
233
234
235
236
237      private:
238        Rule( const QgsRuleBased3DRenderer::Rule &rh );
239    };
240
241
242    QgsRuleBased3DRenderer( QgsRuleBased3DRenderer::Rule *root /Transfer/ );
243%Docstring
244Construct renderer with the given root rule (takes ownership)
245%End
246    ~QgsRuleBased3DRenderer();
247
248    QgsRuleBased3DRenderer::Rule *rootRule();
249%Docstring
250Returns pointer to the root rule
251%End
252
253    virtual QString type() const;
254    virtual QgsRuleBased3DRenderer *clone() const /Factory/;
255
256
257    virtual void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const;
258
259    virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
260
261
262};
263
264/************************************************************************
265 * This file has been generated automatically from                      *
266 *                                                                      *
267 * src/3d/qgsrulebased3drenderer.h                                      *
268 *                                                                      *
269 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
270 ************************************************************************/
271