4083 Commits

Author SHA1 Message Date
uclaros
b61bc22885 test renderer properties, not actual rendering 2022-04-04 02:57:00 -07:00
uclaros
c16e9a204c Sync pointcloud layer's 3d renderer style with 2d renderer 2022-04-04 02:57:00 -07:00
Nyall Dawson
0aad51c6d4 Base default image cache size on system memory
Instead of always defaulting to 100mb, then base the cache size
on the system memory:

- > 32gb, use 500mb
- 16-32gb, use 250mb
- else 100mb

The larger sizes can make a big difference to rendering speed for
complex projects, so let's let powerful systems utilise all that
memory!

(Only supported on linux for now)
2022-04-04 19:12:11 +10:00
Nyall Dawson
0acfff04fb Fix setting vector tile layer maximum tile zoom to levels > 14
Fixes #47933
2022-04-04 13:28:41 +10:00
Nyall Dawson
833685a21e Add utility function to calculate the ideal refresh rate of a
vector layer renderer, by hunting for any animated symbols
in the renderer
2022-04-04 11:43:47 +10:00
Nyall Dawson
78c8a670e3 [feature] New marker symbol type for "Animated Marker"
This new marker symbol type allows points to be rendered using
an animated marker, sourced from an animated gif, webp or mng
animation.

Options are present for marker file, size, angle and frame rate.

There are two ways in which animated symbols are handled:

1. If the map itself is considered an animation, then the frame
rendered for the animated marker is based on the map animation
frame and frame rate. This is the case when the temporal
controller is set to the Animation mode. In this case the
animated markers will follow the temporal controller animation,
e.g. pausing when the animation is paused, advancing frames
with the animation, etc. The map will also be redrawn using
the frame rate set for the temporal animation.

This mode also applies when exporting an animation from the
temporal controller.

It's also the mode used when a plugin specifically sets the
frame rate and current frame QgsMapSettings properties, so
e.g. @timlinux's QGIS Animation Workbench plugin will dictate
the marker animation frame to render.

2. If the map is NOT considered an animation (i.e. it's just
a plain old normal QGIS project), then the frame to render
will be based on the current timestamp alone.

Markers will be animated when their corresponding layer is set
to a temporal mode, and a temporal animation is playing.
2022-04-04 11:43:47 +10:00
uclaros
74fc47458b Report untwine errors to the user 2022-04-01 02:20:25 -07:00
Nyall Dawson
499c374dba Split out axis properties into separate class 2022-03-31 09:21:08 +10:00
Nyall Dawson
2029888c3d Add method to auto calculate plot intervals based on size 2022-03-31 09:21:08 +10:00
Nyall Dawson
67893ae1c6 Add @plot_axis, @plot_axis_value variables and test for data defined plot rendering 2022-03-31 09:21:08 +10:00
Nyall Dawson
fd4f42f9a6 Add methods to read/write plot state to xml 2022-03-31 09:21:08 +10:00
Nyall Dawson
0e851b3e92 Docs 2022-03-31 09:21:08 +10:00
Nyall Dawson
640d8134aa API improvements 2022-03-31 09:21:08 +10:00
Nyall Dawson
44ad8f51aa Simple framework for drawing 2d plots using native QGIS objects
Uses QGIS symbols, text formats and text numeric formats to render
chart components. Currently handles the background, grid, and axis
labels.
2022-03-31 09:21:08 +10:00
Nyall Dawson
dd89f3779a [processing] Always use the same method to launder names
Ultimately avoids forced removal of _ characters in model
parameter names
2022-03-30 15:41:23 +10:00
Mathieu Pellerin
5bbad02806 [nmea] Convert RMC mode indicator to its equivalent signal variant to provide accurate quality description 2022-03-28 13:57:22 +07:00
Nyall Dawson
0f1c0df330 Expose task flags control for QgsMapRendererTask
Allows plugins to create hidden/uncancelable render tasks
2022-03-28 11:40:14 +10:00
Nyall Dawson
3e2467d3f3 Add method to retrieve next frame delay for animated images to QgsImageCache 2022-03-28 06:16:02 +10:00
Nyall Dawson
5451f22017 Set animation properties for map settings when exporting animations 2022-03-27 15:40:05 +10:00
Nyall Dawson
2e960aaeed Add map frame rate and current frame numbers to QgsMapSettings/QgsRenderContext
Makes this information available for symbol rendering logic when
a map is being rendered as part of an animation.
2022-03-27 15:40:05 +10:00
Nyall Dawson
74db16608e Use map instead of hash 2022-03-25 10:08:11 +10:00
Nyall Dawson
83f88548f2 Add step distance parameter to profile request 2022-03-25 10:08:11 +10:00
Nyall Dawson
f5d9c14ef1 Fix cppcheck warning 2022-03-25 10:08:11 +10:00
Nyall Dawson
e0ae530dee Implement profile generator for mesh layers 2022-03-25 10:08:11 +10:00
Nyall Dawson
87c3c911c0 Implement profile generation for point vector layers 2022-03-25 10:08:11 +10:00
Nyall Dawson
12a65da674 Implement a profile generator for QgsRasterLayers
This class implements an optimised method for generating a profile
from a raster layer in a thread-safe way:

On the main thread:

- The data provider is cloned during preparation, and all other
required properties from the raster layer are copied and stored
for later thread-safe use on a background thread

On the background thread:

- The profile line is transformed to the raster's native CRS
- We then iterate over the portion of the raster which intersects
the profile line's bounding box in small tiles. We use small tiles
here as we will shortcut by skipping straight over any tiles which
don't intersect the profile line at all, without requesting their
raster data at all. Since the profile line will only cover a very
small portion of an overall raster extent, by using small tiles
we end up shortcutting and avoiding the costly tile pixel iteration
for most of the raster's coverage.
- For any tiles which DO intersect the profile curve, we fetch the
tile data and then iterate over the pixels, keeping only those
which actually intersect the profile curve. These pixel centroids
are then transformed back to the original CRS of the profile line.
- After collecting the filtered pixels centroids and their raster
(height) values, we then convert the pixel x/y locations to a
distance/chainage along the profile line, giving us an array of
distance vs height values for all pixels which intersect the profile
line.
2022-03-25 10:08:11 +10:00
Nyall Dawson
200be450f2 Add framework for profile generation
- Adds an abstract base class for profile generators,
QgsAbstractProfileGenerator. This is modeled off the approach
used by map layer renderers, where a QgsAbstractProfileGenerator
subclass object is created in the main thread and does all
required (hopefully inexpensive!) preparation steps necessary
to do on the main thread. Then a separate background thread can
later call the virtual generateProfile method, which does
the heavy lifting of calculating the associated profile. Later
the results of the profile generation can be retrieved back
on the main thread.

- Adds an interface "QgsAbstractProfileSource" for objects which
can create a profile generator given a QgsProfileRequest. Map layer
classes will implement this interface, but potentially 3rd party
(plugin based) objects can also implement the interface if they
also want to add custom results to the profile charts (e.g.
borehole trace lines).
2022-03-25 10:08:11 +10:00
Nyall Dawson
7536cc72c7 Add method to calculate pixel-perfect sub region of a raster 2022-03-25 10:08:11 +10:00
Nyall Dawson
a356469058 Add terrain provider to QgsProfileRequest 2022-03-25 10:08:11 +10:00
Nyall Dawson
b75adafe1c Add equals method to QgsTerrainProvider 2022-03-25 10:08:11 +10:00
Nyall Dawson
0a6dac826f Profile request 2022-03-25 10:08:11 +10:00
Loïc Bartoletti
742c860f9f QgsTriangle: constify isDegenerate method 2022-03-24 06:41:30 +01:00
Nyall Dawson
67c00fc6e5 [feature] Add opt-in setting for projects for "Remember attribute table
windows and docks between sessions"

If checked for a project, then any opened attribute tables will be
saved into the project and immediately restored when loading that
project.

Designed to improve workflows when a user has constructed a project
with a particular set of attribute table configurations for their
requirements, and re-setting up these attribute tables is a hassle.
2022-03-24 15:03:16 +10:00
Nyall Dawson
883d31dbc0 Fix calculation of tile zoom levels for ESRI vector tiles when
map is in a geographic CRS
2022-03-23 14:10:49 +10:00
Nyall Dawson
1b95c0ee21 Add an optional QgsExpressionContext argument to QgsVectorLayer::selectByExpression 2022-03-22 11:18:54 +10:00
Nyall Dawson
793f887dd6 Add method to convert vector renderer legend rule keys to equivalent
QgsExpression filter
2022-03-22 11:18:54 +10:00
Nyall Dawson
02829d5a3e Fix another documentation typo 2022-03-22 10:48:57 +10:00
Nyall Dawson
11c5547cbc Fix documentation warning 2022-03-22 10:48:57 +10:00
Nyall Dawson
618c7f2f73 [feature] Add opt-in setting in project properties for
"Remember editable layer status between sessions"

If checked, then any layers which are editable will be remembered
when saving that project and immediately made editable whenever
the project is restored.

This is an opt-in, per-project setting. The intended use case
is for users who are making complex, data-editing focused projects.
2022-03-22 10:48:57 +10:00
Nyall Dawson
9efe9f512c Change some boolean QgsProject properties to flags instead 2022-03-22 10:48:57 +10:00
NEDJIMAbelgacem
60144d7645 switch to flag based approach for 2D/3D sync 2022-03-21 07:56:39 -07:00
NEDJIMAbelgacem
9141d05d59 - Change extent to trapezoid shape
- Visualize the viewed area using QgsRubberBand
-  Address reviews
2022-03-21 07:56:39 -07:00
Nyall Dawson
5b317e6808 Ignore symbol layer types which do not have colors (raster fill, marker,
etc) when calculating overall symbol colors

Fixes #47723
2022-03-21 17:24:45 +10:00
Nyall Dawson
14952ab6b0 Fix sip build 2022-03-19 05:58:37 +10:00
Nyall Dawson
acdc5d2128 Fix cppcheck warning 2022-03-19 05:58:37 +10:00
Nyall Dawson
52c778f3a0 Remove offset/scale from project elevation properties as these were moved to terrain providers 2022-03-19 05:58:37 +10:00
Nyall Dawson
c19ec553ab Add scale and offset to terrain providers 2022-03-19 05:58:37 +10:00
Nyall Dawson
6e9ecc87e4 Use nan for invalid point height calculation results 2022-03-19 05:58:37 +10:00
Nyall Dawson
5124a583f2 Add clone method for terrain providers 2022-03-19 05:58:37 +10:00
Nyall Dawson
231596cd8d Make terrain provider classes generic and move outside of project 2022-03-19 05:58:37 +10:00