198 Commits

Author SHA1 Message Date
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
Nyall Dawson
8d4f00b0af Remove TODO comments included in public API documentation
This is just "airing our dirty laundry". We don't want/need end users
to see this.
2020-06-15 13:43:58 +10:00
Nyall Dawson
81a9db9f57 [sipify] Fix creation of cross references 2020-06-15 13:43:58 +10:00
Nyall Dawson
cedd73ee4d More list formatting fixes 2020-06-13 16:49:14 +10:00
Blottiere Paul
01e879c5b0 Update QgsRuleBasedRenderer::RenderJob 2020-06-12 08:45:13 +10:00
Blottiere Paul
39b63cbbdc Fix use of deleted function for QgsRuleBasedRenderer::RenderJob 2020-06-12 08:45:13 +10:00
Nyall Dawson
ae42850d08 Sipify 2020-06-11 13:29:59 +10:00
Nyall Dawson
c795ddb1e9 Updates 2020-06-11 13:29:59 +10:00
Nyall Dawson
98d618b444 Tighten includes 2020-06-11 05:30:42 +10:00
vcloarec
9fec5262b0 update SIP 2020-06-03 06:10:10 +10:00
Nyall Dawson
23396b7c86 [symbology] Don't force rasterized output when exporting point pattern fills
This avoids the force conversion to a raster based pattern which currently occurs
when exporting maps/layouts to a vector format (e.g. PDF). The raster pattern
results in considerable quality loss, and the tiling edges of the raster brush
can sometimes be seen in outputs.

Additionally, fixes render corrupt when marker subsymbols have data defined properties
which affect the marker shape, such as data defined rotation or sizes

Refs #16100 (still needs fixing for line fill symbols)
2020-05-28 11:49:59 +10:00
Ivan Ivanov
563ab0330f Fix: make "Part" struct dependent definitions private 2020-05-26 11:06:13 +10:00
Ivan Ivanov
899d3febad [Symbology][Feature] Allow centroid fill markers to be clipped within current polygon or polygon part 2020-05-26 11:06:13 +10:00
Nyall Dawson
ef97e8c6fc [symbology] When rendering features, split the geometry fetching
and preparation stage from the symbol layer rendering stage, and
ensure that QgsSymbolLayer::startFeatureRender and ::stopFeatureRender
is correctly called in the right sequence when rendering multi-layer
symbols

This fixes issues with symbol layers which rely on startFeatureRender
and stopFeatureRender to correctly render, e.g. the Random Marker Fill
symbol layer.

Before this fix, the logic looked like:

- for every symbol layer in the symbol, call startFeatureRender
- for each part in polygon, prepare the part geometry and then render each symbol layer
- for every symbol layer in the symbol, call stopFeatureRender

The issue with this approach is that symbol layers which defer
rendering to the stopFeatureRender stage are always rendered
after ALL other symbol layers in the symbol, regardless of the actual
order of the symbol layers. Ultimately this causes Random Marker Fill
layers to always render on the top of symbols.

The new logic is:
- for each part in polygon, prepare the geometry and store the result
- for each symbol layer in the symbol:
   - call startFeatureRender
   - render the layer using each of the previously prepared parts
   - call stopFeatureRender

This results in correct stacking of the random marker fill in multi
layer symbols, because the stopFeatureRender call is correctly called
before the next layer's startFeatureRender and renderPolygon calls

Also, use QVector instead of QList for rings for improved efficiency
2020-05-20 17:09:48 +10:00
vcloarec
aa6d23d540 disable transparency for QgsInterpolatedLineRenderer 2020-05-05 05:53:25 +10:00
Vincent Cloarec
f8fae3cf39
[FEATURE][MESH] 1D mesh width/color varying (#35926)
Introduce a renderer for 1D mesh edges that can vary width over the line. The line can also have different color based on the actual dataset value on the line's point.

Co-authored-by: Peter Petrik <zilolv@gmail.com>
2020-04-24 10:49:24 +02:00
Nyall Dawson
ec2894ea32 Show favorited legend patches in legend patch button menu 2020-04-22 12:43:01 +10:00