/
qgslinesymbollayer.sip.in
410 lines (239 loc) · 11.2 KB
/
qgslinesymbollayer.sip.in
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology/qgslinesymbollayer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsSimpleLineSymbolLayer : QgsLineSymbolLayer
{
%TypeHeaderCode
#include "qgslinesymbollayer.h"
%End
public:
QgsSimpleLineSymbolLayer( const QColor &color = DEFAULT_SIMPLELINE_COLOR,
double width = DEFAULT_SIMPLELINE_WIDTH,
Qt::PenStyle penStyle = DEFAULT_SIMPLELINE_PENSTYLE );
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
virtual QString layerType() const;
virtual void startRender( QgsSymbolRenderContext &context );
virtual void stopRender( QgsSymbolRenderContext &context );
virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context );
virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
virtual QgsStringMap properties() const;
virtual QgsSimpleLineSymbolLayer *clone() const /Factory/;
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
virtual QgsUnitTypes::RenderUnit outputUnit() const;
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
virtual QgsMapUnitScale mapUnitScale() const;
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
Qt::PenStyle penStyle() const;
void setPenStyle( Qt::PenStyle style );
Qt::PenJoinStyle penJoinStyle() const;
void setPenJoinStyle( Qt::PenJoinStyle style );
Qt::PenCapStyle penCapStyle() const;
void setPenCapStyle( Qt::PenCapStyle style );
bool useCustomDashPattern() const;
void setUseCustomDashPattern( bool b );
void setCustomDashPatternUnit( QgsUnitTypes::RenderUnit unit );
%Docstring
Sets the units for lengths used in the custom dash pattern.
:param unit: length units
.. seealso:: :py:func:`customDashPatternUnit`
%End
QgsUnitTypes::RenderUnit customDashPatternUnit() const;
%Docstring
Returns the units for lengths used in the custom dash pattern.
.. seealso:: :py:func:`setCustomDashPatternUnit`
%End
const QgsMapUnitScale &customDashPatternMapUnitScale() const;
void setCustomDashPatternMapUnitScale( const QgsMapUnitScale &scale );
QVector<qreal> customDashVector() const;
void setCustomDashVector( const QVector<qreal> &vector );
bool drawInsidePolygon() const;
%Docstring
Returns true if the line should only be drawn inside polygons, and any portion
of the line which falls outside the polygon should be clipped away.
This setting only has an effect when the line symbol is being
used to render polygon rings.
.. seealso:: :py:func:`setDrawInsidePolygon`
%End
void setDrawInsidePolygon( bool drawInsidePolygon );
%Docstring
Sets whether the line should only be drawn inside polygons, and any portion
of the line which falls outside the polygon should be clipped away.
This setting only has an effect when the line symbol is being
used to render polygon rings.
.. seealso:: :py:func:`drawInsidePolygon`
%End
virtual QVector<qreal> dxfCustomDashPattern( QgsUnitTypes::RenderUnit &unit ) const;
virtual Qt::PenStyle dxfPenStyle() const;
virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
virtual double dxfOffset( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
protected:
};
class QgsMarkerLineSymbolLayer : QgsLineSymbolLayer
{
%TypeHeaderCode
#include "qgslinesymbollayer.h"
%End
public:
QgsMarkerLineSymbolLayer( bool rotateMarker = DEFAULT_MARKERLINE_ROTATE,
double interval = DEFAULT_MARKERLINE_INTERVAL );
enum Placement
{
Interval,
Vertex,
LastVertex,
FirstVertex,
CentralPoint,
CurvePoint
};
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
%Docstring
Create a new MarkerLineSymbolLayerV2
:param properties: A property map to deserialize saved information from properties()
:return: A new MarkerLineSymbolLayerV2
%End
static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
%Docstring
Create a new MarkerLineSymbolLayerV2 from SLD
:param element: An SLD XML DOM element
:return: A new MarkerLineSymbolLayerV2
%End
virtual QString layerType() const;
virtual void startRender( QgsSymbolRenderContext &context );
virtual void stopRender( QgsSymbolRenderContext &context );
virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context );
virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
virtual QgsStringMap properties() const;
virtual QgsMarkerLineSymbolLayer *clone() const /Factory/;
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
virtual void setColor( const QColor &color );
virtual QColor color() const;
virtual QgsSymbol *subSymbol();
virtual bool setSubSymbol( QgsSymbol *symbol /Transfer/ );
virtual void setWidth( double width );
virtual double width() const;
virtual double width( const QgsRenderContext &context ) const;
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
bool rotateMarker() const;
%Docstring
Shall the marker be rotated.
:return: True if the marker should be rotated.
%End
void setRotateMarker( bool rotate );
%Docstring
Shall the marker be rotated.
%End
double interval() const;
%Docstring
Returns the interval between individual markers. Units are specified through intervalUnits().
.. seealso:: :py:func:`setInterval`
.. seealso:: :py:func:`intervalUnit`
%End
void setInterval( double interval );
%Docstring
Sets the interval between individual markers.
:param interval: interval size. Units are specified through setIntervalUnit()
.. seealso:: :py:func:`interval`
.. seealso:: :py:func:`setIntervalUnit`
%End
Placement placement() const;
%Docstring
The placement of the markers.
%End
void setPlacement( Placement p );
%Docstring
The placement of the markers.
%End
double offsetAlongLine() const;
%Docstring
Returns the offset along the line for the marker placement. For Interval placements, this is the distance
between the start of the line and the first marker. For FirstVertex and LastVertex placements, this is the
distance between the marker and the start of the line or the end of the line respectively.
This setting has no effect for Vertex or CentralPoint placements.
:return: The offset along the line. The unit for the offset is retrievable via offsetAlongLineUnit.
.. seealso:: :py:func:`setOffsetAlongLine`
.. seealso:: :py:func:`offsetAlongLineUnit`
.. seealso:: :py:func:`placement`
.. versionadded:: 2.3
%End
void setOffsetAlongLine( double offsetAlongLine );
%Docstring
Sets the the offset along the line for the marker placement. For Interval placements, this is the distance
between the start of the line and the first marker. For FirstVertex and LastVertex placements, this is the
distance between the marker and the start of the line or the end of the line respectively.
This setting has no effect for Vertex or CentralPoint placements.
:param offsetAlongLine: Distance to offset markers along the line. The offset
unit is set via setOffsetAlongLineUnit.
.. seealso:: :py:func:`offsetAlongLine`
.. seealso:: :py:func:`setOffsetAlongLineUnit`
.. seealso:: :py:func:`setPlacement`
.. versionadded:: 2.3
%End
QgsUnitTypes::RenderUnit offsetAlongLineUnit() const;
%Docstring
Returns the unit used for calculating the offset along line for markers.
:return: Offset along line unit type.
.. seealso:: :py:func:`setOffsetAlongLineUnit`
.. seealso:: :py:func:`offsetAlongLine`
%End
void setOffsetAlongLineUnit( QgsUnitTypes::RenderUnit unit );
%Docstring
Sets the unit used for calculating the offset along line for markers.
:param unit: Offset along line unit type.
.. seealso:: :py:func:`offsetAlongLineUnit`
.. seealso:: :py:func:`setOffsetAlongLine`
%End
const QgsMapUnitScale &offsetAlongLineMapUnitScale() const;
%Docstring
Returns the map unit scale used for calculating the offset in map units along line for markers.
:return: Offset along line map unit scale.
%End
void setOffsetAlongLineMapUnitScale( const QgsMapUnitScale &scale );
%Docstring
Sets the map unit scale used for calculating the offset in map units along line for markers.
:param scale: Offset along line map unit scale.
%End
void setIntervalUnit( QgsUnitTypes::RenderUnit unit );
%Docstring
Sets the units for the interval between markers.
:param unit: interval units
.. seealso:: :py:func:`intervalUnit`
.. seealso:: :py:func:`setInterval`
%End
QgsUnitTypes::RenderUnit intervalUnit() const;
%Docstring
Returns the units for the interval between markers.
.. seealso:: :py:func:`setIntervalUnit`
.. seealso:: :py:func:`interval`
%End
void setIntervalMapUnitScale( const QgsMapUnitScale &scale );
const QgsMapUnitScale &intervalMapUnitScale() const;
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
virtual QgsUnitTypes::RenderUnit outputUnit() const;
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
virtual QgsMapUnitScale mapUnitScale() const;
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
virtual bool hasDataDefinedProperties() const;
virtual void setDataDefinedProperty( QgsSymbolLayer::Property key, const QgsProperty &property );
protected:
void renderPolylineInterval( const QPolygonF &points, QgsSymbolRenderContext &context );
void renderPolylineVertex( const QPolygonF &points, QgsSymbolRenderContext &context, Placement placement = Vertex );
void renderPolylineCentral( const QPolygonF &points, QgsSymbolRenderContext &context );
double markerAngle( const QPolygonF &points, bool isRing, int vertex );
private:
QgsMarkerLineSymbolLayer( const QgsMarkerLineSymbolLayer &other );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology/qgslinesymbollayer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/