75792 Commits

Author SHA1 Message Date
Antoine
5a0479f852 modify QgsMapToolAddFeature constructor 2022-02-22 10:17:53 +01:00
Antoine
e0e9600857 static default Z/M value methods 2022-02-22 08:52:54 +01:00
Antoine
2cf8189f89 Disable Z interpolation in some cases fix #46128 2022-02-22 08:52:54 +01:00
Antoine
c3df08492d fix advanced digitizing distance when snapping 2022-02-22 08:52:53 +01:00
Denis Rouzaud
36a1019582
refactoring of QgsMapToolCapture to integrate shape map tools (#46687)
* make QgsMapToolCapture capable of capturing point/line/polygons

This moves part of the code from QgsMapToolDigitizeFeature to QgsMapToolCapture so the tool can actually capture point, line and polygons. It's mainly the 'cadCanvasReleaseEvent` which has been transfered.

* use a current CaptureTechnique in QgsMapToolCapture

QgisApp has been adapted to switch between the different techniques

* add point/line/polygon specific handlers for capture map tool

* convert add part map tool to use QgsMapToolCapture capabilities

* fix use of deprecated methods

* also create a virtual handler for QgsMapToolDigitizeFeature::featureDigitized

* more dox

* use const abstract geom in virtual handlers

* add new class QgsMapToolCaptureLayerGeometry to handle layer specific operation in capture map tool

such as avoiding intersections

* allow to add linear geometries on curved geometry layers

* make actions exclusive

* add settings registry to app

* add a registry for shape map tools

* abstract class for shape map tools

* adapt QgsMapToolCapture to correctly support shape map tools

* clean up of QgisApp

* new class QgsMapToolsDigitizingTechniqueManager to handle actions in app related to capture map tools

* clean up QgisInterface

* sipify

* refactoring of existing shape tools

* refactor add ring to fully support capture map tool

* add missing folder to Doxygen

* fix layout

* fix erasing at iterator pos

* fix unused warning

* fix more dox

* fix cpp check warning

* fix unused warning

* fix annotation map tool does not support shape + set tool name

* correctly handle case when the capture is not done on a vector layer (annotation, mesh, …)

* enable shapes in annotation map tool

* correctly undo and clean

* adapt existing shape tests

the deletion test with circular vertices has been dropped since the capture map tool behaves differently

* fix warning

* refactor fill ring to support shape digitizing

* fix win build

* fix more tests

* avoid detach warnings

* fix app test + clean up

* harmonize new settings with existing ones

* fix categories

* support adding multi lines as a part

* fix adding curve part to multi line

* also handle points

* code a bit clearer

* cast not always valid

* allow adding curved polygon to multipolygon

* add test for QgsGeometry::addPart with curved parts on non-curved geoms (lines and polygons)

* fix with Python < 3.9

* better dox for deprecated interface actions methods

* remove files leftover

* remove leftover circular string curve point tool

* add default Z/M values when calling QgsGeometry::coerceToType

* Apply suggestions from code review

Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>

* fixes from review

* move layer specific part to specific tool

* fix typo

* fix leak

* fix dox

* fix segmentization

* call map tool implementation of addCurve when adding trace curve to avoid point duplication

* call sub-class implementation

* fix since 3.24 -> 3.26

* fix test

* add test to avoid extra curves when using tracing

* fix headers

Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
2022-02-22 07:59:50 +01:00
Denis Rouzaud
4185783e63 fix headers 2022-02-22 07:46:21 +01:00
Denis Rouzaud
f7cf0f5db8 add test to avoid extra curves when using tracing 2022-02-21 17:25:11 +01:00
Denis Rouzaud
68702f11b5 fix test 2022-02-21 17:25:00 +01:00
Denis Rouzaud
efcf169a09 fix since 3.24 -> 3.26 2022-02-21 17:05:13 +01:00
Denis Rouzaud
d8c6574e39 call sub-class implementation 2022-02-21 17:00:50 +01:00
Denis Rouzaud
b827f3492e call map tool implementation of addCurve when adding trace curve to avoid point duplication 2022-02-21 17:00:50 +01:00
Denis Rouzaud
002fd4bdce fix segmentization 2022-02-21 17:00:50 +01:00
Denis Rouzaud
8fbd474e1a fix dox 2022-02-21 11:18:04 +01:00
Denis Rouzaud
3cccf4fc0c fix leak 2022-02-21 10:33:26 +01:00
Denis Rouzaud
4f87cee0a0 fix typo 2022-02-21 10:33:26 +01:00
Denis Rouzaud
49b5926570 move layer specific part to specific tool 2022-02-21 10:33:26 +01:00
Denis Rouzaud
e9fc54c0bd fixes from review 2022-02-21 09:45:27 +01:00
Julien Cabieces
2d2cd13c58
Merge pull request #47392 from signedav/fix_relref_nomodal
Avoid modal dialogs in relation reference /  relation editor
2022-02-21 09:10:49 +01:00
Denis Rouzaud
7b86867cfa Apply suggestions from code review
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
2022-02-21 08:46:26 +01:00
Nyall Dawson
914dccbd5b Allow access to feature geometry in generator subsymbols via
geometry($currentfeature)

When used in a geometry generator subsymbol, the expression

    geometry($currentfeature)

should refer to the original feature's geometry, not the geometry
generated by the generator symbol (which is accessible through
$geometry)

Fixes #46455
2022-02-21 13:04:07 +10:00
Nyall Dawson
84f3b42861 The $geometry function should return the expression context's geometry
IF it has been explicitly set, not the context's feature's geometry

Refs #46455
2022-02-21 13:04:07 +10:00
Nyall Dawson
11a8d40a86 Allow geometries to be set separate to features in expression contexts
Refs #46455 -- we need a way to separate these too, as we don't always
want $geometry to refer to a feature's geometry
2022-02-21 13:04:07 +10:00
nirvn
a8eaf46995 Apply same group<->ELSE behavior to the {3D,labeling} ruling based renderer 2022-02-21 11:19:58 +10:00
nirvn
002cfb0375 Add test case covering fix 2022-02-21 11:19:58 +10:00
Nyall Dawson
7a27ff6dc6 Fix disabled children in a rule without a symbol incorrectly result in features rendered by parent level ELSE rule 2022-02-21 11:19:58 +10:00
Sandro Santilli
affa44e41e Use read-only connection when writing is not needed 2022-02-21 09:13:20 +10:00
nirvn
4324a2a8b5 [auxiliary storage] Avoid needless spatialite database connection 2022-02-21 09:08:22 +10:00
Alessandro Pasotti
2f9dd9a66f Fix NULL HTML edit widget
Fix #47363
2022-02-21 08:38:36 +10:00
Nyall Dawson
e73f5bccac Fix test 2022-02-20 06:48:03 +10:00
Nyall Dawson
37b56f376d Fix dox 2022-02-20 06:48:03 +10:00
Nyall Dawson
6c1ca4d2fd Minor tweaks 2022-02-20 06:48:03 +10:00
Nyall Dawson
d06fb3dd11 [feature] Allow creation of new field domains through right click
menu on gpkg items in browser

Allows users to create new range, coded value or glob field domains
2022-02-20 06:48:03 +10:00
Nyall Dawson
dfac7df6fa Fix error retrieval 2022-02-20 06:48:03 +10:00
Nyall Dawson
118b3d32c1 Create QgsFieldDomainDialog dialog for configuring a field domain 2022-02-20 06:48:03 +10:00
Nyall Dawson
9c4bcf0092 Add widgets for creation of field domains 2022-02-20 06:48:03 +10:00
Nyall Dawson
37de21e506 Fix build on older gdal 2022-02-20 06:48:03 +10:00
Nyall Dawson
a6ec4acf21 Fix documentation warning 2022-02-20 06:48:03 +10:00
Nyall Dawson
a06fcde895 Add action to unset an existing field domain 2022-02-20 06:48:03 +10:00
Nyall Dawson
c264eb50f5 Clarify removal 2022-02-20 06:48:03 +10:00
Nyall Dawson
7273b4d2d7 Fix state of browser properties splitter section is not correctly
saved/restored
2022-02-20 06:48:03 +10:00
Nyall Dawson
6e350be9c3 Refresh fields item when a field has a domain set for it 2022-02-20 06:48:03 +10:00
Nyall Dawson
3332b27edd QgsFieldItem is only equal when the QgsField is also equal
Otherwise the field item will not be updated when the gpkg parent
item is refreshed and the field definition has changed (e.g.
the field type)
2022-02-20 06:48:03 +10:00
Nyall Dawson
51889b2248 When a gpkg item is refreshed in the browser, also refresh
the fields and field domains children

Otherwise the fields we show will not be correctly updated
when the gpkg item itself is refreshed
2022-02-20 06:48:03 +10:00
Nyall Dawson
f8bbcab8bb Add flag for browser data item to indicate that children of the item
must be refreshed whenever the item is refreshed

This behaviour is not automatic. The new flag allows items to opt-in,
so that their children WILL be automatically refreshed when the
item is refreshed.

Should be used sparingly only to avoid expensive work
2022-02-20 06:48:03 +10:00
Nyall Dawson
886df44376 [feature] Show "Set Field Domain" action when right clicking
a field in the browser for a Geopackage table

Allows users to set the field domain associated with that field
2022-02-20 06:48:03 +10:00
Nyall Dawson
063e059359 Add API to QgsAbstractDatabaseProviderConnection to create new field
domains on a database and set field domain associated with a field

And implement for OGR database provider connection class
2022-02-20 06:48:03 +10:00
Nyall Dawson
7db84789f8 Add method to convert QgsFieldDomain to OGR field domain 2022-02-20 06:48:03 +10:00
Nyall Dawson
44844bc736 Add method to convert QVariant to OGRField 2022-02-20 06:48:03 +10:00
Nyall Dawson
eaba5b3efd Add method to convert QVariant type to OGR field type 2022-02-20 06:48:03 +10:00
Nyall Dawson
4a7fb87af5 [feature] Add browser properties page for field and fields items
In particular, this allows users to easily see what field domain
may be attached to particular fields
2022-02-20 06:48:03 +10:00