Accessing the parameter manager inside ~CurveConverter() is undefined behaviour because it will be accessed after the main() function
has been exited.
Fixes#13622
=================================================================
Instead of terminating the handler, as mandated before this PR by ViewProviderSketch, ViewProviderSketch
delegates the action to DrawSketchHandler.
DrawSketchHandler implements by default this terminating behaviour, but allows to override it.
DrawSketchDefaultHandler (and all tools deriving from it) implement as default behaviour to cancel if
in initial state, otherwise to reset.
===========================================================
Instead of terminating the handler, as mandated before this PR by ViewProviderSketch, ViewProviderSketch
delegates the action to DrawSketchHandler.
DrawSketchHandler implements by default this terminating behaviour, but allows to override it.
DrawSketchDefaultHandler (and all tools deriving from it) implement as default behaviour to cancel if
in initial state, otherwise to reset.
===============================================
Sets the full interface between the DrawSketchHandler and a tool widget available somewhere in the UI.
Signalling is as follows:
1. On activation of the tool, DrawSketchHandler notifies the tool widget.
2. The tool widget retrieves tool information necessary for representation (type of widget, visibility, ...)
3. When the tool widget has created an appropriate widget, it notifies back a widget change.
4. The tool receives the widget handler and can now configure and interact with the widget.
=================================================================
When in Sketcher edit mode, a tool button is activated, while the view has been changing to view of a different type, it segfaults.
This commit checks the pointer of the view to ensure correct type before activation, and refusing to activate if not of the correct type.
fixes#10809
===============================================
Revisiting all console calls:
- Using the Notification Framework when the user needs to be notified
- Turning them into DeveloperError/DeveloperWarnings when messages are intended only for developers
=====================================================
Extension of the framework to draw an arbitrary curve in draw sketch handlers, so that
a plurality of curves can be handled.
DrawSketchHandler is extended to additionally offer drawing several curves:
- void drawEdit(const std::list<std::vector<Base::Vector2d>> &list);
- void drawEdit(const std::vector<Part::Geometry *> &geometries);
A new class, CurveConverter, enables to convert individual Part::Geometry or vectors of them
to appropriate vectors or list of vectors of Vector2d representing the curves. This can be
used in a specific DrawSketchHandler to combine Part::Geometries and arbritary curves.
Preselection is sometimes not updated under some circumstances
1. when deleting an object through python;
2. before autoconstraint when deleting previous pole in bspline creation mode.
When the preselected curve is the deleted object, segfault/crash can happen.
==============================================================
With the introduction of overridable default behaviour for commands, it makes sense to keep control of the execution path of the activation and deactivation.
Non-virtual interface pattern enforces execution control of the virtual functions, while allowing the behaviour to be overriden in a case by case basis.