21398 Commits

Author SHA1 Message Date
Nyall Dawson
05bd566089 Modify text renderer to account for rendering text with HTML
content which varies in font metrics
2022-09-07 22:09:52 +10:00
Nyall Dawson
5f2aca49af Correctly account for scaling factor and render context scale
when creating fonts for document fragments
2022-09-07 22:09:52 +10:00
Nyall Dawson
ad5d9d89f5 Add font size, family, italic and bold to QgsTextCharacterFormat 2022-09-07 22:09:52 +10:00
Nyall Dawson
b4c9378625 Move text renderer enums to Qgis, promote to enum class, tighten includes 2022-09-06 15:30:00 +10:00
uclaros
1a7d160a50 add export to CSV files 2022-09-06 09:57:54 +10:00
Nyall Dawson
ed9dfa9f5a Move TextOrientation enum from QgsTextFormat and promote to enum class 2022-09-05 17:17:18 +10:00
Nyall Dawson
775e333ec3 [feature][labeling] Add option to use absolute units for line height
Previously the line height was always set in multiples of the
text line spacing. This works fine for rendering text blocks
containing text of all the same sizes, but when we mix
text sizes in the one document then the relative line height
option doesn't cover all use cases. (e.g. when a constant
spacing between lines is desired even when the text on those
lines varies in height)
2022-09-05 13:17:33 +10:00
Nyall Dawson
804951ea26 [api] Expose GEOS make valid options for geos 3.10+ builds 2022-09-05 12:35:53 +10:00
Mathieu Pellerin
6b071d3be5 Apply suggestions 2022-09-05 11:18:38 +10:00
Mathieu Pellerin
2dae176bf5 Add missing dox 2022-09-05 11:18:38 +10:00
Mathieu Pellerin
b20cc301e7 Implement MapGeographic vs CustomCrs 2022-09-05 11:18:38 +10:00
Mathieu Pellerin
1570643d1d [api] Add project's default coordinate display type functions +
Q_PROPERTY for coordinate display type, distance units, and area units
2022-09-05 11:18:38 +10:00
Matthias Kuhn
84cffdaace
Merge pull request #50027 from Samweli/hide_expression_variables 2022-09-04 14:54:32 +02:00
Samweli
bdfd670403 include docstrings for the use of the hidden variables 2022-09-04 12:19:48 +02:00
Hannes
cb914be6f3 Fix PEP8 E266 for second level heading comment 2022-09-04 06:05:10 +10:00
Hannes
ccb46e79d8 Python Console: Don't throw exception if compiled without 3D
Fixes #49987
2022-09-04 06:05:10 +10:00
uclaros
fe22b4c7f5 address review 2022-09-02 14:28:07 -07:00
uclaros
cf7137d218 use enum for supported formats 2022-09-02 14:28:07 -07:00
uclaros
3c426b274f also export to uncompressed las files 2022-09-02 14:28:07 -07:00
uclaros
4c39f178ad added filter by geometry / filter by layer support 2022-09-02 14:28:07 -07:00
Martin Dobias
e6da9ac607 Bring back some Python methods to make the test in Python work again 2022-09-02 07:52:22 -07:00
Martin Dobias
ec36709bfe Address reviews from Stefanos and Nyall 2022-09-02 07:52:22 -07:00
Martin Dobias
fc41309ee2 Add tests for QgsElevationMap and for EDL of 2D point cloud rendering 2022-09-02 07:52:22 -07:00
Martin Dobias
5947177e77 Disable copying of QgsElevationMap 2022-09-02 07:52:22 -07:00
Martin Dobias
a9739a2246 Better encoding of elevation values 2022-09-02 07:52:22 -07:00
Martin Dobias
18ba28b39e Fix sip 2022-09-02 07:52:22 -07:00
Martin Dobias
18b3bdd139 Refactor elevation map related code to a new class QgsElevationMap 2022-09-02 07:52:22 -07:00
Martin Dobias
8f933496b6 Eye dome lighting code fixes
- make it independent on the current view's Z range
- simplify scaling code
- reverse Z handling (higher Z value == closer to "camera")
- remove unused API functions and member variables
2022-09-02 07:52:22 -07:00
NEDJIMAbelgacem
83cf5fab0b fix layout tests 2022-09-02 07:52:22 -07:00
NEDJIMAbelgacem
789a83cd37 address reviews and fix docs 2022-09-02 07:52:22 -07:00
NEDJIMAbelgacem
5b6ba3e80a Revert to RGBA elevation 2022-09-02 07:52:22 -07:00
NEDJIMAbelgacem
3eedcf0d8f address reviews 2022-09-02 07:52:22 -07:00
NEDJIMAbelgacem
5ccb83b5c6 switch to using grayscale image and fix the default draw order rendering 2022-09-02 07:52:22 -07:00
NEDJIMAbelgacem
f4830334cf initial implementation 2022-09-02 07:52:22 -07:00
Alessandro Pasotti
0c577f07ba
Merge pull request #50015 from elpaso/layer-metadata-provider
Layer metadata provider API (part 1)
2022-09-01 13:58:22 +02:00
Alessandro Pasotti
eb76172122 Raise proper exceptions from search 2022-09-01 11:32:13 +02:00
Alessandro Pasotti
fa55567ecf Rename QgsLayerMetadataSearchResults 2022-09-01 08:21:15 +02:00
Loïc Bartoletti
80e7ba354a
Add Concave hull API and expression function
Exposes the GEOS concave hull operation to QgsGeometry API and a via a new concave_hull expression function.

Requires GEOS 3.11+
2022-09-01 02:58:35 +00:00
vcloarec
1ce710a0c3 Sipify 2022-08-31 22:40:45 -04:00
Nyall Dawson
2aa753cb72 Typo 2022-09-01 08:55:08 +10:00
Alessandro Pasotti
b87ae9053f Refactoring after PR review 2022-08-31 18:57:04 +02:00
Alessandro Pasotti
62c8b55ab4 Moved QgsLayerMetadataProviderResult to QgsLayerMetadata inheritance 2022-08-31 18:53:12 +02:00
Alessandro Pasotti
35403d507f Layer metadata provider API
Implementation of QEP #250 DB metadata storage.

- General API for registering layer metadata providers
- Metadata provider GPKG
- Metadata provider POSTGRES
- Metadata provider POSTGRES RASTER

Tests and custom python metadata provider implementation.

No GUI.

Funded by: ARPA Piemonte
2022-08-31 18:53:12 +02:00
Stefanos Natsis
fb97c10d00
Export pointcloud layers (#49280)
* PointCloudLayerExporter class

* set points limit

* saveas dialog

* qickndirty task

* wip

* add pdal files

* transform context

* add getters

* try to use some subclasses

* use nested classes

* don't default layername

* limit supported formats

* error reporting

* limit formats in gui too

* format filters and source/target crs

* use default infinite extent

* set pdal crs

* add pdrf but keep 3 for now

* properly handle LAZ attributes

* catch coordinate transform exceptions

* use default destructor, fix leak, docs

* trim includes, fix typos

* use qgsspinboxes, add points limit to the gui

* fix limit exporting logic

* avoid auto

* fix builds

* don't reuse lastVectorFormat setting

* Rework layer name handling

* Rage against the elevation

* invert attribute activation logic

* use wkt for laz srs

* use original offset/scale if not reprojecting

* move created memory layer to main thread when done

* allways add memory layer to map

* oops

* properly handle existing vector files

* don't add layer if cancelled

* create the memory layer on the main thread

* remove colon

* remove duplicate code and avoid crashing on mesh and vectortiles

* fix leak

* handle case blunder

* address review
2022-08-31 15:46:16 +02:00
Martin Dobias
91100f816b
[3d] Ambient Occlusion (reworked) (#49702)
* Initial implementation

* - Add disabling of blur pass
- Change default parameter for shading factor
- fix some tests

* - Implement bilateral filtering
- Optimize textures
- Fix layout test

* rename SSAO to ambient occlusion
fix ssao settings widget margin

* Remove unused variable

* fix naming and add tooltips

* - Refactor quad entities
- Address Stefanos's suggestions

* Rework SSAO implementation

Previously we based the code on CloudCompare's implementation,
however that did not work too well for us for a couple of reasons:
- the code does not deal well with perspective projection, causing incorrect shading (CC uses orthographic projection)
- there was no range check, so we would be getting false ambient occlusion on larger depth discontinuities (silhouttes)
- banding artifacts as the sampling kernel was not getting rotated
- parameters (shading radius, distance attenuation) that are difficult to understand

The new implementation is based on John Chapman's tutorial and LearnOpenGL page (derived from the original tutorial):
https://john-chapman-graphics.blogspot.com/2013/01/ssao-tutorial.html
https://learnopengl.com/Advanced-Lighting/SSAO

The general approach of the SSAO is the following:
- for each pixel, we pick a couple of random points nearby (64 samples currently)
  and check with the depth buffer whether they are visible from the camera or not.
  The nearby points that are occluded contribute to darkening of the pixel,
  this is saved to a texture
- in the next rendering pass, we blur the texture using 4x4 box. This is because
  in the first step we use 4x4 random noise pattern and it leaves a noticeable noise
  pattern on the screen. This pass gets rid of that noise
- in the post-processing step, the blurred texture is blended with the rendered scene

There are few differences to J.C.'s tutorial and LearnOpenGL page:
- the approches above use normal maps (a texture with a normal vector for each pixel),
  but we don't because we also want to support point clouds that do not have normals
  (at least not by default)
- we use full sphere for sampling instead of hemisphere (which is possible when you
  have normals), so maybe we are getting a bit lower quality / performance
- LearnOpenGL also uses a texture with positions of all pixels - we only use depth map
  to get the original positions (like JC's original code does)

* Clean up ssao parameters and GUI, add intensity parameter

* Add missing Q_OBJECT macro

* Add more missing Q_OBJECT macros

* Add occlusion threshold parameter to control the darkening

With the default threshold of 50%, pixels only start to get darker
when more than half of the neighborhood samples are occluded. That
means flat surfaces should not get any darker. (What we had previously
is an equivalent of having threshold set at 0%)

The downside is that with increased threshold, more subtle occlusions get lost.

* Review from Stefanos

* More review and better defaults

* Clear button fix

Co-authored-by: NEDJIMAbelgacem <gb_nedjima@esi.dz>
2022-08-31 16:36:14 +03:00
Samweli
df3b3d122e Added new logic for handling hiding of expression variables, this will help to have a clear way of not showing variables that are not needed anymore but they can break past QGIS projects if they are removed. 2022-08-31 10:42:01 +02:00
Hannes
e9b90b565b
[ui] Ask user before closing expression dialog if expression was edited 2022-08-31 08:14:55 +10:00
Mathieu Pellerin
b7e31d4508
[feature][ui] Add a Show in Attribute Table action to the right click menu of legend class symbols (#49984) 2022-08-29 10:18:06 +00:00
Germán Carrillo
ca179c55d2 [processing] Add generic option to show feature count for processing vector outputs (fix #39522) 2022-08-28 20:08:28 +10:00
Nyall Dawson
73692a6a41 Create QgsProviderSqlQueryBuilder
QgsProviderSqlQueryBuilder provides an interface for creation of SQL queries, which
can be overridden for backend provider specific SQL syntax.

Initially add a virtual method for creation of row limited select *
queries.
2022-08-28 15:37:15 +10:00