File: qgsdxfexport.py

package info (click to toggle)
qgis 3.40.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,183,672 kB
  • sloc: cpp: 1,595,771; python: 372,544; 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: 161
file content (95 lines) | stat: -rw-r--r-- 4,494 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
# The following has been generated automatically from src/core/dxf/qgsdxfexport.h
QgsDxfExport.FlagNoMText = QgsDxfExport.Flag.FlagNoMText
QgsDxfExport.FlagOnlySelectedFeatures = QgsDxfExport.Flag.FlagOnlySelectedFeatures
QgsDxfExport.FlagHairlineWidthExport = QgsDxfExport.Flag.FlagHairlineWidthExport
QgsDxfExport.Flags = lambda flags=0: QgsDxfExport.Flag(flags)
# monkey patching scoped based enum
QgsDxfExport.ExportResult.Success.__doc__ = "Successful export"
QgsDxfExport.ExportResult.InvalidDeviceError.__doc__ = "Invalid device error"
QgsDxfExport.ExportResult.DeviceNotWritableError.__doc__ = "Device not writable error"
QgsDxfExport.ExportResult.EmptyExtentError.__doc__ = "Empty extent, no extent given and no extent could be derived from layers"
QgsDxfExport.ExportResult.__doc__ = """The result of an export as dxf operation

.. versionadded:: 3.10.1

* ``Success``: Successful export
* ``InvalidDeviceError``: Invalid device error
* ``DeviceNotWritableError``: Device not writable error
* ``EmptyExtentError``: Empty extent, no extent given and no extent could be derived from layers

"""
# --
# monkey patching scoped based enum
QgsDxfExport.VAlign.VBaseLine.__doc__ = "Top (0)"
QgsDxfExport.VAlign.VBottom.__doc__ = "Bottom (1)"
QgsDxfExport.VAlign.VMiddle.__doc__ = "Middle (2)"
QgsDxfExport.VAlign.VTop.__doc__ = "Top (3)"
QgsDxfExport.VAlign.Undefined.__doc__ = "Undefined"
QgsDxfExport.VAlign.__doc__ = """Vertical alignments.

* ``VBaseLine``: Top (0)
* ``VBottom``: Bottom (1)
* ``VMiddle``: Middle (2)
* ``VTop``: Top (3)
* ``Undefined``: Undefined

"""
# --
# monkey patching scoped based enum
QgsDxfExport.HAlign.HLeft.__doc__ = "Left (0)"
QgsDxfExport.HAlign.HCenter.__doc__ = "Centered (1)"
QgsDxfExport.HAlign.HRight.__doc__ = "Right (2)"
QgsDxfExport.HAlign.HAligned.__doc__ = "Aligned = (3) (if VAlign==0)"
QgsDxfExport.HAlign.HMiddle.__doc__ = "Middle = (4) (if VAlign==0)"
QgsDxfExport.HAlign.HFit.__doc__ = "Fit into point = (5) (if VAlign==0)"
QgsDxfExport.HAlign.Undefined.__doc__ = "Undefined"
QgsDxfExport.HAlign.__doc__ = """Horizontal alignments.

* ``HLeft``: Left (0)
* ``HCenter``: Centered (1)
* ``HRight``: Right (2)
* ``HAligned``: Aligned = (3) (if VAlign==0)
* ``HMiddle``: Middle = (4) (if VAlign==0)
* ``HFit``: Fit into point = (5) (if VAlign==0)
* ``Undefined``: Undefined

"""
# --
QgsDxfExport.Closed = QgsDxfExport.DxfPolylineFlag.Closed
QgsDxfExport.Curve = QgsDxfExport.DxfPolylineFlag.Curve
QgsDxfExport.Spline = QgsDxfExport.DxfPolylineFlag.Spline
QgsDxfExport.Is3DPolyline = QgsDxfExport.DxfPolylineFlag.Is3DPolyline
QgsDxfExport.Is3DPolygonMesh = QgsDxfExport.DxfPolylineFlag.Is3DPolygonMesh
QgsDxfExport.PolygonMesh = QgsDxfExport.DxfPolylineFlag.PolygonMesh
QgsDxfExport.PolyfaceMesh = QgsDxfExport.DxfPolylineFlag.PolyfaceMesh
QgsDxfExport.ContinuousPattern = QgsDxfExport.DxfPolylineFlag.ContinuousPattern
QgsDxfExport.DxfPolylineFlags = lambda flags=0: QgsDxfExport.DxfPolylineFlag(flags)
from enum import Enum


def _force_int(v): return int(v.value) if isinstance(v, Enum) else v


QgsDxfExport.Flag.__bool__ = lambda flag: bool(_force_int(flag))
QgsDxfExport.Flag.__eq__ = lambda flag1, flag2: _force_int(flag1) == _force_int(flag2)
QgsDxfExport.Flag.__and__ = lambda flag1, flag2: _force_int(flag1) & _force_int(flag2)
QgsDxfExport.Flag.__or__ = lambda flag1, flag2: QgsDxfExport.Flag(_force_int(flag1) | _force_int(flag2))
QgsDxfExport.DxfPolylineFlag.__bool__ = lambda flag: bool(_force_int(flag))
QgsDxfExport.DxfPolylineFlag.__eq__ = lambda flag1, flag2: _force_int(flag1) == _force_int(flag2)
QgsDxfExport.DxfPolylineFlag.__and__ = lambda flag1, flag2: _force_int(flag1) & _force_int(flag2)
QgsDxfExport.DxfPolylineFlag.__or__ = lambda flag1, flag2: QgsDxfExport.DxfPolylineFlag(_force_int(flag1) | _force_int(flag2))
try:
    QgsDxfExport.closestColorMatch = staticmethod(QgsDxfExport.closestColorMatch)
    QgsDxfExport.mapUnitScaleFactor = staticmethod(QgsDxfExport.mapUnitScaleFactor)
    QgsDxfExport.dxfLayerName = staticmethod(QgsDxfExport.dxfLayerName)
    QgsDxfExport.dxfEncoding = staticmethod(QgsDxfExport.dxfEncoding)
    QgsDxfExport.encodings = staticmethod(QgsDxfExport.encodings)
    QgsDxfExport.__group__ = ['dxf']
except (NameError, AttributeError):
    pass
try:
    QgsDxfExport.DxfLayer.__doc__ = """Layers and optional attribute index to split
into multiple layers using attribute value as layer name."""
    QgsDxfExport.DxfLayer.__group__ = ['dxf']
except (NameError, AttributeError):
    pass