-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exiting edit mode withouth saving triggers a "geometryChanged" event for each removed vertex #16800
Comments
Author Name: Sandro Santilli (@strk) I verified that saving the edit does not call geometryChanged so many times |
Author Name: Sandro Santilli (@strk) Under gdb I can also see that a thread is started for each vertex !! This is serious performance loss |
Author Name: Sandro Santilli (@strk) The origin seems to be this one:
|
Author Name: Sandro Santilli (@strk) And:
|
Author Name: Sandro Santilli (@strk) I believe the problem is the undo stack as QgsVectorLayerEditUtils only exposes a function to delete a single vertex so it makes a geometry clone for each removed vertex and rolls back one vertex at the time. It would be much much better to expose a "mass vertexes removal" kind of interface, to make it an atomic operation. Seems to be a work for Martin Dobias :) |
Author Name: Jürgen Fischer (@jef-n) Sandro Santilli wrote:
Um, isn't that already in place? The undo stack should contain only one entry for "Delete vertices" for each time you hit "delete". Multiple deletes shouldn't be accumulated as they should still be separately undoable. |
Author Name: Sandro Santilli (@strk) Evidently not, "delete vertices" is not even supported by the utility class used to keep track of undo stack (AFAIU): |
Author Name: Sandro Santilli (@strk) Note that the nodeTool contains an hack to avoid multiple "geometryChanged" events by simply disconnecting the hook, deleting each vertex in turn and re-connecting the event, but the method invoked for deleting the single vertex is the one that seems to be filling up the undo stack, with as many geometry copies as vertexes selected. Which explains the fast memory growth for a big geometry (>45k vertexes). |
Author Name: Jürgen Fischer (@jef-n)
|
Author Name: Jürgen Fischer (@jef-n) Fixed in changeset "59788cb8fcbe86a71397c3046981d00f06c40b00".
|
Author Name: Sandro Santilli (@strk) Great job, the memory issue is also fixed by this! |
Author Name: Sandro Santilli (@strk) Only, it may be better to comment out the "geometry changes merged" debug line as getting tens of thousand of lines when mass-removing vertices kills CPU ;) |
Author Name: Sandro Santilli (@strk)
Original Redmine Issue: 7929
Affected QGIS version: master
Redmine category:digitising
Assignee: Jürgen Fischer
When exiting edit mode without saving, the "undo" operation triggers a call to "geometryChanged" for every vertex that was deleted during editing.
Related issue(s): #16772 (relates)
Redmine related issue(s): 7900
The text was updated successfully, but these errors were encountered: