Commit Graph

13 Commits

Author SHA1 Message Date
Roy-043
dd3ae90fe7 Draft: task_scale.py fix circular imports (#19574)
See:
https://forum.freecad.org/viewtopic.php?t=94748
2025-02-13 16:02:24 +01:00
Roy-043
c88b44f0da Draft: Introduce Edit option for Draft Clone scaling
Fixes #13324.

The Edit option is available from the Tree view context menu, but you can also double-click the clone in the Tree view.

The task panel is based on that of the Draft Scale command. The "Uniform scaling" checkbox is (un)checked depending on the current scaling of the clone.
2025-02-08 11:22:20 +01:00
Roy-043
d587e6a91a Draft: make move, rotate and scale commands link-aware (#18795)
* 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
2025-01-20 18:23:36 +01:00
Roy-043
89bca1ee93 Merge pull request #12111 from 3x380V/draft_wb_qt6
Draft: Qt6 fixes
2024-01-31 11:31:38 +01:00
Ladislav Michl
05b0f35655 Draft: Use widgets from QtWidgets 2024-01-25 14:27:38 +01:00
Roy-043
520b8babda Draft: Draft_Scale: make sure scale inputboxes show at least 6 decimals
Fixes #7386.
2024-01-23 18:07:03 +01:00
Roy-043
12444a1d6b Draft: implement new get_param functions (step 3)
See #11677
2023-12-12 20:20:03 +01:00
Roy
c81ce5dea1 Draft: fix task panel related issues
This PR fixes several task panel related issues for Draft modifier commands.
2022-01-15 18:23:05 +01:00
Chris Hennes
3f5fbef881 [Draft] Fix bug in data entry on scale w/ uniform
When entering a scale factor, if uniform scaling is on, the current code
keeps appending zeroes as you type, forcing you to delete them before
entering your next digit. This commit fixes that by ensuring that the
widget that you are currently editing is not updated continuously.

Fixes #0004601
2021-03-23 14:18:19 -05:00
JAndersM
8620d77bc0 Update task_scale.py
The changes solves the Ticket #3691 - Bug in draft scale. Only integers work
2020-12-07 19:51:29 +01:00
vocx-fc
d70a194dc7 Draft: add modules of drafttaskpanels to the proper Doxygen group
This includes `task_circulararray`, `task_orthoarray`,
`task_polararray`, `task_scale`, `task_selectplane`,
`task_shapestring`.

These are added to the `drafttaskpanels` Doxygen group
so that the functions and classes contained in each module
are listed appropriately in the automatically generated
documentation.
2020-07-17 13:01:45 +02:00
vocx-fc
67dca69d60 Draft: task_scale, small style improvements 2020-04-02 16:53:49 +02:00
vocx-fc
7bc2e3ad48 Draft: move ScaleTaskPanel to a module
We remove it from `DraftGui.py` to reduce the size of this file.
Then we import it and tie it to its command defined
in `DraftTools.py`.
2020-04-02 16:53:49 +02:00