Commit Graph

139 Commits

Author SHA1 Message Date
Paddle
88883faaf8 Sketcher: Add copy/cut/paste sketcher commands 2024-01-19 11:13:53 +01:00
Max Wilfinger
96d3e26110 sketcher: create contextual right click menu 2024-01-08 12:39:17 -05:00
Paddle
a5a77fc0fd Rotate DSH : Polar pattern tool for sketcher. 2023-12-20 06:59:47 +01:00
Chris Hennes
bd9a210b65 Merge pull request #11494 from Ondsel-Development/Coincident
[Sketcher] Introduce an optional unified version of coincident and pointOnObject
2023-12-04 10:46:21 -06:00
Paddle
bc4605aa6a Add a setting to disable auto horizontal/vertical. 2023-11-28 09:45:35 +01:00
Paddle
d94fdf795e Introduce CmdSketcherConstrainCoincidentUnified. This is a unified version of coincident + pointOnObject.
This is disabled by default. Nothing changes by default.
2023-11-27 21:14:33 +01:00
Paddle
ad3e832576 Sketcher : remove deleteAllConstraints from toolbar. 2023-11-27 11:00:50 -06:00
PaddleStroke
cce89e4fec [Sketcher] Auto horizontal/vertical (#11330)
* Refactor sketcher horizontal / vertical constraints and adds a horizontal/vertical command.

* Sketcher : HorVer : change tool icon.

---------

Co-authored-by: Paddle <PaddleStroke@users.noreply.github.com>
2023-11-20 11:00:22 -06:00
Paddle
bd7a468a39 Group Trim/extend/split. 2023-11-20 10:58:17 -06:00
Paddle
6b89039661 ArcSlot DSH : implement the Arc slot tool with tool parameters support. 2023-11-13 15:05:36 +01:00
Paddle
513e1a46c8 Sketcher: Offset DSH 2023-11-03 14:02:25 +01:00
pre-commit-ci[bot]
d793d1c177 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-09-12 21:19:33 +02:00
pre-commit-ci[bot]
e92ed45df9 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-09-12 13:02:35 -04:00
Chris Hennes
fcedce3c42 Sketcher: Reformat to current clang-format standard 2023-09-04 07:17:28 -05:00
Paddle
3fad071760 Sketcher_Dimension : Turn the command into a group-command to have at hand individual commands. 2023-09-01 07:57:44 -05:00
Chris Hennes
d0ee2702ec Merge pull request #9810 from Ondsel-Development/v2_constrain_contextually
Sketcher: Constrain Contextual implementation V2
2023-08-28 10:52:05 -05:00
Florian Foinant-Willig
3311d6d6e3 Sketcher: Fix Visual toolbox visibility 2023-08-28 10:46:48 -05:00
Paddle
eee2f14128 Change the name to 'Dimension' instead of 'Constrain Contextual' 2023-08-26 08:35:27 +02:00
Paddle
b10b9bf22d Sketcher: Constrain Contextual implementation. 2023-08-26 07:41:09 +02:00
Florian Foinant-Willig
06cd311acd Fix the fix o:-) 2023-08-14 22:31:36 +02:00
Florian Foinant-Willig
f120c7a317 Fix menu and ressource file 2023-08-14 22:12:18 +02:00
Florian Foinant-Willig
159f82af45 Sketcher: Add command to switch arc helper 2023-08-03 13:06:05 +02:00
Abdullah Tahiri
5718efbdeb MainWindow: Fix for Automatic WB and edit mode WBs
==================================================

As described here:
https://forum.freecad.org/viewtopic.php?p=687188#p687188
2023-07-01 19:56:52 +02:00
Adrián Insaurralde Avalos
3ff1c54f11 [Sketcher] Fix incorrect toolbar name uppercase 2023-06-07 16:48:57 -04:00
Chris Hennes
f18ead6f02 Sketcher: Add missing translations 2023-06-06 15:35:12 +02:00
Abdullah Tahiri
554ede35d2 Sketcher/Gui: Extend toolbar framework and fix toolbar visibility not preserved
=================================================================================

fixes #9208

Essentially:
- The regular mechanism to save toolbar state when changing from one WB to another
is not designed to support changes within one WB (e.g. from edit mode and back).
- At creation time, toolbars can be initialised with default visible or default hidden
state. Additionally, there is third configuration "Unavailable", which refers to a
toolbar that is hidden, and the control to enable it is also hidden by default.
- The ToolBarManager is extended to enable to set the State of one or more toolbars.
- The State refers to changes to be effected on one or more toolbars by client code:
* ForceHidden allows to hide a toolbar and also hide its control (a toolbar not available
in a mode).
* ForceAvailable allows to make a toolbar available by making its control visible, the
toolbar itself is visible or not depending on user settings.
* RestoreDefault allows to bring the control visibility to the default of the toolbar, the
toolbar itself is visible or not depending on user settings.
* SaveState allows to store the current visibility state of a toolbar. It enables client
code to save the state when appropriate. It provides the only option for default "Unavailable"
toolbars, which are fully managed by client code. It provides additional flexibility to save
other toolbar visibility on request.

For the Sketcher this means:
- That edit mode toolbars are not shown outside edit mode.
- That edit mode toolbars and non-edit mode toolbars can be configured independently.
- that edit mode toolbars' state is saved when leaving edit mode if and only if, the
workbench that is selected when leaving edit mode is the Sketcher WB.
- it won't save the state if the user manually selected another WB and then left edit
mode (why? see limitation above).

Limitation:
- When switching to another WB while in edit mode, the other WB is activated before the
current WB (sketcher WB) is deactivated. This means that at sketcher level, the sketcher
has no chance to save states or do other tidy up actions before the tools of the other WB
are activated.
- This, however, is understood as not relevant enough as to warrant changing the mechanisms
in place.
2023-05-30 16:37:53 +02:00
Abdullah Tahiri
78ae9c1d7d SketcherGui: apply clang-format 2023-05-25 17:08:03 +02:00
Abdullah Tahiri
87aec0d9ed Skecher: Rendering order
========================

Recently the rendering order functionality was temporarely removed, as it interferred with the development of visual layers.

However, the release comes before visual layers are finished and can provide such functionality.

This commit reintroduces the functionality for the release.
2023-05-17 16:29:34 +02:00
Abdullah Tahiri
b2c428f13f Sketcher: New edit tools toolbar
================================

Move Grid and Snap to edit tools
2023-05-17 16:29:34 +02:00
Roy-043
fe151630b9 Sketcher: Sketcher_SelectHorizontalAxis before Sketcher_SelectVerticalAxis in menu
The X axis related command should come before the Y axis command.
2023-05-07 19:51:23 +02:00
wmayer
43c3a31da9 Sketcher: restore toolbars when changing between workbenches in edit mode
This partially fixes issue #9135
2023-04-03 17:36:06 +02:00
Ajinkya Dahale
8803404d88 [Sketcher] Fix and support periodic B-spline by interpolation
This commit is part of a project funded by the Open Toolchain Foundation under
the title "Open Toolchain Foundation - Curve drawing tool in Sketcher
Workbench".
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
f340b4104b [Sketcher] Add missing GUI elements for B-spline by knots
Commented out the periodic version for now since they don't work completely well.

This commit is part of a project funded by the Open Toolchain Foundation under the title "Open Toolchain Foundation - Curve drawing tool in Sketcher Workbench"
2023-03-24 16:30:48 +01:00
Paddle
ecb1724bf1 Sketcher: Snap: initial implementation: - creation of SnapManager class. - Move grid snap to this new class. - Add snap to object. - Add snap at angle. 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
7920f51c76 Sketcher: Constraint - notification and internal geometry command clean up
==========================================================================

- Migration of all constraints to the new non-intrusive notification framework.

- Removal of internal geometry command

- Command to create manually internal geometries is removed (deprecated).
2023-03-13 16:21:01 +01:00
Abdullah Tahiri
18046c1277 Sketcher: Rewrite grid command
==============================

Fix unresolved issues:
https://github.com/FreeCAD/FreeCAD/pull/7754/files#r1025493443
https://github.com/FreeCAD/FreeCAD/pull/7754/files#r1019077589
https://github.com/FreeCAD/FreeCAD/pull/7754/files#r1025502204

Summary:
- EventFilter unnecessary in light of new implemented signal aboutToshow. The data of the drop-down action is updated only when necessary (when it is going to be shown).
- Structure of individual commands under drop-down simplified to a single action, rendering the need for groupcommands obsolete, while keeping all the grid related controls and
the logic for controlling the grid in a single action class.
- Reduce the complexity and overload of isActive to the bare minimum (determining if it is active and updating the icon to the right icon if so).

Refactor:
- Better name for utils functions, as when a DSH is active, the edit mode VPSketch is a data member of DSH, sketchgui (so this function is not really necessary when the DSH is active).
2023-02-25 23:13:55 +01:00
Paddle
40271a29ea Sketcher: Grid rework. Include:
- Adding 'auto spacing' option.
    - Drawing grid dynamically on viewer area only.
    - Moving code to coinManager.
    - Adding a 'grid tool' to sketcher-edit-mode toolbar.
2023-02-25 23:13:55 +01:00
Uwe
800005a7bd [Sketch] Gui: U - End: remove unused headers
- also some sorting
2022-12-13 04:02:20 +01:00
Ajinkya Dahale
01866dfbfc [Sketcher] Add methods and tools for joining curves
Algorithm to join b-splines:
The code simple concatenates the knots, poles, weights, and knot multiplicities
together, removing data on the connection point of the second curve. Some
further study is needed to see if/when it will give an exact/good connection.

Icon courtesy @bitacovir.
2022-12-04 08:17:20 +01:00
Paddle
67a513e101 Gui: Allow to hide toolbars that are not needed.
In particular this hides edit-mode sketcher toolbars when in non-edit-mode.
    And hides non-edit-mode toolbar when in edit-mode.
    It also hides the structure toolbar when in edit-mode (as it is completely deactivated)
2022-11-04 12:02:16 -05:00
Paddle
9860761d01 Sketcher: Split sketcher toolbar in sketcher-edit-mode and sketcher-non-edit-mode. 2022-11-04 12:02:16 -05:00
Paddle
56e067a521 Sketcher: remove select DOF. 2022-10-21 09:47:07 -05:00
PaddleStroke
d591aad862 Sketcher: Remove StopOperation from toolbar (#7569)
Rarely used, see poll at https://forum.freecadweb.org/viewtopic.php?f=8&t=71922

Co-authored-by: Paddle <PaddleStroke@users.noreply.github.com>
2022-10-07 11:03:44 -05:00
PaddleStroke
cd688644a8 Sketcher: Remove two tools from toolbar (#7568)
Removes "Select conflicting constraints" and "Select redundant constraints", as discussed in https://forum.freecadweb.org/viewtopic.php?f=8&t=71923

Co-authored-by: Paddle <PaddleStroke@users.noreply.github.com>
2022-10-07 11:01:23 -05:00
Chris Hennes
8b252e0004 Sketcher: Remove Snell's Law from toolbar
Leave menu item intact so it is still accessible, but does not use up toolbar space.
2022-10-03 09:25:42 -05:00
Abdullah Tahiri
574766a4bf Remove obsolete DSH Tools - CloseShape and ConnectLines 2022-06-28 19:29:35 +02:00
Kuzemko Alexsandr
05eb2d0324 Crowdin Add some menu text for translation. 2022-06-12 13:02:41 -04:00
Ajinkya Dahale
a4955a27bf [Sketcher] Correct NURB to NURBS
The S in NURBS stands for Spline
2022-02-25 18:22:01 +01:00
Ajinkya Dahale
37e93cc167 [Sketcher] Add knot insertion command in Sketcher workbench 2022-01-09 11:33:53 +01:00
wmayer
6f20e3e4d8 Gui: remove QT_TR_NOOP from command group names and use "CommandGroup" as context string 2021-09-29 16:31:55 +02:00