* Draft: make move, rotate and scale commands link-aware
Fixes#12836.
Fixes#15681.
These changes are presented as a single ('big') PR because the mentioned commands have several similarities. Working on them seperately would have made less sense.
The commands have been made 'link-aware' meaning they can now handle Links and objects in linked containers.
This required several changes in the following main files. For each command all options are handled by a single function now (the `move`, `rotate` and `scale` functions). This was the only reasonable solution to correctly handle nested placements. As a result there is no longer a need to build very complex 'cmd' strings in the gui_*.py files (which is a good thing IMO).
Main files:
* move.py
* rotate.py
* scale.py
* gui_move.py
* gui_rotate.py
* gui_scale.py
* gui_trackers.py
The following files have also been updated:
* Draft.py: Imports updated.
* DraftGui.py: If `CopyMode` is changed the ghosts have to be updated. The move and rotate commands now also show previews of movable children. But since those are not copied they should be removed from the ghosts if `CopyMode` is changed to `True`.
* utils.py: Some helper functions have been added. An existing helper function (only used internally) has been renamed.
* gui_utils.py: The `select` function has been updated to accept a list of tuples to allow the reselection of nested objects.
* clone.py: A new property `ForceCompound`, necessary for non-uniform scaling, has been added.
* join.py: The `join_wires` function now returns the resultant wire objects.
* task_scale.py: Updated to allow negative scale factors. Support for `SubelementMode` preference added.
* dimension.py: `transform` methods added.
* layer.py: `get_layer` function added.
* svg.py: Updated to use `get_layer`.
* view_text.py: Instead of two added `coin.SoTransform()` nodes the main transform node is used instead. This was done so that ghosts of Draft Texts can be handled properly without requiring dedicated code in gui_trackers.py.
Notes:
* Support for "App::Annotation" is limited. Only their `Position` is handled (by the move and rotate commands).
* Support for "Image::ImagePlane" has been removed from the scale command. The object has its own calibrate feature (see https://wiki.freecad.org/Std_Import).
* Copies and clones are always created in the global space.
* Fix several unit test issues.
* Reset value that was changed while testing
* Rebase and update test_modification.py
* Reintroduce scaling of image planes
* Sketcher mapping error fix
Fixed an issue in the Sketcher where attempting to create a sketch while a group is selected caused a mapping error. Now, when a sketch is created with a group selected, the sketch will be placed inside the group.
* Update to use new templated countObjectsOfType
This commit updates the code to use the new templated version of countObjectsOfType, aligning with recent changes in the main branch.
---------
Co-authored-by: Joona <jookkone@edu.lapinamk.fi>
* Macros: Save last used debugger
Typically users use the same debugger repeatedly. The current dialog
required users to change tabs each time the debugger is launched. This
change saves the last used debugger tab and sets that as the selected
tab when relaunching the debugger.
* Save VSCode address and port
B-spline faces can be avoided if the absolute values of the scaling factors are the same. The `transformShape` method can handle this if two additional arguments are provided.
This should be a `protected` or `private` operation since it doesn't handle
constraints. However, this is intended to be used by external classes that
modify a `SketchObject` (instead of these modifications like `split`, `trim`,
`join` etc. being methods of `SketchObject`). In that case, it may be best to
use the `friend` keyword.
Fixes fails at cases where one (or both) of the remaining segments is (are)
degenerate. This existed pre-refactor.
Fixes cases where there are some constraints on internal geometry that do not
get deleted cleanly.
Also fixes a memory leak.