Commit Graph

68 Commits

Author SHA1 Message Date
Roy-043
3ade7f7899 Draft: Remove relative to WP option from Draft_Scale (#23716)
* Draft: Remove relative to WP option from Draft_Scale

* Draft: Remove relative to WP option from Draft_Scale
2025-09-08 14:38:38 +02:00
Roy-043
457c57f9ad Draft: Implement hints for creation tools (#23244)
* Draft: Implement hints for creation tools

Fixes: #22886
Related: #22298

This PR implements hints for the tools in the Draft Creation toolbar.

* Fix confusing indentation

* Fix typo in comment
2025-08-25 19:42:59 +02:00
Roy-043
5f322c9626 Draft: task_orthoarray.py make some strings translatable 2025-08-25 11:31:50 +02:00
Max Wilfinger
ab5e9e0ded Fix source string mistakes reported on Crowdin (#23157)
* Fix source string mistakes reported on Crowdin

* Update src/Mod/Draft/Resources/ui/TaskPanel_CircularArray.ui

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/Resources/ui/TaskPanel_CircularArray.ui

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/draftfunctions/upgrade.py

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/draftfunctions/upgrade.py

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/draftguitools/gui_downgrade.py

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/Resources/ui/TaskPanel_SetStyle.ui

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

---------

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2025-08-24 20:51:32 -05:00
Max Wilfinger
386c5cd910 Draft: Update UI strings for consistency (#22331)
* Draft: Update UI strings for consistency

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Apply suggestions from code review

---------

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2025-08-06 23:02:16 +02:00
Syres916
b0c63c5537 [BIM][Draft] QCheckBox fix regressions introduced by PR #21939 (#22199)
* [BIM][Draft] QCheckBox fix regressions introduced by PR #21939

* [BIM] Remove unwanted index values - CodeQL feedback
2025-06-27 11:25:36 +02:00
Syres916
8844319d33 [BIM][Draft][CAM] preparation for deprecation of QCheckBox… (#21939)
* [BIM][Draft]{CAM] preparation for deprecation of QCheckBox stateChanged -> checkStateChanged
2025-06-18 11:24:21 +02:00
Roy-043
e6408f41af Rebase and minor adjustments 2025-06-16 18:25:59 +02:00
tetektoza
46b7c6c385 Draft: Introduce 1-axis mode for ortho array (#21602)
* Draft: Introduce 1-axis mode for ortho array

As the title says - the 1 axis mode allows to switch between all of the
axises mode and allows to modify only 1 axis at the time that user can
select with the checkbox.

* Draft: Rename to Linear Mode and remove redundant comments

* Draft: Display only one interval for the selected axis

* Draft: Cache selected variables in user.cfg - axis mode, intervals, etc...

* Draft: Make sure the checkboxes in OrthoArray are exclusively selected

* Draft: Apply review comments

Changed a couple of things according to review:
* linear mode is now being used as default during first startup (it
  wasn't before)
* applied Roy's comments about coding style, etc.
* grouped everything into separate QGroupBox which is dedicated for
  Linear Mode and has it's own labels, although spinboxes are shared so
  during mode switch we reparent them now
* removed Orthogonal Array's icon
* in the QGroup applied naming suggested in the review, X Intervals ->
  interval, etc.
* changed to radio buttons since we want exclusivity in selection
2025-06-09 17:33:51 +02:00
Roy-043
60f872ce1e Draft: store 3 ShapeString parameters and remove font from prefs (#21054)
* Draft: store 3 ShapeString parameters and remove font from prefs

With this PR 3 ShapeString parameters are stored:
* ShapeStringFontFile: this replaces the old FontFile parameter.
* ShapeStringHeight
* ShapeStringText

The ShapeStringFontFile is just the last selected font file and not exposed in the Preferences editor.

Additionally:
* Changed the label of the text input box from "String" to "Text".
* Changed the label of the point reset button to sentence case.

* Remove faulty docstring
2025-04-29 07:13:17 -05:00
Roy-043
bfef06f580 Draft: Add Global mode to ShapeString task panel
This PR adds the Global mode option to the ShapeString task panel.

Additionally:
* Rounding of coordinates caused by reading values from the task panel is avoided.
* Improved task panel layout: Height input above String input.
* Some code reformatting.
2025-04-28 17:57:41 +02:00
Roy-043
ca340da86c Draft: close task panels on doc close
Related: #17952.

This PR introduces a document observer to close task panels on doc close.

For now it is for the Draft Workbench only. The BIM Workbench will be dealt with in a future PR.

The basic code is simple, but to make things works some additional things were addressed:
* gui_base.py: the GuiCommandBase class was enhanced to handle App.activeDraftCommand, self.doc, self.view and self.planetracker. Strictly speaking only the first 2 are required for this PR.
* gui_base.py: self.command_name was changed to self.featureName for compatibility with gui_base_original.py. Not required for this PR.
* gui_arcs.py, gui_circulararray.py, gui_polararray.py and gui_orthoarray.py: updated in relation to the GuiCommandBase class.
* gui_arcs.py Arc_3Points: The command now has a ui property and shows a plane tracker. Only the first is required for this PR.
* gui_shapestrings.py: This command had two ui attributes: self.ui and self.task. This was problematic. To fix this the base class of the command was changed from gui_base_original.Creator to gui_base.GuiCommandBase. As a result the getStrings method is no longer available meaning that the useSupport parameter is ignored when creating a ShapeString. But since that mechanism does not work properly anyway, I feel that this is acceptable. Should many user complain the functionality can of course be reintroduced.
2025-04-20 22:53:52 -05:00
Roy-043
245a2fada7 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
f3854d155a 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
2ee620ab42 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
Tobias Frost
460da406f8 spelling fixes (#18688)
* Fixes spelling of "Allow to" to "Allow one to"

and those variants:
Allows to -> Allows one to
allow to -> allow one to
allows to -> allows one to

* Fix "Let's -> Lets"

(and lower case variant.)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/3rdParty/salomesmesh/inc/MED_Wrapper.hxx

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Base/PyObjectBase.cpp
Update src/App/ExtensionContainer.h
Update src/App/PropertyContainer.h

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Use gerund in user-facing texts.

* Use gerund for two more user-facing strings.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

---------

Co-authored-by: Tobias Frost <tobi@debian.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-01-13 11:22:20 -06:00
Roy-043
11c33d897a Include other Draft commands 2024-11-30 16:48:41 +01:00
Martin Rodriguez Reboredo
51987dc1ab Fixups with Qt6 enums (#13611)
* Python PySide enums to C++ converter

* Python IntFlags to C++ int in getStandardButtons

* Remove int conversion in mods Python sources
2024-05-06 18:02:18 +02:00
Josh Coalson
fbd8767242 Part: Rename AttachExtension::Support property to AttachmentSupport, to avoid name conflict with base features. Fixes #7052 2024-03-04 18:22:43 +01:00
Kevin Martin
2b9fa18b68 Eliminate many "doing what you told me to" messages
These messages were perhaps originally intended as a debuggin aid but now add clutter to the output panes. Remaining messges are mostly the result of methods to display attributes of an object (which one could call from the Python console) or actually provide some information which would not be obvious from the circumstances
2024-02-02 08:58:45 -05:00
Roy-043
47f6c756e3 Merge pull request #12111 from 3x380V/draft_wb_qt6
Draft: Qt6 fixes
2024-01-31 11:31:38 +01:00
Ladislav Michl
839fb17649 Draft: Use widgets from QtWidgets 2024-01-25 14:27:38 +01:00
Roy-043
d76db39662 Draft: Draft_Scale: make sure scale inputboxes show at least 6 decimals
Fixes #7386.
2024-01-23 18:07:03 +01:00
Roy-043
427e75707e Draft: ShapeString double escape backslash in string
Fixes 12058.
2024-01-22 14:35:34 -03:00
Roy-043
822f2111e3 Draft: implement new get_param functions (step 3)
See #11677
2023-12-12 20:20:03 +01:00
Roy-043
938b25183b Draft: Updates related to the PlaneGui class (step 3)
Related issue:
#5603.
2023-10-27 11:55:24 +02:00
luzpaz
38a01939e0 Migrate domain name from freecadweb to freecad (#9352)
* Migrate domain name from freecadweb to freecad
* Migrate src/Mod/Material files
* Migrate Stylesheet related files
* Migrate *.svg files
* Migrate miscellaneous files
* Migrate some build files
* Migrate recently added TD AR_IRAM template files

Closes #6415
2023-04-24 15:19:20 -05:00
Roy-043
f9cdaaf3d9 Draft: fix issue with undo (#8267) 2023-01-31 21:38:19 +01:00
Roy-043
20c582da9d Draft: Fix handling of double quote in shapestring 2022-10-05 10:57:48 +02:00
Roy-043
3b85533438 Draft: Restore DontUseNativeDialog after ShapeString edit 2022-04-25 00:48:28 +02:00
marioalexis84
aa2ebb9601 Draft: Make ShapeString editable by double-click - fixes #5885
* Draft: Make ShapeString editable - fixes #5885
2022-04-08 17:47:41 +02:00
marioalexis
79b7bfd5d0 Draft: Remove Python 2 type support 2022-03-28 18:02:23 -03:00
andrea reale
83d3a916c0 remove QT4 references 2022-03-19 23:07:38 +01:00
Roy
1566c00d35 Draft: Housekeeping: call 'make' functions with new name (3) 2022-02-13 11:01:15 +01:00
Roy
c7da560d39 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
Mariwan
e63472b10c Draft: change static to non-static declared variables (#5292)
* Draft: change static to non-static declared variables

* Change variable name and add some comment
2022-01-05 16:39:28 +01:00
Chris Hennes
2977cadc41 [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
David Osterberg
9dd96ed107 Draft: Fix regressions in Draft array 2021-02-14 01:20:06 +01:00
wmayer
ac6d06dd84 Draft: fix syntax errors 2021-02-13 12:14:12 +01:00
Yorik van Havre
abee35f38a Draft: Fixed broken translations everywhere 2021-02-12 14:44:58 +01:00
JAndersM
bd913d1dd5 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
e9b72b5be7 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
1c65c7dc92 Draft: add Doxygen strings to the packages' __init__ files
The packages are `draftfunctions`, `draftgeoutils`, `draftguitools`,
`draftmake`, `draftobjects`, `drafttaskpanels`, `drafttests`,
`draftutils`, `draftviewproviders`.
2020-07-17 13:01:45 +02:00
vocx-fc
3e67b469d4 Draft: clean up CircularArray code
Avoid `Draft.py` in the `make_circular_array` function because
it creates a circular dependency.

Use function to find the object in `make_circular_array`.

Now the make function accepts as input a `"String"` which must be
the `Label` of an object in the document, so it is easier to create
arrays interactively from the Python console.

Clean up the GuiCommand and task panel code, and avoid printing
messages to the terminal, as this is already done
by the make function.
2020-06-03 14:46:15 +02:00
vocx-fc
1ad8b16a81 Draft: clean up PolarArray code
Avoid `Draft.py` in the `make_polar_array` function because
it creates a circular dependency.

Use function to find the object in `make_polar_rarray`.

Now the make function accepts as input a `"String"` which must be
the `Label` of an object in the document, so it is easier to create
arrays interactively from the Python console.

Clean up the GuiCommand and task panel code, and avoid printing
messages to the terminal, as this is already done
by the make function.
2020-06-03 14:46:15 +02:00
vocx-fc
604e70fd20 Draft: clean up OrthoArray code
Avoid `Draft.py` in the `make_ortho_array` function because
it creates a circular dependency.

Use internal functions to abstract the orthogonal arrays.
The `_make_ortho_array` is a simple wrapper over the general
`make_array` function.

The result is four variants:
- `make_ortho_array`
- `make_ortho_array2d`, without the Z component
- `make_rect_array`, strictly rectangular components
- `make_rect_array2d`, strictly rectangular without the Z component

Also use functions to perform checking of the inputs,
whether these are vectors, numbers (integer and floats)
or integers.

Now the make function accepts as input a `"String"` which must be
the `Label` of an object in the document, so it is easier to create
arrays quickly from the Python console.

Clean up the GuiCommand and task panel code, and avoid printing
messages to the terminal, as this is already done
by the make function.
2020-06-03 14:46:15 +02:00
vocx-fc
623cd5df35 Draft: activate new array make functions
They are made available in the `Draft` namespace,
and are also used in the unit tests, the test script,
and the GuiCommands.
2020-05-18 12:42:10 +02:00
vocx-fc
3172e82dc1 Draft: move circular, ortho, and polar make functions
Previously they were in `draftobjects`, but since they
don't define new objects, just create objects,
they are moved to `draftmake`.

Also ajust the `CMakeLists.txt` and the corresponding Gui Commands
which use these make functions.

These functions internally use the `Draft.makeArray` function.
We will put comments as reminders so that when this function
is moved to its own module, we can update the derived functions.
2020-05-18 12:42:10 +02:00
vocx-fc
ef7e30c653 Draft: update description of drafttaskpanels package 2020-05-06 12:46:24 +02:00
vocx-fc
6d4ee479c0 Draft: small changes to the taskpanels for arrays 2020-04-24 13:49:13 +02:00