35 Commits

Author SHA1 Message Date
Nyall Dawson
a513f5a1e6 Move QgsLabelPosition out to own file 2021-02-23 15:49:23 +10:00
Nyall Dawson
7dfef3a0b1 Newer doxygen versions don't auto convert the first line in a class'
documentation to a brief note, so we have to do it explicitly...
2021-02-19 08:15:29 +10:00
Nyall Dawson
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00
Denis Rouzaud
2cc632ee5d follow up QVariant 2021-01-03 20:16:56 +01:00
Nyall Dawson
4ee9feb56b Sipify 2020-10-09 11:20:09 +10:00
Nyall Dawson
9f83b413a7 [vectortiles] Fix labels disappear randomly between map redraws
Fixes #37450
2020-09-01 14:23:31 +10:00
Nyall Dawson
f62c6d5d56 [feature][labeling] Expose option to allow users to control whether
anchor point for line labels is a hint or a strict requirement

Strict: Labels are placed exactly on the label anchor only, and no
other fallback placements are permitted.

Hint: The label anchor is treated as a hint for the preferred label
placement, but other placements close to the anchor point are permitted.
2020-08-21 09:48:47 +10:00
Nyall Dawson
b14bb32104 [labeling] Add api to set line anchor point for labels, which represents
the percentage along line features at which labels for that feature
should gravitate toward
2020-08-18 11:09:18 +10:00
Nyall Dawson
ff9f525893 Fix see also links 2020-08-17 11:12:33 +10:00
Nyall Dawson
844e9a3aac Move label overrun settings to QgsLabelLineSettings 2020-08-17 11:12:33 +10:00
Nyall Dawson
b31d315a52 Move another line label related setting and enum to QgsLabelLineSettings 2020-08-17 11:12:33 +10:00
Nyall Dawson
5dfbfaa89e Move some more line label related settings to QgsLabelLineSettings 2020-08-17 11:12:33 +10:00
Nyall Dawson
d93d881192 Move merge line settings to QgsLabelLineSettings 2020-08-17 11:12:33 +10:00
Nyall Dawson
23848e0e89 Start cleaning up label line settings, by moving them from the
QgsPalLayerSettings mega class to a dedicated QgsLabelLineSettings
class
2020-08-17 11:12:33 +10:00
Nyall Dawson
cfd9afed71 [feature][labeling] Expose Justify text alignment option for use
in multiline point/polygon labels

Allows multiline labels to be "justify" aligned
2020-07-09 13:23:20 +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
0e139992e3 Split massive qgstextrenderer.cpp/.h files into separate files per
contained class

and tighten includes to speed up recompilation
2020-05-12 10:33:30 +10:00
Nyall Dawson
7fc9c555de More cleanups, avoid multiple parsing of the same HTML content for a label 2020-05-12 10:33:30 +10:00
Nyall Dawson
f5d68ff423 Adapt QgsPalLabeling.splitToLines to account for HTML formatting 2020-05-12 10:33:29 +10:00
Nyall Dawson
66a3b090da Maybe even LESS enum classes will help? 2020-05-04 05:38:48 +10:00
Nyall Dawson
6ec369e6b7 Travis says no to enum class 2020-05-04 05:38:48 +10:00
Nyall Dawson
d0ca4f31f8 Since 2020-05-04 05:38:48 +10:00
Nyall Dawson
e10c9f3b19 [labeling][FEATURE] Add a dedicated polygon placement mode for "outside"
When selected, labels will always be placed outside of polygons for the
layer

Sponsored by QGIS Swiss user group
2020-05-04 05:38:48 +10:00
Nyall Dawson
9fb85d3bc8 [FEATURE][labeling] Permit data defined control over placing labels outside
polygons

Options are:
- 'yes': allow placing outside the polygon if needed
- 'no': don't allow outside placements
- 'force': only ever put this label outside the polygon
2020-05-04 05:38:48 +10:00
Nyall Dawson
51820badc1 [FEATURE][labeling] Add option to allow polygon labels to be placed
outside of polygon features when required

When a label can't be placed inside the polygon and this option is checked,
then it will be automatically placed at a nicely selected location
just outside of the polygon

Sponsored by QGIS Swiss user group!
2020-05-04 05:38:48 +10:00
Martin Dobias
8c488b4ef0 Added QgsRenderContext arg to referencedFields() + unit tests 2020-04-15 08:33:29 +10:00
Martin Dobias
f8a6b9fa3a Add support for labeling of vector tile layers 2020-04-15 08:33:29 +10:00
Nyall Dawson
0cd955743c Create QgsLabeling class for labeling related enums and constants,
and avoid inclusion of pal header in a public QGIS header

pal is an internal implementation detail -- it should not be exposed
publicly
2020-01-15 17:10:37 +13:00
Nyall Dawson
f44c229405 Fix dox test 2019-12-26 13:18:10 +10:00
Nyall Dawson
1899f90a04 [needs-docs] Rework label engine "maximum line candidates" and "maximum polygon candidates"
settings and logic

The previous approach of a single fixed value which applied to ALL line and ALL polygon
features was... not ideal. It meant that all line features would be assigned the same
number of candidates, regardless of length. So a road of length 1 cm on the rendered
map would have an identical number of candidates as a 30cm road covering the length of the
whole map!! This resulted in both a lot of wasted calculations (generating a ridiculous
number of candidates for small lines at barely discernable distances from each other)
AND an insufficient number of candidates for lengthy features (resulting in worse label
placement for these features).

(The situation was similar, but even worse for polygons)

Now, the setting is reworked to "Number of line candidates per cm" and "number of
polygon candidates per cm2". This means that small features get much less candidates,
and large features get much more features! Both a win for map rendering speed in many
circumstances AND good cartography... now that's a nice Christmas gift for QGIS :)
2019-12-26 13:18:10 +10:00
Nyall Dawson
df102a98da [needs-docs] Drop setting for maximum number of point label candidates
This setting is easily replaced by automatically calculated, optimised
values for each separate point plcaement mode individually
2019-12-26 13:18:10 +10:00
Nyall Dawson
898205e7d8 Fix dox 2019-12-12 07:44:11 +10:00
Nyall Dawson
b1bbc8511b [labeling] Move settings related to removing labels (e.g. max no
of labels, min size for labels) to a new class QgsLabelThinningSettings

This new class is designed to contain settings related to how the label
engine removes candidate label positions and reduces the number of
displayed labels.
2019-12-12 07:44:11 +10:00
Nyall Dawson
a8adb2d6c2 Code shuffle: move all labeling related code into src/core/labeling
So that these files are all grouped together, making it easier to locate
all the components of the labeling engine and hopefully making things
easier to navigate
2019-12-11 14:05:44 +10:00