From 4438a5c339c9558d526ad021f1a84fc53c9229a9 Mon Sep 17 00:00:00 2001 From: Jean Felder Date: Thu, 13 Feb 2025 17:12:57 +0100 Subject: [PATCH 1/3] qep 322: Point layer edition from the profile tool --- qep-322-profile-tool-point-edition.md | 60 +++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 qep-322-profile-tool-point-edition.md diff --git a/qep-322-profile-tool-point-edition.md b/qep-322-profile-tool-point-edition.md new file mode 100644 index 0000000..b35e76b --- /dev/null +++ b/qep-322-profile-tool-point-edition.md @@ -0,0 +1,60 @@ +# QGIS Enhancement 322: Add support for point layer edition from the profile tool + +**Date** 2025/02/13 + +**Author** Jean Felder (@ptitjano), Jacky Volpes (@Djedouas) + +**Contact** jean dot felder at oslandia dot com, jacky dot volpes at oslandia dot com + +**Version** QGIS 3.44 + +# Summary + +This proposal aims to enable the editing of point layers directly from the elevation profile. It will be possible to add new points, move existing ones, and delete them. Additionally, selecting points from the elevation profile will be possible. Editing directly within the elevation profile will make it easier to precisely adjust the elevation of 3D points. + +## Proposed Solution + +The main challenge of this feature is ensuring that these new functionalities do not conflict with the existing editing options in the main canvas. To make the solution as clear as possible, we propose to: + +- Add a new editing section to the toolbar within the elevation profile panel. +- Display the editing icon for the layer currently selected in the elevation profile tree view. +- Synchronize edition state between the main canvas and the elevation profile: enabling edition on a layer from the elevation profile will activate it in the main canvas, and vice versa. + +Tolerance will not be handled when adding or moving points. This means that the points will always be placed on the profile line. +This editing toolbox will not be enabled if the selected layer is not a point layer. + +The different operations (Add, Delete, Move, Select) will be implemented by creating new tools that inherit from `QgsPlotTool`. + +This branch already contains a rough implementation: https://github.com/ptitjano/QGIS/tree/capture-profile-points + +## Deliverables + +- A new editing toolbox in the profile tool +- Add / Move / Delete / Select points from the profile tool + +### Affected Files + +- src/app/elevation/qgselevationprofilewidget.{h,cpp} +- src/app/elevation/qgselevationprofiletooladdpoint.{h,cpp} (new files) +- src/app/elevation/qgselevationprofiletoolmovepoint.{h,cpp} (new files) +- src/app/elevation/qgselevationprofiletoolselectfeatures.{h,cpp} (new files) +- src/core/elevation/qgsprofilerenderer.cpp +- src/core/layout/qgslayoutitemelevationprofile.cpp +- src/gui/elevation/qgselevationprofilelayertreeview.cpp +- src/gui/elevation/qgselevationprofilecanvas.cpp +- src/gui/plot/qgsplotrubberband.{h,cpp} (new files) + +## Risks + +Increased complexity and maintenance burden in the profile tool code. + +## Performance Implications + +N/A + +## Backwards Compatibility + +Not Applicable. + + +Funded by: BRGM From 12edabc4bab451cd4a79b987a818ce38de5feeb1 Mon Sep 17 00:00:00 2001 From: Jean Felder Date: Fri, 14 Feb 2025 09:04:09 +0100 Subject: [PATCH 2/3] qep322: Selection is synchronized --- qep-322-profile-tool-point-edition.md | 1 + 1 file changed, 1 insertion(+) diff --git a/qep-322-profile-tool-point-edition.md b/qep-322-profile-tool-point-edition.md index b35e76b..0233f28 100644 --- a/qep-322-profile-tool-point-edition.md +++ b/qep-322-profile-tool-point-edition.md @@ -19,6 +19,7 @@ The main challenge of this feature is ensuring that these new functionalities do - Add a new editing section to the toolbar within the elevation profile panel. - Display the editing icon for the layer currently selected in the elevation profile tree view. - Synchronize edition state between the main canvas and the elevation profile: enabling edition on a layer from the elevation profile will activate it in the main canvas, and vice versa. +- Synchronize selection: it is the same between the elevation plots and the main layer. Tolerance will not be handled when adding or moving points. This means that the points will always be placed on the profile line. This editing toolbox will not be enabled if the selected layer is not a point layer. From fc462dba636e39d1c34aa794f62854c07b7a1163 Mon Sep 17 00:00:00 2001 From: Jean Felder Date: Fri, 14 Feb 2025 09:07:55 +0100 Subject: [PATCH 3/3] qep322: Explain the different workflows --- qep-322-profile-tool-point-edition.md | 29 ++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/qep-322-profile-tool-point-edition.md b/qep-322-profile-tool-point-edition.md index 0233f28..e58e619 100644 --- a/qep-322-profile-tool-point-edition.md +++ b/qep-322-profile-tool-point-edition.md @@ -21,18 +21,41 @@ The main challenge of this feature is ensuring that these new functionalities do - Synchronize edition state between the main canvas and the elevation profile: enabling edition on a layer from the elevation profile will activate it in the main canvas, and vice versa. - Synchronize selection: it is the same between the elevation plots and the main layer. -Tolerance will not be handled when adding or moving points. This means that the points will always be placed on the profile line. +The different operations (Add, Delete, Move, Select) will be implemented by creating new tools that inherit from `QgsPlotTool`. + This editing toolbox will not be enabled if the selected layer is not a point layer. -The different operations (Add, Delete, Move, Select) will be implemented by creating new tools that inherit from `QgsPlotTool`. +### Selection -This branch already contains a rough implementation: https://github.com/ptitjano/QGIS/tree/capture-profile-points +Select features by clicking on them or with a rectangle selection. keyboard modifiers will allow to select points more precisely: + + - Shift to add to current selection + - Control to remove from current selection + +### Add features + +In editing mode, activate it by clicking the "Add Point Feature" button in the elevation profile panel. then click on the elevation profile to add a new point. If necessary, the attribute form will immediately open. Snapping will be handled. + +### Move features + +In editing mode, activate it by clicking the "Move Points Feature" button in the elevation profile panel. Select a point by clicking on it and then click on its new location. Moving points will have a special "lock abscissa" keyboard modifier to avoid changing x/y coordinate while moving. It will also handle snapping. + +### Delete features + +Deletion of features will work on selection. First, select features by clicking on them or using a rectangle selection. Then delete them by clicking the "Delete Features" button from the elevation profile toolbar. + +### Tolerance + + - added points will be placed on the profile line + - points can be picked/selected in the tolerance zone to be moved or deleted but moved points are reprojected on the profile line (x/y are changed when z is moved) ## Deliverables - A new editing toolbox in the profile tool - Add / Move / Delete / Select points from the profile tool +This branch already contains a rough implementation: https://github.com/ptitjano/QGIS/tree/capture-profile-points + ### Affected Files - src/app/elevation/qgselevationprofilewidget.{h,cpp}