214 Commits

Author SHA1 Message Date
Denis Rouzaud
6061030f96
enable dynamic SVGs for fill symbol (#40902) 2021-01-08 12:02:31 +01:00
Denis Rouzaud
98d1be22f2 also update usedAttributes with attributes used in SVG parameters 2021-01-06 16:59:54 +01:00
Denis Rouzaud
130cbae947 prepare expressions of properties for SVG parameters 2021-01-06 16:59:54 +01:00
Denis Rouzaud
3881c81184 fix bad rebase 2021-01-06 16:33:23 +01:00
Denis Rouzaud
2e90da4b26 drop QgsSymbolLayerUitls::readSerializedProperties and serializeProperties 2021-01-06 16:11:14 +01:00
Denis Rouzaud
3201fa4ecb use QgsProperty to handle SVG parameters 2021-01-06 11:25:21 +01:00
Denis Rouzaud
9116a1a181 add a simple class to hold parameters information
this makes it more futureproof to introduce type (string/number) or domain (attribute vs node value)
2021-01-06 11:25:21 +01:00
Denis Rouzaud
9c0ee358ff core part to handle dynamic SVGs
this allow to use a map of parameters to dynamically replace attributes or nodes values in the XML of the SVG
2021-01-06 11:25:17 +01:00
Denis Rouzaud
fd7406cb08
Merge pull request #40716 from 3nids/qvariant-properties
use QVariantMap instead of QgsStringMap for symbol layer properties
2021-01-06 11:21:41 +01:00
Nyall Dawson
3ca2137f82 Improve QgsSvgCache documentation, add note about origin of QPictures
returned by svgAsPicture
2021-01-06 09:02:53 +10:00
Nyall Dawson
72065310f5 Dox++ 2021-01-04 13:52:18 +10:00
Nyall Dawson
16c4bead0c Fix dox warning 2021-01-04 13:52:18 +10:00
Nyall Dawson
7fba697bf3 [FEATURE] New "Merged feature" renderer for polygon and line layers
This renderer merges (or unions/dissolves) the line or polygon features
from a layer prior to rendering them. It's useful for rendering
a polygon layer with overlapping features as one single "coverage" feature,
or a line layer consisting of many smaller component line features
using a regularly spaced marker line or similar.

Internally, this just moves the guts of the existing inverted polygons
renderer to a new base class, as that renderer already had an option
to merge features prior to rendering. Basically it just exposes a new
renderer to users which is the inverted polygon renderer without
the inversion step!
2021-01-04 13:52:18 +10:00
Denis Rouzaud
0cae2bea6a add missing doxymentation 2021-01-03 20:33:27 +01:00
Denis Rouzaud
eb46defa6c fix bindings 2021-01-03 20:16:56 +01:00
Denis Rouzaud
2cc632ee5d follow up QVariant 2021-01-03 20:16:56 +01:00
Denis Rouzaud
f77bb217e2 use QVariantMap instead of QgsStringMap for symbol layer properties 2021-01-03 20:16:56 +01:00
Nyall Dawson
39560eaab2 Add interface class for objects which can generate a feature renderer for vector layers 2020-12-28 04:21:04 +10:00
Nyall Dawson
0ab761c210 Add proper method to determine whether a symbol uses map unit sizes,
and use this to determine whether a legend item needs updating
as a result of a map change

This results in a HUGE speed up when loading large projects where
symbols don't use Millimeter based sizes, as the previous code
assumed only that any non-millimeter size was a map unit based size.
2020-12-10 04:04:17 +10:00
Nyall Dawson
928b00a6e6 Add some more options to control how a preview pixmap for a color ramp is generated 2020-12-08 05:59:56 +10:00
Nyall Dawson
bf8075ced6 [FEATURE] Allow symbol opacity to be data defined
While it was possible to set the opacity for individual symbol layer
colors via data defined expressions, it's so far been impossible to
set a data defined expression to control the overall symbol opacity.

This commit fixes that omission...
2020-11-18 17:45:45 +10:00
Nyall Dawson
7f9d90536a Ensure that all symbol layer types correctly respect the symbol's opacity
setting, even when the symbol layer has data defined colors set or involves
sub symbols (e.g. marker line symbols)

Fixes #18022
2020-11-17 19:00:31 +10:00
Nyall Dawson
395718f0cb Fix PyQGIS docs for colorFromMimeData 2020-10-23 12:55:26 +10:00
Nyall Dawson
4f4b286d3d Add flag to turn off rendering crosshairs in the background of preview
images generated for markers by QgsSymbol::bigSymbolPreviewImage()
2020-10-22 02:44:45 +10:00
Nyall Dawson
746ee315bd Fix boolean literal presentation in dox/PyQGIS docs 2020-10-16 16:03:26 +10:00
Even Rouault
a76670e521 QStringLiteral -> QLatin1String changes generated by scripts/qstringfixup.sh --all 2020-10-11 12:30:58 +10:00
Nyall Dawson
ab6bbfda1d Fix all remaining Qt QFlags deprecated constructor warnings 2020-10-02 13:04:49 +10:00
Nyall Dawson
029f0679dc [FEATURE][symbology] Allow data-defined offset for fill symbol layers
Any fill symbol layer which supports offsetting polygons (i.e. simple
fills, raster image fills, shapeburst and gradent fills) now allows
for data-defined offsets
2020-09-09 10:40:07 +10:00
Nyall Dawson
96c2ddbade Make QgsSymbolLayerUtils::parseColor handle hsl(a) color strings 2020-09-06 21:07:25 +10:00
Mathieu Pellerin
707bad7766
[symbology] Improve rendering of selected SVG markers 2020-08-26 08:49:25 +07:00
Nyall Dawson
f496173bd7 Fix messy doxygen blocks which mess with sipify script
Fixes #38291
2020-08-20 17:01:35 +10:00
Nyall Dawson
1484a30fef Add API to allow generation of icons for 3d symbols from app
(still not implement -- but a necessary prerequisite to proper icons)
2020-07-29 10:27:17 +10:00
Nyall Dawson
a0e915fc50 Add support for filtering style model by 3d layer type 2020-07-29 10:27:17 +10:00
Nyall Dawson
d65b52db77 Add CompatibleGeometryTypesRole to style model 2020-07-29 10:27:17 +10:00
Nyall Dawson
6245b552a4 Add method to retrieve compatible layer types from 3d symbol in style library 2020-07-29 10:27:17 +10:00
Nyall Dawson
6e40962510 Partial 3d symbol style manager work 2020-07-29 10:27:17 +10:00
Nyall Dawson
9b19e069b3 Allow symbol and color ramp visitors the ability to edit symbols/color ramps they visit 2020-07-26 09:56:46 +10:00
Nyall Dawson
ea3eb7220c Dox 2020-07-24 12:58:55 +10:00
Nyall Dawson
e2a370fe3e Avoid repeating points when appending lines 2020-07-24 12:58:55 +10:00
Nyall Dawson
75635dbf0b [FEATURE][symbology] Add options to dynamically tweak dash pattern
in simple line symbol layers

New options are:

- Align dash pattern to line length: If checked, the dash pattern lengths
will be subtely adjusted in order to ensure that when a line is rendered
it will end with a complete dash element, instead of a gap element or
partial dash element

- Tweak dash pattern at sharp corners: If checked, this option dynamically
adjusts the dash pattern placement so that sharp corners are represented
by a full dash element coming into and out of the sharp corner. It's designed
to better represent the underlying geometry while rendering dashed lines,
especially for jagged lines
2020-07-24 12:58:55 +10:00
Nyall Dawson
0641f3f8b8 Add utility function to detect sharp corners 2020-07-24 12:58:55 +10:00
Nyall Dawson
ca5901b336 Add utility function to slice a QPolygonF linestring 2020-07-24 12:58:55 +10:00
Nyall Dawson
f60b79fcea Move QgsAbstract3DSymbol to core 2020-07-23 07:53:20 +10:00
Nyall Dawson
c7ef8c8305 Test updates 2020-07-11 12:54:07 +10:00
Nyall Dawson
329a0fc110 [feature][symbology] Expose option to offset simple line dash patterns
by a preset amount

Allows for tweaking the positioning of dashes/spaces in the line, so
that the dashes/spaces can be placed at nicer positions to account
for corners in the line (also can be used potentially to "align"
adjacent dash pattern borders)

Offset can be set in different units, including map units, and can
be data defined
2020-07-04 16:20:34 +10:00
Marco Hugentobler
c399f08cda Move creation of minSize/maxSize symbol to QgsSymbolLayerUtils 2020-06-30 17:03:22 +02:00
Marco Hugentobler
80b3a81771 Move min/max symbol size handling to QgsSymbolLayerUtils 2020-06-30 14:47:38 +02:00
Marco Hugentobler
9ecded8b73 Comments 2020-06-30 13:06:53 +02:00
Marco Hugentobler
6ff2fe45ab Add possibility to set a minimum symbol size in layout legend. Minimum and maximum size are also valid for line widths 2020-06-29 17:37:02 +02:00
Nyall Dawson
d98fe9f989 [symbology] When rendering a multipart geometry, ensure that
geometry generator symbol is only rendered once, instead of
once per part

Fixes #23730
2020-06-16 06:04:14 +10:00