31 Commits

Author SHA1 Message Date
Nyall Dawson
28c8eefa6e Avoid texture jump when panning maps
We don't need the whole expense of the "Avoid artifacts when rendering as map tiles"
option, because that disables to default clipping of geometry parts which fall
outside the visible canvas extent and accordingly results in a lot of wasted rendering
calculations. Instead, we can just always use the upper left corner of the original
feature geometry before the optimisations like clipping to visible regions are applied,
and use this as the texture origin.

This means we can safely make this handling always applied and not an opt-in setting
2020-07-11 12:54:07 +10:00
Nyall Dawson
6eee1fa69f Don't apply font scaling workaround by default, but instead make it
opt-in through the render context flags

Avoids potential performance regression when rendering labels
2020-07-08 08:49:57 +10:00
Nyall Dawson
b2cef7377c [feature][layouts] Expose option to control PDF image compression
method when exporting layouts to PDF

Options are for Lossy compression, which is the default JPEG compression
used, and Lossless compression (which creates bigger files in most
cases, but is much more suitable for professional printing outputs
or for post-production in Illustrator/etc)

The Bad news: this option is available in builds based on Qt 5.14
or later.
2020-07-05 15:40:48 +10:00
Nyall Dawson
61193fc841 Simplify some painter related operations and make safer 2020-07-04 19:11:10 +10:00
Nyall Dawson
5cbdc4c896 Ensure feature clipping occurs for render only, and doesn't affect
feature geometry when used in rule based renderers and other
geometry dependent rendering options
2020-07-02 12:07:51 +10:00
Nyall Dawson
e38bb541a6 Add clipping regions to QgsMapSettings/QgsRenderContext API 2020-07-02 12:07:51 +10:00
Nyall Dawson
b7eac07721 Add a render context flag so we know when a render operation is
occurring for drawing a symbol preview

Because these have no map association, certain settings like
sizes in "meters in map units" will have no meaning, and may need
special handling

Refs #28690
2020-06-17 08:02:49 +10:00
Nyall Dawson
81a9db9f57 [sipify] Fix creation of cross references 2020-06-15 13:43:58 +10:00
Nyall Dawson
1af8b8178b Add some helpful scoped RAII classes for use with QgsRenderContext
QgsScopedRenderContextPainterSwap: allows for temporarily swapping
the destination painter object for a QgsRenderContext for the lifetime
of the object

QgsScopedRenderContextScaleToMm: temporarily rescales a render context
destination painter device to use millimeter based units for the lifetime
of the object

QgsScopedRenderContextScaleToPixels: temporarily rescales a render
context (which has been scaled to millimeter based units) back
to pixel based units, for the lifetime of the object
2020-04-24 04:07:33 +10:00
Samweli
618f257874 moved qgsabstracttemporal class to qgstemporalrangeobject class as per review suggestions 2020-02-08 08:26:21 +03:00
Samweli
62efb55af2 updates on tests and abstract temporal class 2020-02-08 08:26:21 +03:00
Harrissou Sant-anna
224d6bc03f Add some missing dox and reference 2020-02-06 13:22:12 +10:00
Sandro Mani
c4a2bb0df0
Merge pull request #33827 from kadas-albireo/custom_render_flags
Add QgsRenderContext::setCustomRenderFlags
2020-01-22 13:14:35 +01:00
Sandro Mani
d604ab72f4 Add QgsRenderContext::setCustomRenderingFlags and QgsMapSettings::setCustromRenderingFlags 2020-01-22 10:38:44 +01:00
Sandro Mani
60b4cad050 Add const version of QgsRenderContext::painter 2020-01-16 15:22:58 +10:00
Hugo Mercier
845894b313
[FEATURE] Selective masking (#30747)
* [FEATURE] Selective masking

Advanced rendering feature that allows the definition of 'masks' areas around labels or with a new typ of symbol layer. These masks will "un-draw" symbol layers of other layers underneath.
It modifies the rendering process by adding an optional second pass.
2019-11-07 08:17:25 +01:00
rldhont
6625c7ba62 [Bugfix] Get remote SVG synchronously - in the server context 2019-10-11 14:08:17 +10:00
Nyall Dawson
c71cd4b5fc Initial work on rendered feature handler interface
Adds an interface for classes which provider custom
handlers for features rendered as part of a map render job.

QgsRenderedFeatureHandlerInterface objects are registered
in the QgsMapSettings objects used to construct map render
jobs. During the rendering operation, the handleRenderedFeature()
method will be called once for every rendered feature, allowing
the handler to perform some custom task based on the provided
information.

They can be used for custom tasks which operate on a set of
rendered features, such as creating spatial indexes of the
location and rendered symbology bounding box of all features
rendered on a map.
2019-08-07 21:53:16 +10:00
Nyall Dawson
615e245b18 Add method to specify global vector simplification overrides on a
QgsMapSettings object

If specified (they default to off), these simplification settings
will override any layer-specific simplification settings, and
provide a way for specifying a global simplication to apply
to vector layers while exporting maps.
2019-08-07 15:57:26 +10:00
Nyall Dawson
d8a5dfef06 Add missing dox to QgsRenderContext 2019-05-22 07:12:06 +10:00
Nyall Dawson
85ff9aea31 Add method to retrieve map extent to QgsRenderContext
Previously only a "layer clipping extent" was available for retrieval
from a QgsRenderContext instance, yet there's a need for rendering
operations to have access to the original full extent of the map
being rendered.
2019-05-10 06:31:00 +10:00
Nyall Dawson
b6d66becab Sipify 2019-02-27 09:41:11 +10:00
Nyall Dawson
44bbf1f137 Dox++ 2018-12-13 10:11:24 +10:00
Nyall Dawson
0659427ff7 Dox++ 2018-12-11 12:28:29 +10:00
Nyall Dawson
1eaf95a866 [api] Move setting to control how text is rendered to QgsRenderContext
The new QgsRenderContext::TextRenderFormat enum controls how text
should be handled during a render operation, e.g. whether to render
text as outlines (paths) or keep it as real text objects.

Deprecate previous arguments in QgsTextRenderer which handled
this same use case.

This allows us to make the setting vary per-render, instead of
having a single global flag controlling the setting. Ultimately
this will allow us to have different behaviour within the
canvas renders vs print layout exports.

Refs #3975
2018-12-11 12:28:29 +10:00
Nyall Dawson
2ed144ac59 Apply clang-tidy readability-avoid-const-params-in-decls fixit
Checks whether a function declaration has parameters that are
top level const.

const values in declarations do not affect the signature of a
function, so they should not be put there.
2018-06-05 10:19:13 +10:00
Denis Rouzaud
65bb60e96c run sipify 2018-05-28 10:39:34 -08:00
Nyall Dawson
3d6ea5972b Remove some junk lines from docstrings 2018-05-27 18:54:09 +10:00
Nyall Dawson
c864d22d1f Add "get ..." to doxygen compliance blacklist
Should be "gets ..." for consistent tense, or better yet
"returns ..." for consistency.
2018-05-27 14:05:06 +10:00
Nyall Dawson
1c615c15cc More documentation compliance
Use Qt style "returns .." tense instead of "return ..", and lock
this in with a documentation compliance unit test
2018-05-25 15:09:00 +10:00
Denis Rouzaud
7df2593caf move auto generated sip file in dedicated folder 2018-05-14 10:23:37 -04:00