abdullah wrote: ping
Regression on deleting constraints?
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
Regression on deleting constraints?
We had discussed this quite a while ago and I think that Abdullah had it already fixed, but now it is back: When I delete a constraint it seems that a recompute is performed, even if Autoupdate is not checked.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Regression on deleting constraints?
The entire document recomputeds or only the Solver recomputes?
Re: Regression on deleting constraints?
It seems to be the entire document. That can be quite some time. It speeds up, if I disable recomputes.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Regression on deleting constraints?
The recompute is done with git commit f35871f6b95
Re: Regression on deleting constraints?
So I was mistaken: We had discussed it in the forum, but it wasn't fixed.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Regression on deleting constraints?
Any ideas why is the recompute needed at all? I would prefer it OFF.
Re: Regression on deleting constraints?
No idea. The solver works perfect if recompute are manually switched off. Can it be, that simply the check for "Auto update" is missing?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Regression on deleting constraints?
I think it was discussed in the past. No decision was taken. If think that Werner said that most probably we could remove it, but nobody actually checked if it could be or not. Maybe we do not want to break something so closed to the release. I would make a ticket with v.19 as target.
Re: Regression on deleting constraints?
Done: issue #3642. Assigned to Abdullah, target version 0.19.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Regression on deleting constraints?
There are for sure use cases where a recompute() is needed when deleting an object from the document and since the vast majority of commands are implemented that way that the document is up-to-date when invoking them it's probably best to leave this line.
Now the sketcher is something special in several regards and IMO it's best to also handle the Del shortcut in a special way.
You may know the Delete commands of the context-menus of the constraints or elements panels of the sketcher where the connected slot functions do completely different things compared to the general Delete command. The latter tries to cover all eventualities but after all it doesn't know anything about the context where it's used and thus there you always will find a case where it doesn't do what you want.
So, to avoid this kind of problem we should make the sketcher to handle the Del shortcut instead and that the system-wide Delete function won't be invoked if the sketcher is active.
How to implement this:
Whenever you press a shortcut Qt first sends an event of type QEvent::ShortcutOverride and if a recipient claims to handle it Qt then directly sends the QKeyEvent to this recipient. Only if no recipient can be found to handle QEvent::ShortcutOverride Qt triggers the global shortcut.
Since for the sketcher we cannot rely on a certain widget having the focus (sometimes it's one of the task panel and sometimes the 3d view) we could implement a listener class derived from QObject and override its eventFilter method accordingly. This listener object can be added to QApplication (or Gui::MainWindow?) when starting to edit a sketch and removed when finishing to edit it.
Recently I used this trick for the spreadsheet table: git commit ac66048b8b
Now the sketcher is something special in several regards and IMO it's best to also handle the Del shortcut in a special way.
You may know the Delete commands of the context-menus of the constraints or elements panels of the sketcher where the connected slot functions do completely different things compared to the general Delete command. The latter tries to cover all eventualities but after all it doesn't know anything about the context where it's used and thus there you always will find a case where it doesn't do what you want.
So, to avoid this kind of problem we should make the sketcher to handle the Del shortcut instead and that the system-wide Delete function won't be invoked if the sketcher is active.
How to implement this:
Whenever you press a shortcut Qt first sends an event of type QEvent::ShortcutOverride and if a recipient claims to handle it Qt then directly sends the QKeyEvent to this recipient. Only if no recipient can be found to handle QEvent::ShortcutOverride Qt triggers the global shortcut.
Since for the sketcher we cannot rely on a certain widget having the focus (sometimes it's one of the task panel and sometimes the 3d view) we could implement a listener class derived from QObject and override its eventFilter method accordingly. This listener object can be added to QApplication (or Gui::MainWindow?) when starting to edit a sketch and removed when finishing to edit it.
Recently I used this trick for the spreadsheet table: git commit ac66048b8b