461 Commits

Author SHA1 Message Date
Juho Ervasti
13ee0bf5cf Apply suggestions from review 2024-12-10 09:56:33 +10:00
Juho Ervasti
e7a27d05c7 Fix style 2024-12-10 09:56:33 +10:00
JuhoErvasti
5c49205bd2 Add maximumExtentBuffer() function to QgsFeatureRenderer 2024-12-10 09:56:33 +10:00
JuhoErvasti
ccc7df5966 Add extent buffer property to QgsSymbol 2024-12-10 09:56:33 +10:00
Denis Rouzaud
76f702e48a sipify 2024-12-05 13:19:50 +01:00
Nyall Dawson
37478db0c1 Fix more function links 2024-12-03 12:57:44 +10:00
Nyall Dawson
2abc9d92ca [sld] Don't try to write rules/categorizes without symbolizers
Only create rules/categorized categories/graduated ranges if the
associated symbol could be converted to SLD, and is not an "empty"
symbol.

Otherwise we do not generate a rule, as SLD spec requires a
Symbolizer element to be present.
2024-11-19 21:06:26 +10:00
Nyall Dawson
f446bda82a [optimisation] Greatly speed up clone of QgsSvgMarkerSymbolLayer
The old method was very inefficient, as it required a re-load and
re-parse of the associated SVG file content with every clone, only
for many of the parsed properties to be immediately overwritten.

Optimise by just directly copying members, avoiding all unnecessary
work.

This is frequently seen as a hotspot when profiling map renders,
as that involves cloning all symbol layers upfront.

Speeds up a benchtest cloning 100k markers from 4.3 seconds to
150ms.
2024-11-19 12:40:44 +10:00
Nyall Dawson
f2f05abca1 Cleanup docs, use \param instead of @param 2024-10-16 13:01:39 +10:00
Nyall Dawson
bc28bfd333 Fix/suppress more duplInheritedMember warnings 2024-10-15 15:00:05 +10:00
Nyall Dawson
6b344cd1fc Remove broken swap methods, replace with standard assignment op
which correctly sets all members
2024-10-15 15:00:05 +10:00
Nyall Dawson
de73f3c975 Add docs 2024-10-15 15:00:05 +10:00
Nyall Dawson
967388df86 Fix cppcheck 'function can be const' warnings 2024-10-15 15:00:05 +10:00
Nyall Dawson
1fc5ae33aa Add missing sip cast for QgsFilledLineSymbolLayer 2024-09-16 16:52:20 +10:00
Nyall Dawson
c50c923261 Add API to determine if feature renderer affects labeling results 2024-09-14 13:25:59 +10:00
Nyall Dawson
391b61544e
Handle SIP_OUT with void functions 2024-09-10 11:46:47 +10:00
Nyall Dawson
b39f760cbc
Correctly handle multiline SIP_OUT param documentation 2024-09-10 11:11:25 +10:00
Nyall Dawson
05003ba2fa [feature] Add "Linear Referencing" symbol layer type
This new symbol layer type allows placing text labels at regular
intervals along a line (or at positions corresponding to
existing vertices). Positions can be calculated using
Cartesian distances, or interpolated from z/m values.

Functionality includes:

- Labels can be placed using fixed cartesian 2d distances,
at regular linearly interpolated spacing calculated using
the Z or M values in geometries, or at existing vertices
- Labels can show either the running total distance, or
the linearly interpolated Z/M value
- Uses text rendered to draw labels, so the full range
of functionality is available for the labels (including
buffers, shadows, etc)
- Uses the QGIS numeric format classes to format numbers
as strings, so users have full range of customisation
options for eg decimal places
- An optional "skip multiples of" setting. If set, then
labels which are a multiple of this value will be skipped
over. This allows construction of complex referencing labels,
eg where a symbol has two linear referencing symbol layers,
one set to label every 100m in a small font, skipping multiples
of 1000, and a second set to label every 1000m in a big
bold font
- Labels are rendered using an angle calculated by averaging
the linestring, so sharp tiny jaggies don't result in
unslightly label rotation
- Optionally, markers can be placed at referenced points
in the line string, using a full QGIS marker symbol (this allows
eg showing a cross-hatch at the labeled point, for a "ruler"
style line)
- Data defined control over the placement intervals, skip
multiples setting, marker visibility and average angle
calculation length

Notes:

- When using the distance-based placement or labels, the
distances are calculated using 2D only, Cartesian calculations
based on the original layer CRS. This could potentially be
extended in future to expose options for 3D Cartesian distances,
or ellipsoidal distance calculations.

Sponsored by the Swiss QGIS User Group
2024-09-04 19:06:26 +10:00
Nyall Dawson
55f78cfce1 Fix QgsSvgCache parameter formatting 2024-09-04 13:54:39 +10:00
Nyall Dawson
609abe07aa Fix test 2024-09-04 13:54:39 +10:00
Nyall Dawson
9e36048b32 Remove dead code 2024-09-04 13:54:39 +10:00
Nyall Dawson
79f2f8a412 Cleanup some CPT city docs 2024-09-04 13:54:39 +10:00
Nyall Dawson
0f1daa11f3 Fix formatting of some \see links 2024-09-04 06:32:03 +10:00
Nyall Dawson
ef0289f3ec Fix formatting of Python ..deprecated annotations in docstrings
Fixes https://github.com/qgis/pyqgis-api-docs-builder/issues/174
2024-09-02 11:42:12 +10:00
Nyall Dawson
a6f5c50b36 Move some style related enums out of global namespace 2024-08-31 06:20:02 +10:00
Nyall Dawson
49d31fa527 Fix some malformed docs 2024-08-30 05:47:07 +10:00
Nyall Dawson
519959154a Fix some overly verbose class "brief" descriptions 2024-08-28 11:58:21 +10:00
Nyall Dawson
cc6b83449d Add some missing class docstrings 2024-08-16 07:28:29 +10:00
Nyall Dawson
76adc371ac Ensure marker halos are drawn in legends, symbol preview icons 2024-08-15 06:25:41 +10:00
Nyall Dawson
3a578d6712 Header update 2024-08-13 20:28:55 +10:00
Nyall Dawson
be8dce7d0d Valid improvements from new sipify 2024-08-13 20:28:55 +10:00
Nyall Dawson
627263ec0f Implement widget for symbol buffer settings 2024-08-02 05:09:03 +10:00
Nyall Dawson
efd700b9e1 Move geometry to QPolygonF list function to common static method 2024-08-02 05:09:03 +10:00
Nyall Dawson
b5437eef50 Add fill symbol for symbol buffers 2024-08-02 05:09:03 +10:00
Nyall Dawson
13c1a1b997 Force vector rendering of symbols when symbol has buffer enabled 2024-08-02 05:09:03 +10:00
Nyall Dawson
c6c3c77303 Populate buffer settings 2024-08-02 05:09:03 +10:00
Nyall Dawson
bf30f04d0a Make common function for copying QgsSymbol properties
Avoid fragile duplicate code in subclasses
2024-08-02 05:09:03 +10:00
Nyall Dawson
c2c75f3b19
More no-value dox removal 2024-07-25 09:04:22 +10:00
Nyall Dawson
6f652d251b Drop no-value copy constructor dox 2024-07-25 04:02:55 +10:00
Nyall Dawson
28943f9c1b Remove a bunch of useless default constructor doxygen 2024-07-23 02:08:28 +10:00
uclaros
15ebae07df add userData property to 2024-06-22 10:23:34 +10:00
Nyall Dawson
5e752537dc Use SymbolRenderHint for flagging subsymbols
Instead of the extra argument to startRender
2024-06-21 23:10:32 +10:00
Nyall Dawson
fced4e16d0 Add CanCalculateMaskGeometryPerFeature flag to "simple" symbol layers
These are the symbol layer classes where there's no special logic
required relating to feature rendering and features are rendered
one-by-one, with no sub symbols.
2024-06-21 23:10:32 +10:00
Nyall Dawson
0ca28af9a0 Greatly optimise selective masking vector exports
Optimise the logic used when the new geometry backend for
selective masking is in effect:

Whenever its SAFE, instead of calculating an "entire map" clipping
path and then applying this for every feature being rendered,
we now defer the calculation of the clipping path until we
are rendering individual features. Then, we create a clipping path
which contains ONLY the mask paths which are within the area
being drawn over.

This avoids having the entire map clipping path being used for
EVERY feature being rendered, which results in huge PDF/SVG
exports when masks are in effect, and instead results in
clipping paths which are confined just to a sensible area
around each rendered feature.

In some complex test projects this reduces the PDF export
size by a factor of 0.01!! (and results in PDFs/SVGs which
open much quicker in viewers and editors, and don't grind
their operation to a halt).
2024-06-21 23:10:32 +10:00
Nyall Dawson
7d49b89265 Make installMasks return TRUE if any masks were found and installed 2024-06-21 23:10:32 +10:00
Nyall Dawson
3c2ff6894a Add argument to QgsSymbol::startRender for whether symbol is subsymbol
Allows us to know in startRender whether the symbol is actually
a subsymbol for a QgsSymbolLayer. Currently unused.
2024-06-21 23:10:32 +10:00
Nyall Dawson
9181953df7 Add method to collect symbol layer clip geometries intersecting given bounds 2024-06-21 23:10:32 +10:00
Nyall Dawson
e7bff1f50e Avoid API break 2024-06-11 07:45:09 +10:00
Nyall Dawson
0b41123cb9 Add SIP_OUT 2024-06-11 07:45:09 +10:00
uclaros
c6eb40f64f update docstrings 2024-06-11 07:45:09 +10:00