@@ -680,44 +680,62 @@ Base class for polygon renderers generating texture images*
680
680
681
681
void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit );
682
682
%Docstring
683
- Sets the units for the symbol's stroke width.
684
-
685
- :param unit: symbol units
683
+ Sets the ``units`` fo the symbol's stroke width.
686
684
687
685
.. seealso:: :py:func:`strokeWidthUnit`
686
+
687
+ .. seealso:: :py:func:`setStrokeWidthMapUnitScale`
688
688
%End
689
689
690
690
QgsUnitTypes::RenderUnit strokeWidthUnit() const;
691
691
%Docstring
692
692
Returns the units for the symbol's stroke width.
693
693
694
694
.. seealso:: :py:func:`setStrokeWidthUnit`
695
+
696
+ .. seealso:: :py:func:`strokeWidthMapUnitScale`
695
697
%End
696
698
697
699
void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale );
700
+ %Docstring
701
+ Sets the stroke width map unit ``scale``.
702
+
703
+ .. seealso:: :py:func:`strokeWidthMapUnitScale`
704
+
705
+ .. seealso:: :py:func:`setStrokeWidth`
706
+
707
+ .. seealso:: :py:func:`setStrokeWidthUnit`
708
+ %End
709
+
698
710
const QgsMapUnitScale &strokeWidthMapUnitScale() const;
711
+ %Docstring
712
+ Returns the stroke width map unit scale.
713
+
714
+ .. seealso:: :py:func:`setStrokeWidthMapUnitScale`
715
+
716
+ .. seealso:: :py:func:`strokeWidth`
717
+
718
+ .. seealso:: :py:func:`strokeWidthUnit`
719
+
720
+ .. versionadded:: 2.16
721
+ %End
699
722
700
723
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
701
724
702
725
virtual QgsUnitTypes::RenderUnit outputUnit() const;
703
726
704
-
705
727
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
706
728
707
729
virtual QgsMapUnitScale mapUnitScale() const;
708
730
709
-
710
731
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
711
732
712
-
713
733
virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
714
734
715
735
virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
716
736
717
-
718
737
virtual Qt::PenStyle dxfPenStyle() const;
719
738
720
-
721
739
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
722
740
723
741
@@ -750,12 +768,20 @@ A class for filling symbols with a repeated raster image.
750
768
enum FillCoordinateMode
751
769
{
752
770
Feature,
753
- Viewport
771
+ Viewport,
754
772
};
755
773
756
774
QgsRasterFillSymbolLayer( const QString &imageFilePath = QString() );
775
+ %Docstring
776
+ Constructor for QgsRasterFillSymbolLayer, using a raster fill from the
777
+ specified ``imageFilePath``.
778
+ %End
757
779
758
780
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
781
+ %Docstring
782
+ Creates a new QgsRasterFillSymbolLayer from a ``properties`` map. The caller takes
783
+ ownership of the returned object.
784
+ %End
759
785
760
786
static void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
761
787
%Docstring
@@ -1000,36 +1026,43 @@ Returns the map unit scale for the image's width.
1000
1026
1001
1027
protected:
1002
1028
1003
-
1004
-
1005
-
1006
1029
virtual void applyDataDefinedSettings( QgsSymbolRenderContext &context );
1007
1030
1008
- %Docstring
1009
- Path to the image file
1010
- %End
1011
1031
1012
1032
};
1013
1033
1014
1034
class QgsSVGFillSymbolLayer: QgsImageFillSymbolLayer
1015
1035
{
1016
1036
%Docstring
1017
- A class for svg fill patterns. The class automatically scales the pattern to
1018
- the appropriate pixel dimensions of the output device*
1037
+ A class for filling symbols with a repeated SVG file.
1019
1038
%End
1020
1039
1021
1040
%TypeHeaderCode
1022
1041
#include "qgsfillsymbollayer.h"
1023
1042
%End
1024
1043
public:
1044
+
1025
1045
QgsSVGFillSymbolLayer( const QString &svgFilePath, double width = 20, double rotation = 0.0 );
1026
1046
%Docstring
1027
- Constructs SVG fill symbol layer with picture from given absolute path to a SVG file
1047
+ Constructor for QgsSVGFillSymbolLayer, using the SVG picture at the specified absolute file path.
1028
1048
%End
1049
+
1029
1050
QgsSVGFillSymbolLayer( const QByteArray &svgData, double width = 20, double rotation = 0.0 );
1051
+ %Docstring
1052
+ Constructor for QgsSVGFillSymbolLayer, using the specified SVG picture data.
1053
+ %End
1030
1054
1031
1055
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
1056
+ %Docstring
1057
+ Creates a new QgsSVGFillSymbolLayer from a ``properties`` map. The caller takes
1058
+ ownership of the returned object.
1059
+ %End
1060
+
1032
1061
static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
1062
+ %Docstring
1063
+ Creates a new QgsSVGFillSymbolLayer from a SLD ``element``. The caller takes
1064
+ ownership of the returned object.
1065
+ %End
1033
1066
1034
1067
static void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
1035
1068
%Docstring
@@ -1042,71 +1075,223 @@ Used internally when reading/writing symbols.
1042
1075
1043
1076
virtual QString layerType() const;
1044
1077
1045
-
1046
1078
virtual void startRender( QgsSymbolRenderContext &context );
1047
1079
1048
1080
virtual void stopRender( QgsSymbolRenderContext &context );
1049
1081
1050
-
1051
1082
virtual QgsStringMap properties() const;
1052
1083
1053
-
1054
1084
virtual QgsSVGFillSymbolLayer *clone() const /Factory/;
1055
1085
1056
-
1057
1086
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
1058
1087
1059
1088
1060
1089
void setSvgFilePath( const QString &svgPath );
1090
+ %Docstring
1091
+ Sets the path to the SVG file to render in the fill.
1092
+
1093
+ This is usually an absolute file path. Other supported options include
1094
+ - relative paths to folders from the user's SVG search paths
1095
+ - base64 encoded content, prefixed with a 'base64:' string
1096
+ - http(s) paths
1097
+
1098
+ .. seealso:: :py:func:`svgFilePath`
1099
+ %End
1100
+
1061
1101
QString svgFilePath() const;
1102
+ %Docstring
1103
+ Returns the path to the SVG file used to render the fill.
1104
+
1105
+ .. seealso:: :py:func:`setSvgFilePath`
1106
+ %End
1107
+
1062
1108
void setPatternWidth( double width );
1109
+ %Docstring
1110
+ Sets the ``width`` to render the SVG content as within the fill (i.e. the pattern repeat/tile size).
1111
+
1112
+ Units are specified by setPatternWidthUnit()
1113
+
1114
+ .. seealso:: :py:func:`patternWidth`
1115
+
1116
+ .. seealso:: :py:func:`setPatternWidthUnit`
1117
+
1118
+ .. seealso:: :py:func:`setPatternWidthMapUnitScale`
1119
+ %End
1120
+
1063
1121
double patternWidth() const;
1122
+ %Docstring
1123
+ Returns the width of the rendered SVG content within the fill (i.e. the pattern repeat/tile size).
1124
+
1125
+ Units are retrieved by patternWidthUnit()
1126
+
1127
+ .. seealso:: :py:func:`setPatternWidth`
1128
+
1129
+ .. seealso:: :py:func:`patternWidthUnit`
1130
+
1131
+ .. seealso:: :py:func:`patternWidthMapUnitScale`
1132
+ %End
1064
1133
1065
1134
void setSvgFillColor( const QColor &c );
1135
+ %Docstring
1136
+ Sets the fill color used for rendering the SVG content.
1137
+
1138
+ Fill color is only supported for parameterized SVG files. Color opacity is
1139
+ ignored if the SVG file does not support parameterized fill opacity.
1140
+
1141
+ .. seealso:: :py:func:`svgFillColor`
1142
+
1143
+ .. seealso:: :py:func:`setSvgStrokeColor`
1144
+ %End
1145
+
1066
1146
QColor svgFillColor() const;
1147
+ %Docstring
1148
+ Returns the fill color used for rendering the SVG content.
1149
+
1150
+ Fill color is only supported for parameterized SVG files.
1151
+
1152
+ .. seealso:: :py:func:`setSvgFillColor`
1153
+
1154
+ .. seealso:: :py:func:`svgStrokeColor`
1155
+ %End
1067
1156
1068
1157
void setSvgStrokeColor( const QColor &c );
1158
+ %Docstring
1159
+ Sets the stroke color used for rendering the SVG content.
1160
+
1161
+ Stroke color is only supported for parameterized SVG files. Color opacity is
1162
+ ignored if the SVG file does not support parameterized outline opacity.
1163
+
1164
+ .. seealso:: :py:func:`svgStrokeColor`
1165
+
1166
+ .. seealso:: :py:func:`setSvgFillColor`
1167
+ %End
1168
+
1069
1169
QColor svgStrokeColor() const;
1170
+ %Docstring
1171
+ Returns the stroke color used for rendering the SVG content.
1172
+
1173
+ Stroke color is only supported for parameterized SVG files.
1174
+
1175
+ .. seealso:: :py:func:`setSvgStrokeColor`
1176
+
1177
+ .. seealso:: :py:func:`svgFillColor`
1178
+ %End
1179
+
1070
1180
void setSvgStrokeWidth( double w );
1181
+ %Docstring
1182
+ Sets the stroke width used for rendering the SVG content.
1183
+
1184
+ Stroke width is only supported for parameterized SVG files. Units are
1185
+ specified via setSvgStrokeWidthUnit()
1186
+
1187
+ .. seealso:: :py:func:`svgStrokeWidth`
1188
+
1189
+ .. seealso:: :py:func:`setSvgStrokeWidthUnit`
1190
+
1191
+ .. seealso:: :py:func:`setSvgStrokeWidthMapUnitScale`
1192
+ %End
1193
+
1071
1194
double svgStrokeWidth() const;
1195
+ %Docstring
1196
+ Returns the stroke width used for rendering the SVG content.
1197
+
1198
+ Stroke width is only supported for parameterized SVG files. Units are
1199
+ retrieved via setSvgStrokeWidthUnit()
1200
+
1201
+ .. seealso:: :py:func:`setSvgStrokeWidth`
1202
+
1203
+ .. seealso:: :py:func:`svgStrokeWidthUnit`
1204
+
1205
+ .. seealso:: :py:func:`svgStrokeWidthMapUnitScale`
1206
+ %End
1072
1207
1073
1208
void setPatternWidthUnit( QgsUnitTypes::RenderUnit unit );
1074
1209
%Docstring
1075
- Sets the units for the width of the SVG images in the pattern.
1076
-
1077
- :param unit: width units
1210
+ Sets the ``unit`` for the width of the SVG images in the pattern.
1078
1211
1079
1212
.. seealso:: :py:func:`patternWidthUnit`
1213
+
1214
+ .. seealso:: :py:func:`setPatternWidth`
1215
+
1216
+ .. seealso:: :py:func:`setPatternWidthMapUnitScale`
1080
1217
%End
1081
1218
1082
1219
QgsUnitTypes::RenderUnit patternWidthUnit() const;
1083
1220
%Docstring
1084
1221
Returns the units for the width of the SVG images in the pattern.
1085
1222
1086
1223
.. seealso:: :py:func:`setPatternWidthUnit`
1224
+
1225
+ .. seealso:: :py:func:`patternWidth`
1226
+
1227
+ .. seealso:: :py:func:`patternWidthMapUnitScale`
1087
1228
%End
1088
1229
1089
1230
void setPatternWidthMapUnitScale( const QgsMapUnitScale &scale );
1231
+ %Docstring
1232
+ Sets the map unit ``scale`` for the pattern's width.
1233
+
1234
+ .. seealso:: :py:func:`patternWidthMapUnitScale`
1235
+
1236
+ .. seealso:: :py:func:`setPatternWidth`
1237
+
1238
+ .. seealso:: :py:func:`setPatternWidthUnit`
1239
+ %End
1240
+
1090
1241
const QgsMapUnitScale &patternWidthMapUnitScale() const;
1242
+ %Docstring
1243
+ Returns the map unit scale for the pattern's width.
1244
+
1245
+ .. seealso:: :py:func:`setPatternWidthMapUnitScale`
1246
+
1247
+ .. seealso:: :py:func:`patternWidth`
1248
+
1249
+ .. seealso:: :py:func:`patternWidthUnit`
1250
+ %End
1091
1251
1092
1252
void setSvgStrokeWidthUnit( QgsUnitTypes::RenderUnit unit );
1093
1253
%Docstring
1094
- Sets the units for the stroke width.
1095
-
1096
- :param unit: width units
1254
+ Sets the ``unit`` for the stroke width.
1097
1255
1098
1256
.. seealso:: :py:func:`svgStrokeWidthUnit`
1257
+
1258
+ .. seealso:: :py:func:`setSvgStrokeWidth`
1259
+
1260
+ .. seealso:: :py:func:`setSvgStrokeWidthMapUnitScale`
1099
1261
%End
1100
1262
1101
1263
QgsUnitTypes::RenderUnit svgStrokeWidthUnit() const;
1102
1264
%Docstring
1103
1265
Returns the units for the stroke width.
1104
1266
1105
1267
.. seealso:: :py:func:`setSvgStrokeWidthUnit`
1268
+
1269
+ .. seealso:: :py:func:`svgStrokeWidth`
1270
+
1271
+ .. seealso:: :py:func:`svgStrokeWidthMapUnitScale`
1106
1272
%End
1107
1273
1108
1274
void setSvgStrokeWidthMapUnitScale( const QgsMapUnitScale &scale );
1275
+ %Docstring
1276
+ Sets the map unit ``scale`` for the pattern's stroke.
1277
+
1278
+ .. seealso:: :py:func:`svgStrokeWidthMapUnitScale`
1279
+
1280
+ .. seealso:: :py:func:`setSvgStrokeWidth`
1281
+
1282
+ .. seealso:: :py:func:`setSvgStrokeWidthUnit`
1283
+ %End
1284
+
1109
1285
const QgsMapUnitScale &svgStrokeWidthMapUnitScale() const;
1286
+ %Docstring
1287
+ Returns the map unit scale for the pattern's stroke.
1288
+
1289
+ .. seealso:: :py:func:`setSvgStrokeWidthMapUnitScale`
1290
+
1291
+ .. seealso:: :py:func:`svgStrokeWidth`
1292
+
1293
+ .. seealso:: :py:func:`svgStrokeWidthUnit`
1294
+ %End
1110
1295
1111
1296
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
1112
1297
@@ -1120,8 +1305,6 @@ Returns the units for the stroke width.
1120
1305
1121
1306
protected:
1122
1307
1123
-
1124
-
1125
1308
virtual void applyDataDefinedSettings( QgsSymbolRenderContext &context );
1126
1309
1127
1310
0 commit comments