File: qgsdxfexport.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 (531 lines) | stat: -rw-r--r-- 12,269 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
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
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/dxf/qgsdxfexport.h                                          *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/









class QgsDxfExport
{
%Docstring(signature="appended")
Exports QGIS layers to the DXF format.
%End

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

    struct DxfLayer
    {
        DxfLayer( QgsVectorLayer *vl, int layerOutputAttributeIndex = -1, bool buildDDBlocks = DEFAULT_DXF_DATA_DEFINED_BLOCKS, int ddBlocksMaxNumberOfClasses = -1, QString overriddenName = QString() );

        QgsVectorLayer *layer() const;
%Docstring
Returns the layer
%End

        int layerOutputAttributeIndex() const;
%Docstring
Returns the attribute index used to split into multiple layers. The
attribute value is used for layer names.

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

        QString splitLayerAttribute() const;
%Docstring
If the split layer attribute is set, the vector layer will be split into
several dxf layers, one per each unique value.

.. versionadded:: 3.12
%End

        bool buildDataDefinedBlocks() const;
%Docstring
Flag if data defined point block symbols should be created. Default is
false

:return: True if data defined point block symbols should be created

.. versionadded:: 3.38
%End

        int dataDefinedBlocksMaximumNumberOfClasses() const;
%Docstring
Returns the maximum number of data defined symbol classes for which
blocks are created. Returns -1 if there is no such limitation

:return: 

.. versionadded:: 3.38
%End

        QString overriddenName() const;
%Docstring
Returns the overridden layer name to be used in the exported DXF.

.. versionadded:: 3.38
%End

    };

    enum Flag /BaseType=IntEnum/
    {
      FlagNoMText,
      FlagOnlySelectedFeatures,
      FlagHairlineWidthExport
    };
    typedef QFlags<QgsDxfExport::Flag> Flags;


    enum class ExportResult
    {
      Success,
      InvalidDeviceError,
      DeviceNotWritableError,
      EmptyExtentError
    };

    enum class VAlign /BaseType=IntEnum/
    {
      VBaseLine,
      VBottom,
      VMiddle,
      VTop,
      Undefined
    };

    enum class HAlign /BaseType=IntEnum/
    {
      HLeft,
      HCenter,
      HRight,
      HAligned,
      HMiddle,
      HFit,
      Undefined
    };

    enum DxfPolylineFlag /BaseType=IntEnum/
    {
      Closed,
      Curve,
      Spline,
      Is3DPolyline,
      Is3DPolygonMesh,
      PolygonMesh,
      PolyfaceMesh,
      ContinuousPattern,
    };

    typedef QFlags<QgsDxfExport::DxfPolylineFlag> DxfPolylineFlags;


    QgsDxfExport();
%Docstring
Constructor for QgsDxfExport.
%End

    ~QgsDxfExport();

    void setMapSettings( const QgsMapSettings &settings );
%Docstring
Set map settings and assign layer name attributes

:param settings: map settings to apply
%End

    void setFlags( QgsDxfExport::Flags flags );
%Docstring
Sets the export flags.

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

    QgsDxfExport::Flags flags() const;
%Docstring
Returns the export flags.

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

    void addLayers( const QList< QgsDxfExport::DxfLayer > &layers );
%Docstring
Add layers to export

:param layers: list of layers and corresponding attribute indexes that
               determine the layer name (-1 for original layer name or
               title)

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

    ExportResult writeToFile( QIODevice *d, const QString &codec );  //maybe add progress dialog? other parameters (e.g. scale, dpi)?

    const QString feedbackMessage() const;
%Docstring
Returns any feedback message produced while export to dxf file.

.. versionadded:: 3.36
%End

    void setSymbologyScale( double scale );
%Docstring
Set reference ``scale`` for output. The ``scale`` value indicates the
scale denominator, e.g. 1000.0 for a 1:1000 map.

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

    double symbologyScale() const;
%Docstring
Returns the reference scale for output. The scale value indicates the
scale denominator, e.g. 1000.0 for a 1:1000 map.

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

    Qgis::DistanceUnit mapUnits() const;
%Docstring
Retrieve map units

:return: unit
%End

    void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
%Docstring
Set destination CRS

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

    QgsCoordinateReferenceSystem destinationCrs() const;
%Docstring
Returns the destination CRS, or an invalid CRS if no reprojection will
be done.

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

    void setSymbologyExport( Qgis::FeatureSymbologyExport e );
%Docstring
Set symbology export mode

:param e: the mode
%End

    Qgis::FeatureSymbologyExport symbologyExport() const;
%Docstring
Gets symbology export mode

:return: mode

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

    void setExtent( const QgsRectangle &r );
%Docstring
Set extent of area to export

:param r: area to export
%End

    QgsRectangle extent() const;
%Docstring
Gets extent of area to export

:return: area to export

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

    void setLayerTitleAsName( bool layerTitleAsName );
%Docstring
Enable use of title (where set) instead of layer name, when attribute
index of corresponding layer index is -1

:param layerTitleAsName: flag

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

    bool layerTitleAsName();
%Docstring
Retrieve whether layer title (where set) instead of name shall be use

:return: flag

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

    void setForce2d( bool force2d );
%Docstring
Force 2d output (eg. to support linewidth in polylines)

:param force2d: flag

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

    bool force2d();
%Docstring
Retrieve whether the output should be forced to 2d

:return: flag

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

    static int closestColorMatch( QRgb color );
%Docstring
Gets DXF palette index of nearest entry for given color

:param color: 
%End

    QString layerName( const QString &id, const QgsFeature &f ) const;
%Docstring
Gets layer name for feature

:param id: layer id of layer
:param f: feature of layer

:return: layer name for feature
%End

    QString layerName( QgsVectorLayer *vl ) const;
%Docstring
Gets name for layer respecting the use layer title as layer name mode

:param vl: the vector layer

:return: name of layer

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

    void writeGroup( int code, int i ) /PyName=writeGroupInt/;
%Docstring
Write a tuple of group code and integer value

:param code: group code
:param i: integer value


%End

    void writeGroup( int code, long long i ) /PyName=writeGroupLong/;
%Docstring
Write a tuple of group code and long value

:param code: group code
:param i: integer value


%End

    void writeGroup( int code, double d ) /PyName=writeGroupDouble/;
%Docstring
Write a group code with a floating point value

:param code: group code
:param d: floating point value


%End

    void writeGroup( int code, const QString &s );
%Docstring
Write a group code with a string value

:param code: group code
:param s: string value
%End

    void writeGroup( int code, const QgsPoint &p ) /PyName=writeGroupPointV2/;
%Docstring
Write a group code with a point

:param code: group code
:param p: point value


%End

    void writeGroup( const QColor &color, int exactMatch = 62, int rgbCode = 420, int transparencyCode = 440 );
%Docstring
Write a group code with color value

:param color: color
:param exactMatch: group code to use if the color has an exact match in
                   the dxf palette
:param rgbCode: group code to use if the color doesn't have an exact
                match or has a transparency component
:param transparencyCode: group code to use for transparency component

.. note::

   available in Python bindings as writeGroupPoint
%End

    void writeGroupCode( int code );
%Docstring
Write a group code

:param code: group code value
%End

    void writeInt( int i );
%Docstring
Write an integer value

:param i: integer value
%End

    void writeDouble( double d );
%Docstring
Write a floating point value

:param d: floating point value
%End

    void writeString( const QString &s );
%Docstring
Write a string value

:param s: string value
%End

    int writeHandle( int code = 5, int handle = 0 );
%Docstring
Write a tuple of group code and a handle

:param code: group code to use
:param handle: handle to use (0 generates a new handle)

:return: the used handle
%End





    void writeLine( const QgsPoint &pt1, const QgsPoint &pt2, const QString &layer, const QString &lineStyleName, const QColor &color, double width = -1 );
%Docstring
Write line (as a polyline)
%End

    void writePoint( const QString &layer, const QColor &color, const QgsPoint &pt ) /PyName=writePointV2/;
%Docstring
Write point


%End

    void writeFilledCircle( const QString &layer, const QColor &color, const QgsPoint &pt, double radius ) /PyName=writeFillCircleV2/;
%Docstring
Write filled circle (as hatch)

.. note::

   available in Python bindings as writePointV2
%End

    void writeCircle( const QString &layer, const QColor &color, const QgsPoint &pt, double radius, const QString &lineStyleName, double width ) /PyName=writeCircleV2/;
%Docstring
Write circle (as polyline)


%End

    void writeText( const QString &layer, const QString &text, const QgsPoint &pt, double size, double angle, const QColor &color, QgsDxfExport::HAlign hali = QgsDxfExport::HAlign::Undefined, QgsDxfExport::VAlign vali = QgsDxfExport::VAlign::Undefined ) /PyName=writeTextV2/;
%Docstring
Write text (TEXT)


%End

    void writeMText( const QString &layer, const QString &text, const QgsPoint &pt, double width, double angle, const QColor &color );
%Docstring
Write mtext (MTEXT)

.. note::

   available in Python bindings as writeMTextV2
%End

    static double mapUnitScaleFactor( double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits, double mapUnitsPerPixel = 1.0 );
%Docstring
Returns scale factor for conversion to map units

:param scale: the map scale denominator
:param symbolUnits: the symbol output units
:param mapUnits: the map units
:param mapUnitsPerPixel: Map units per pixel
%End

    void clipValueToMapUnitScale( double &value, const QgsMapUnitScale &scale, double pixelToMMFactor ) const;
%Docstring
Clips value to scale minimum/maximum

:param value: the value to clip
:param scale: the scale dependent minimum/maximum values
:param pixelToMMFactor: pixels per mm
%End

    static QString dxfLayerName( const QString &name );
%Docstring
Returns cleaned layer name for use in DXF
%End

    static QString dxfEncoding( const QString &name );
%Docstring
Returns DXF encoding for Qt encoding
%End

    static QStringList encodings();
%Docstring
Returns list of available DXF encodings
%End


 void registerDxfLayer( const QString &layerId, QgsFeatureId fid, const QString &layer );
%Docstring
Register name of layer for feature

:param layerId: id of layer
:param fid: id of feature
:param layer: dxf layer of feature

.. deprecated:: 3.40

   Will be made private in QGIS 4.
%End

  private:
    QgsDxfExport( const QgsDxfExport &other );
    QgsDxfExport &operator=( const QgsDxfExport & );
};

QFlags<QgsDxfExport::Flag> operator|(QgsDxfExport::Flag f1, QFlags<QgsDxfExport::Flag> f2);

QFlags<QgsDxfExport::DxfPolylineFlag> operator|(QgsDxfExport::DxfPolylineFlag f1, QFlags<QgsDxfExport::DxfPolylineFlag> f2);


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