progress preview render results while drawing the layer, which
differ from the final layer render
The immediate use case here is for rendering tiled scene layers.
In order to generate the actual final render for these layers,
we need to first fetch ALL content for the render and then sort
the primitives by z value. But this means that the layer renders
can be extremely slow, with no visible changes on the map until
all the content fetching is complete. Not great user experience!
Instead, here we add the infrastructure so that a layer renderer
can get a temporary image to paint to for any partial renders.
This image gets used during map composition up until the layer
finally finishes rendering, at which time the layer's actual
destination image will be used for the composition.
This means that tiled scene renderers can now draw all tiles
(with unsorted primitives, and the artifacts which come with
that) as soon as we fetch each tile. This gives the user an
immediate visual reflection that the tiles are being fetched
and that how quickly (or slowly) that is happening. As soon
as we've got all tiles, the layer render will be immediately
switched to the version in which all content is rendered
in the correct z order.
As a bonus, we draw these temporary in progress renders
over any previously transformed cache version of the layer
available. So eg when you zoom in, you'll get a zoomed in pixelated
version of the last render which gets progressively drawn
over with each tile as it is fetched.
This same API could be used in future eg with point cloud
rendering when points are being sorted by z value to give
timely visual feedback.
* QgsShadingRendering and pipe to render global elevation map
* gdal utils with datatype and resampling method enum
* raster layer elevation map
* optimize raster elevation map with rotation
* handle no data value in the map elevation raster pipe
* mesh layer and some little fixes
* fix nodata and hillshading z factor
* render shading on layout
* activate/deactivate the shading from ui
* shading only for layer that have elevation
* apply Z scale and offset of layer elevation properties
* ui settings
* allow elevation from point cloud even edl is deactivate for pointcloud
* fix ui
* sipify
* Shading renderer widget in styling panel
* icone for shading renderer settings widget
* two methods to combin elevation
* rewording
* remove check box at the bottom of canvas
* use band of elevation properties
* fix styling pannel
* render shading in layout
* keep EDL point cloud shading individually
* add shading rendering tests
* add missing code for local EDL for point cloud
* shading inactive by default
* rework raster layer resampling
* improve nodata in elevation map
* don't allow elevation map with != size to be combined
* remove EDL from point cloud
* renaming
* sipify
* colorize tests
* renaming
* RGB32
* renaming leftover
* some ui fixes
* fix border for EDL alg
* fix EDL closed next to nodata value
* fix first shading when activated
* renaming and typo
* fixes for doc, doxygen, indentation and spelling
* remove leftover member
* fix clang-tidy
* fix edl tests
* fix dll export
* minor fixes
* adapt images of tests
* fix narrowing
* fix indentation
* sipify
* WIP
* minor ui changes
for cancelation check support
While there is the existing QgsRenderContext::renderingStopped()
check, this doesn't play well with other parts of QGIS which utilise
a QgsFeedback object for cancelation support. By adding support
for a proper QgsFeedback object in render contexts then it becomes
trivial to pass this on to feature requests, expression contexts,
and other potentially expensive functions so that these can
all be canceled responsively too.
(At some stage in the future we should consider deprecating
QgsRenderContext::rendereringStopped(), but that's not done here)
Gives a means of setting the reference scale for a vector layer
renderer, so that symbol sizes in the rendered layer will be
scaled accordingly depending on the actual scale of the
rendered map.
This should match the desired scale denominator for the rendered map,
eg 1000.0 for a 1:1000 map render. Set (by default) to -1 to disable
symbology scaling by reference scale.
The symbology reference scale is an optional property which specifies
the reference scale at which symbology in paper units (such as
millimeters or points) is fixed to. For instance, if \a scale is set
to 1000 then a 2mm thick line will be rendered at exactly 2mm thick
when a map is rendered at 1:1000, or 1mm thick when rendered at
1:2000, or 4mm thick at 1:500.
Allows for map renders to be filtered by a z or elevation range,
such that only parts of the layer which are considered within
this range will be rendered.
Implements https://github.com/qgis/QGIS-Enhancement-Proposals/issues/201
*Requires support for respecting the QgsRenderContext zRange to be added
to the relevant map layer renderers
extent and have had to resort to fetching all features from a layer,
defer the geometry clipping the map extent so that it occurs
AFTER transforming the layer's geometries to the target map extent.
This allows us to correctly clip the feature geometries in the case
that the visible extent available from the render context for the layer
is not accurate (i.e. it's a whole of globe fallback), and avoids
rendering features which fall far outside of the visible map
region.
Fixes#38878
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
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.
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
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
* [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.
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.
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.
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.