File: qgscallout.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 (154 lines) | stat: -rw-r--r-- 7,604 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
# The following has been generated automatically from src/core/callouts/qgscallout.h
# monkey patching scoped based enum
QgsCallout.MinimumCalloutLength = QgsCallout.Property.MinimumCalloutLength
QgsCallout.MinimumCalloutLength.is_monkey_patched = True
QgsCallout.MinimumCalloutLength.__doc__ = "Minimum length of callouts"
QgsCallout.OffsetFromAnchor = QgsCallout.Property.OffsetFromAnchor
QgsCallout.OffsetFromAnchor.is_monkey_patched = True
QgsCallout.OffsetFromAnchor.__doc__ = "Distance to offset lines from anchor points"
QgsCallout.OffsetFromLabel = QgsCallout.Property.OffsetFromLabel
QgsCallout.OffsetFromLabel.is_monkey_patched = True
QgsCallout.OffsetFromLabel.__doc__ = "Distance to offset lines from label area"
QgsCallout.DrawCalloutToAllParts = QgsCallout.Property.DrawCalloutToAllParts
QgsCallout.DrawCalloutToAllParts.is_monkey_patched = True
QgsCallout.DrawCalloutToAllParts.__doc__ = "Whether callout lines should be drawn to all feature parts"
QgsCallout.AnchorPointPosition = QgsCallout.Property.AnchorPointPosition
QgsCallout.AnchorPointPosition.is_monkey_patched = True
QgsCallout.AnchorPointPosition.__doc__ = "Feature's anchor point position"
QgsCallout.LabelAnchorPointPosition = QgsCallout.Property.LabelAnchorPointPosition
QgsCallout.LabelAnchorPointPosition.is_monkey_patched = True
QgsCallout.LabelAnchorPointPosition.__doc__ = "Label's anchor point position"
QgsCallout.OriginX = QgsCallout.Property.OriginX
QgsCallout.OriginX.is_monkey_patched = True
QgsCallout.OriginX.__doc__ = "X-coordinate of callout origin (label anchor) \n.. versionadded:: 3.20"
QgsCallout.OriginY = QgsCallout.Property.OriginY
QgsCallout.OriginY.is_monkey_patched = True
QgsCallout.OriginY.__doc__ = "Y-coordinate of callout origin (label anchor) \n.. versionadded:: 3.20"
QgsCallout.DestinationX = QgsCallout.Property.DestinationX
QgsCallout.DestinationX.is_monkey_patched = True
QgsCallout.DestinationX.__doc__ = "X-coordinate of callout destination (feature anchor) \n.. versionadded:: 3.20"
QgsCallout.DestinationY = QgsCallout.Property.DestinationY
QgsCallout.DestinationY.is_monkey_patched = True
QgsCallout.DestinationY.__doc__ = "Y-coordinate of callout destination (feature anchor) \n.. versionadded:: 3.20"
QgsCallout.Curvature = QgsCallout.Property.Curvature
QgsCallout.Curvature.is_monkey_patched = True
QgsCallout.Curvature.__doc__ = "Curvature of curved line callouts \n.. versionadded:: 3.20"
QgsCallout.Orientation = QgsCallout.Property.Orientation
QgsCallout.Orientation.is_monkey_patched = True
QgsCallout.Orientation.__doc__ = "Orientation of curved line callouts \n.. versionadded:: 3.20"
QgsCallout.Margins = QgsCallout.Property.Margins
QgsCallout.Margins.is_monkey_patched = True
QgsCallout.Margins.__doc__ = "Margin from text \n.. versionadded:: 3.20"
QgsCallout.WedgeWidth = QgsCallout.Property.WedgeWidth
QgsCallout.WedgeWidth.is_monkey_patched = True
QgsCallout.WedgeWidth.__doc__ = "Balloon callout wedge width \n.. versionadded:: 3.20"
QgsCallout.CornerRadius = QgsCallout.Property.CornerRadius
QgsCallout.CornerRadius.is_monkey_patched = True
QgsCallout.CornerRadius.__doc__ = "Balloon callout corner radius \n.. versionadded:: 3.20"
QgsCallout.BlendMode = QgsCallout.Property.BlendMode
QgsCallout.BlendMode.is_monkey_patched = True
QgsCallout.BlendMode.__doc__ = "Callout blend mode \n.. versionadded:: 3.20"
QgsCallout.Property.__doc__ = """Data definable properties.

* ``MinimumCalloutLength``: Minimum length of callouts
* ``OffsetFromAnchor``: Distance to offset lines from anchor points
* ``OffsetFromLabel``: Distance to offset lines from label area
* ``DrawCalloutToAllParts``: Whether callout lines should be drawn to all feature parts
* ``AnchorPointPosition``: Feature's anchor point position
* ``LabelAnchorPointPosition``: Label's anchor point position
* ``OriginX``: X-coordinate of callout origin (label anchor)

  .. versionadded:: 3.20

* ``OriginY``: Y-coordinate of callout origin (label anchor)

  .. versionadded:: 3.20

* ``DestinationX``: X-coordinate of callout destination (feature anchor)

  .. versionadded:: 3.20

* ``DestinationY``: Y-coordinate of callout destination (feature anchor)

  .. versionadded:: 3.20

* ``Curvature``: Curvature of curved line callouts

  .. versionadded:: 3.20

* ``Orientation``: Orientation of curved line callouts

  .. versionadded:: 3.20

* ``Margins``: Margin from text

  .. versionadded:: 3.20

* ``WedgeWidth``: Balloon callout wedge width

  .. versionadded:: 3.20

* ``CornerRadius``: Balloon callout corner radius

  .. versionadded:: 3.20

* ``BlendMode``: Callout blend mode

  .. versionadded:: 3.20


"""
# --
QgsCallout.OrderBelowAllLabels = QgsCallout.DrawOrder.OrderBelowAllLabels
QgsCallout.OrderBelowIndividualLabels = QgsCallout.DrawOrder.OrderBelowIndividualLabels
QgsCallout.PoleOfInaccessibility = QgsCallout.AnchorPoint.PoleOfInaccessibility
QgsCallout.PointOnExterior = QgsCallout.AnchorPoint.PointOnExterior
QgsCallout.PointOnSurface = QgsCallout.AnchorPoint.PointOnSurface
QgsCallout.Centroid = QgsCallout.AnchorPoint.Centroid
QgsCallout.LabelPointOnExterior = QgsCallout.LabelAnchorPoint.LabelPointOnExterior
QgsCallout.LabelCentroid = QgsCallout.LabelAnchorPoint.LabelCentroid
QgsCallout.LabelTopLeft = QgsCallout.LabelAnchorPoint.LabelTopLeft
QgsCallout.LabelTopMiddle = QgsCallout.LabelAnchorPoint.LabelTopMiddle
QgsCallout.LabelTopRight = QgsCallout.LabelAnchorPoint.LabelTopRight
QgsCallout.LabelMiddleLeft = QgsCallout.LabelAnchorPoint.LabelMiddleLeft
QgsCallout.LabelMiddleRight = QgsCallout.LabelAnchorPoint.LabelMiddleRight
QgsCallout.LabelBottomLeft = QgsCallout.LabelAnchorPoint.LabelBottomLeft
QgsCallout.LabelBottomMiddle = QgsCallout.LabelAnchorPoint.LabelBottomMiddle
QgsCallout.LabelBottomRight = QgsCallout.LabelAnchorPoint.LabelBottomRight
QgsCurvedLineCallout.Automatic = QgsCurvedLineCallout.Orientation.Automatic
QgsCurvedLineCallout.Clockwise = QgsCurvedLineCallout.Orientation.Clockwise
QgsCurvedLineCallout.CounterClockwise = QgsCurvedLineCallout.Orientation.CounterClockwise
try:
    QgsCallout.QgsCalloutContext.__attribute_docs__ = {'allFeaturePartsLabeled': '``True`` if all parts of associated feature were labeled', 'originalFeatureCrs': 'Contains the CRS of the original feature associated with this callout.\n\n.. versionadded:: 3.20'}
    QgsCallout.QgsCalloutContext.__group__ = ['callouts']
except (NameError, AttributeError):
    pass
try:
    QgsCallout.propertyDefinitions = staticmethod(QgsCallout.propertyDefinitions)
    QgsCallout.encodeAnchorPoint = staticmethod(QgsCallout.encodeAnchorPoint)
    QgsCallout.decodeAnchorPoint = staticmethod(QgsCallout.decodeAnchorPoint)
    QgsCallout.encodeLabelAnchorPoint = staticmethod(QgsCallout.encodeLabelAnchorPoint)
    QgsCallout.decodeLabelAnchorPoint = staticmethod(QgsCallout.decodeLabelAnchorPoint)
    QgsCallout.__group__ = ['callouts']
except (NameError, AttributeError):
    pass
try:
    QgsSimpleLineCallout.create = staticmethod(QgsSimpleLineCallout.create)
    QgsSimpleLineCallout.__group__ = ['callouts']
except (NameError, AttributeError):
    pass
try:
    QgsManhattanLineCallout.create = staticmethod(QgsManhattanLineCallout.create)
    QgsManhattanLineCallout.__group__ = ['callouts']
except (NameError, AttributeError):
    pass
try:
    QgsCurvedLineCallout.create = staticmethod(QgsCurvedLineCallout.create)
    QgsCurvedLineCallout.__group__ = ['callouts']
except (NameError, AttributeError):
    pass
try:
    QgsBalloonCallout.create = staticmethod(QgsBalloonCallout.create)
    QgsBalloonCallout.__group__ = ['callouts']
except (NameError, AttributeError):
    pass