Commit Graph

489 Commits

Author SHA1 Message Date
Roy-043
0b036ab58a Draft: gui_snapper: setTrackers can be called if there is no 3D view 2024-01-05 10:50:46 +01:00
Roy-043
c2e16f2525 Draft: implement new get_param functions (step 5)
See #11677

Last bits...
2023-12-14 15:53:45 +01:00
Roy-043
3d9c520b0d Draft: implement new get_param functions (step 2)
See #11677
2023-12-12 14:48:09 +01:00
Roy-043
56b8f76cfb Draft: Introduce DefaultAnnoScaleMultiplier parameter
This parameter replaces DraftAnnotationScale.

The parameter can be changed in the preferences and with the Draft_SetStyle command.
2023-12-09 19:17:36 +01:00
Roy-043
a6cd89f746 Draft: use MarkerSize for snap and tracker markers 2023-12-08 21:17:34 +01:00
Roy-043
c0e774f15c Draft: remove maxSnap parameter
It is superfluous. The maxSnapEdges parameter can be set to zero.
2023-12-08 12:06:36 +01:00
Roy-043
640bd5cf26 Draft: remove the Draft_ToggleContinueMode command
Rarely used as Continue mode can also be checked in the task panel of Draft commands.
2023-12-05 22:31:44 +01:00
Roy-043
12211aacbb Draft: menu texts to sentence case 2023-12-04 10:44:59 +01:00
Roy-043
b4c3a0d963 Draft: update Draft_ApplyStyle
The command now applies all style properties from `utils.get_default_annotation_style()` and `utils.get_default_shape_style()`.

Additionally: minor improvements to gui_setstyle.py.
2023-12-02 13:11:08 +01:00
Roy-043
92d69c9641 Draft: update Draft_SetStyle
* Added handling of DefaultShapeVertexColor, DefaultShapePointSize, DefaultAnnoLineColor and DefaultAnnoLineWidth preferences.
* Rearranged the task panel.

Additionally the DefaultDrawStyle and DefaultDisplayMode preferences are now applied by format_object in gui_utils.py.
2023-11-30 21:19:48 +01:00
Roy-043
9b19b66d90 Draft: implement DefaultAnnoLineWidth and DefaultAnnoLineColor prefs
The format_object function in gui_utils.py still requires some work (in connection with the Draft_SetStyle command). This will be done later.
2023-11-30 09:45:19 +01:00
Roy-043
6c015072eb Draft: implement DefaultAnnoLineWidth and DefaultAnnoLineColor prefs
The format_object function in gui_utils.py still requires some work (in connection with the Draft_SetStyle command). This will be done later.
2023-11-29 23:06:17 +01:00
Roy-043
096f77d28c Draft: use param observer to update tray 2023-11-27 23:56:00 +01:00
Roy-043
484bbf3807 Draft: improve handling of anno DisplayMode and LineSpacing
* DisplayMode controlled by new pref DefaultAnnoDisplayMode. This replaces the old dimstyle pref.
* LineSpacing pref is now used when creating annotations. Will be added to prefs ui later.
* format_object no longer changes FontSize as this conflicted with the height parameter in the make_text function.
* make_text function updated.
2023-11-27 15:45:56 +01:00
Roy-043
b9d8f0a999 Draft: use clearer snap marker names 2023-11-25 19:29:12 +01:00
Roy-043
c36979f156 Draft: improve Snap bar show-hide preference
This PR replaces the showSnapBar and hideSnapBar preferences with a single new preference: SnapBarShowOnlyDuringCommands.

Additonally:
Improved some param observer callbacks.
2023-11-24 13:30:03 +01:00
Roy-043
b5d8e17341 Draft: gui_selectplane can rely on ParamObserver for grid changes 2023-11-24 12:18:57 +01:00
Yorik van Havre
b1bcfec271 Draft: Added a preference to turn on/off tool messages (off by default) - fixes #7078 2023-11-23 16:27:36 +01:00
Roy-043
b5adfff293 Draft: make default anno style non-global
Additionally:
* Added the DimShowLine preference. Layout of the tab will be updated later.
* Improved handling of DraftAnnotationScale preference: catch division by zero and use it for the default anno style.
2023-11-23 09:45:12 +01:00
Roy-043
6960f95a00 Merge pull request #11477 from Roy-043/Draft-improved-handling-of-snap-prefs
Draft: improved handling of snap prefs
2023-11-21 18:40:42 +01:00
Roy-043
94a649b128 Draft: improved handling of snap prefs
* Some trackers had 2 color nodes.
* Added a setColor function to some trackers.
* Added a set_snap_style function to the Snapper class.
2023-11-21 17:14:17 +01:00
Roy-043
f2b1051d25 Draft: make mod key prefs non-global 2023-11-20 21:17:18 +01:00
Roy-043
9563a40e32 Draft: gridShowHuman did not work
* The gridBorder pref was ignored.
* BimProject has been renamed to BimProjectManager.
2023-11-20 19:54:24 +01:00
Roy-043
6d83326307 Draft: store more command modes in prefs
With this PR the following 5 command modes are automatically stored in the preferences:
* "ContinueMode"
* "RelativeMode"
* "GlobalMode"
* "fillmode" (existing preference, removed from the Preferences Editor)
* "SubelementMode"

Additionally:
Three commands (Draft_Ellipse, Draft_Rectangle and Draft_Stretch) call `setRelative` after the 1st point has been specified and would permanently switch on relativeMode. After this PR this switch is temporary.
2023-11-18 21:03:26 +01:00
Roy-043
f30e643c82 Merge pull request #11440 from Roy-043/Draft-make-Draft_Edit-prefs-non-global
Draft: make Draft_Edit prefs non-global
2023-11-18 19:45:00 +01:00
Roy-043
34e49b50d8 Draft: make Draft_Edit prefs non-global 2023-11-18 19:18:23 +01:00
Roy-043
f6f0ace4c7 Draft: constraining did not respect global mode
Fixes #10496.
2023-11-18 13:36:35 +01:00
Roy-043
c3a3100137 Draft: Draft_Join should call join_wires
Also removed an obsolete comment.
2023-11-16 21:02:19 +01:00
Roy-043
b07ff3eeb5 Draft: menu texts of snaps to sentence case 2023-11-15 14:59:38 +01:00
Roy-043
0f76aaab86 Draft: cleanup related to PR11336
See #11336
2023-11-14 11:51:34 +01:00
Roy-043
3f7dedf8a4 Typos 2023-11-14 00:04:33 +01:00
Roy-043
7ac0a44136 Draft: more file extensions also in caps 2023-11-13 23:12:18 +01:00
Roy-043
c7777b8ed3 Draft: Draft_SelectPlane did not trigger the grid 2023-11-12 20:16:34 +01:00
Roy-043
453c099873 Draft: Improve grid behavior
This PR improves the behavior of the Draft grid:
* Options in the preferences: "Always show the grid" and "Show the grid during commands".
* The parameters are used for new views. In existing views the grid can be toggled either during a command or when no command is active.
* When switching to a different workbench all grids are hidden unless GridHideInOtherWorkbenches is set to `False`. This can be a Fine-tuning parameter IMO.

Notes:
* The defaultCameraHeight parameter becomes obsolete. It was only used in very specific circumstances.
* The code of PR #8818 becomes obsolete. It makes more sense to use `App.activeDraftCommand` instead of adding a `tool` argument to some functions. Will do some related cleanup later.
* Improved alignment for the related preference ui. The checkbox interaction has been fixed as well.
2023-11-10 14:02:38 +01:00
Roy-043
592547fd60 Draft: renaming of anno style could fail
The error occurred if the style was in use.
2023-11-06 11:40:24 -06:00
Roy-043
a2e85a4ae1 Draft: Updates related to the PlaneGui class (step 4)
Related issue:
#5603.

For gui_snapper.py and gui_trackers.py an intermediate solution has been adopted. They still rely on App.DraftWorkingPlane, but now use a small function to retreive it.

Simply switching to the PlaneGui class is problematic for the trackers as this results in an endless recursion (wp->grid->wp->...). Using the old App.DraftWorkingPlane (which is kept up-to-date by PlaneGui) solves this for now. I will try to return to this later (which may be after the next release though).
2023-10-31 15:41:21 +01:00
Roy-043
3b1c590b53 Merge pull request #11117 from Roy-043/Draft-Updates-related-to-the-PlaneGui-class-(step-2)
Draft: Updates related to the PlaneGui class (step 2)
2023-10-27 10:49:56 +02:00
Roy-043
f12c3604d6 Draft: Draft_SelectPlane was not correctly finished in case of a pre-selection
Fixes #11157.
2023-10-24 10:44:46 +02:00
Vincenzo Calligaro
50725bf253 [Feature Request] [Draft] [UI/UX] new Draft_Hyperlink command (#10878)
* Draft: added the new Draft_Hyperlink command

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>

* Draft: added the new Draft_Hyperlink command
 * Updated regex condition for more Windows file paths and network resources
 * Added check for file existence
 * Modified syntax for Win32/CygWin case
 * Declared ret variable outside if statement

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>

* Draft: added the new Draft_Hyperlink command
 * Replaced os.startfile and subprocess.call with QDesktopServices.openUrl
 * Removed unused Python dependencies

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>

---------

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2023-10-23 17:42:47 +02:00
Roy-043
ca06e87a38 Draft: Updates related to the PlaneGui class (step 2)
Related issue:
#5603.

Additionally:
Fixed the issue where the texts of Arch_Space objects were not exported to DXF.
2023-10-23 16:25:12 +02:00
Roy-043
35ab4a28c9 Draft: Fix Gui.doCommand issue in gui_planeproxy caused by PR11080 (#11134)
The previous code resulted in a syntax error.
2023-10-22 11:15:00 +02:00
Roy-043
f0db4e8ef5 Draft: Updates related to the PlaneGui class
Related issue:
#5603.
2023-10-18 09:50:50 +02:00
Roy-043
0c4dd64f1d Draft: Make Facebinders link-aware
Forum topic:
https://forum.freecad.org/viewtopic.php?t=81997

Additionally:
* Fixed offset and extrusion for non-planar faces.
* Improved the addSubobjects function,
* Cleaned up the code a little bit.
2023-10-18 09:50:18 +02:00
Roy-043
cf9b342cd4 Draft: Update gui_selectplane.py
Related issue:
#5603

Previous PR:
#11010

* This PR implements the new PlaneGui class for the Draft_SelectPlane command.
* As mentioned in the previous PR, almost all working plane related code has been removed from gui_selectplane.py.
* The task panel has a new button "Next" to switch to the next working plane in the history.
* Both the "Previous" and "Next" buttons are only enabled if there is a corresponding step in the history.
* PlaneGui stores a working plane per 3D view, but the other commands have to be updated before that system is fully functional.
* Code to update the toolbar when switching to a different view will be added later.
2023-10-17 15:05:28 +02:00
Roy-043
fd609b4e37 Draft: Fix angular dimension issue caused by #10556
Forum topic:
https://forum.freecad.org/viewtopic.php?t=81956

This PR basically reverts PR #10556.

The angular offset required for the Draft_Arc command is handled in the gui_arc.py file instead. Also removed the unused `urotated` variable from that file.
2023-10-17 15:05:12 +02:00
Roy-043
80f97a588a Draft: Fix cursor scaling issue
Fixes #6793
2023-10-09 14:01:21 +02:00
Roy-043
f5a3cf4d03 Draft: gui_edit called displayPoint without mask (#10693)
Forum topic:
https://forum.freecad.org/viewtopic.php?t=81186
2023-09-16 17:08:50 +02:00
Roy-043
65cd8adca8 Draft: arcTracker did not take Working Plane rotation into account
Steps to verify the issue:
1. Open FreeCAD.
2. Switch to Std_ViewTop.
3. Click one of the curved arrows of the Navigation Cube.
4. Switch to the Draft WB.
5. Make sure Draft_SelectPlane is set to "Auto".
6. Start Draft_Arc and click 2 points (for the radius and the start angle).
7. Result: The displayed arc does not match the start angle or the current point.

Additonally:
* Removed the normal argument from `__init__`. The tracker does not work properly with just a normal. AFAICT there is no code that specifies this normal.
* Minor improvement to `getAngle`: Switched the vectors.
2023-09-05 15:39:17 +02:00
Yorik van Havre
41a1a7a8e6 Merge pull request #10505 from Roy-043/Draft-Fix-angle-range-issue-of-make_circle
Draft: Fix angle range issue of make_circle
2023-09-04 11:29:13 +02:00
Roy-043
3cf51debca Ammended files based on review 2023-09-03 12:43:34 +02:00