Commit Graph

300 Commits

Author SHA1 Message Date
Paddle
74e8990044 Sketcher: Rectangle DSH 2023-11-03 14:02:25 +01:00
Abdullah Tahiri
e67f6aa7ae Sketcher: Make GeometryConstructionMode an enum class
=====================================================

Enforce strong typing to avoid all kinds of abusive implicit conversionsm, the corresponding associated bugs and make code more readable.
2023-11-03 14:02:25 +01:00
wmayer
d305f306df Core: Revert superfluous changes made with PR #9521 2023-10-09 15:06:45 +02:00
AgCaliva
ae9bb6ed43 using clang-format tags to avoid get headers reordered(fix DOMDocument redefinition error) 2023-09-18 13:40:13 -03:00
pre-commit-ci[bot]
19887876d2 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-09-16 05:14:03 +00:00
AgCaliva
64f60721a9 merge master via cli 2023-09-16 02:12:58 -03:00
AgCaliva
b360b43ebe Fixing DOMDocument redefinition 2023-09-16 00:38:41 -03:00
Chris Hennes
fcedce3c42 Sketcher: Reformat to current clang-format standard 2023-09-04 07:17:28 -05:00
Roy-043
041a8674fd Update CommandCreateGeo.cpp
Additional change: "via" -> "by"
2023-06-10 18:46:37 +02:00
Roy-043
fda7f95646 Sketcher: Minor improvements for some GUI texts
Menu texts for new B-spline tools were inconistent. See https://forum.freecad.org/viewtopic.php?t=78808
2023-06-10 18:39:32 +02:00
Abdullah Tahiri
78ae9c1d7d SketcherGui: apply clang-format 2023-05-25 17:08:03 +02:00
Chris Hennes
397807b72d Gui: Minor translation fixes 2023-05-11 18:31:34 -05:00
wmayer
b0c9871722 Use View3DInventorViewer::setSelectionEnabled instead of SoFCUnifiedSelection::selectionRole 2023-05-04 08:03:11 +02:00
Chris Hennes
cb10e49b27 Sketcher: Tweak wording as suggested by translators 2023-05-02 20:29:36 +02:00
Ajinkya Dahale
c66ed794f9 [Sketcher] Clear out some TODOs and other comments 2023-03-24 16:30:48 +01: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
Ajinkya Dahale
357a3c0692 [Sketcher] Add icon for B-Spline by interpolation tool
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"

[Sketcher] Add better icons for `CreateBSplineByInterpolation`

Courtesy @paddlestroke.
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
94db5271b3 [Sketcher] [WIP] Add periodic B-spline support for interpolation DSH
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
e83a9804c1 [Sketcher] Create DSH for drawing B-splines by interpolation
Only creates 1-degree splines by describing knots.

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
Uwe
e24daabf1f [Sketch] Gui: A - D: remove unused headers
- also some sorting
2022-12-11 23:47:03 +01:00
Roy-043
7ae40aebd2 Sketcher: Correct icon for Sketcher_CreatePointFillet 2022-10-25 00:33:28 +02:00
wmayer
cbac99a8ed Sketcher: [skip ci] remove unused includes 2022-09-25 11:09:29 +02:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
Uwe
6c7cf1c276 [Sketcher] fix icon name
- fix a FIXME, Sketcher_CreateEllipse depicts already the right thing, it just has to be renamed
2022-07-29 01:26:00 +02:00
Uwe
1b5d51f5b8 [Sketcher] [skip CI] CommandCreateGeo: code style fix
- the MSVC IDE had problems with this, thus apply our .clang style
2022-07-27 16:05:39 +02:00
0penBrain
776c17df01 [BUGFIX] Sketcher: fix icon normal/construction toggling when commands used in custom toolbar
Fixes #7064
2022-07-27 14:28:54 +02:00
Abdullah Tahiri
c5da665d45 Split DSHs from CommandCreateGeo 2022-06-28 19:29:47 +02:00
Abdullah Tahiri
12a2de626a DrawSketchHandler: Cursor rework and preselect at point functionalities 2022-06-28 19:29:19 +02:00
Abdullah Tahiri
51f2c55334 Utils refactor w/o commandcreategeo 2022-06-28 19:28:06 +02:00
Abdullah Tahiri
2c58060524 Sketcher-Utils: Refactor common code up 2022-06-28 19:27:20 +02:00
Paddle
74d6d1855c Sketcher: Create Geometry ConstraintToAttachment function 2022-06-28 19:27:04 +02:00
Abdullah Tahiri
5657b4e434 Sketcher: Cleanup obsolete DrawSketchHandlers 2022-06-28 19:22:58 +02:00
Uwe
61be686687 [Sketch] remove unnecessary Boolean comparisons 2022-06-19 18:35:52 +02:00
wmayer
c5bab68332 Gui: add convenience functions to SelectionFilterGate 2022-04-19 15:04:14 +02:00
wmayer
94c5d89d1f Sketcher: fix crash after having created a new B-Spline
The crash might be related to issue #6324: Segmentation fault on knot insertion in older B-Spline
2022-04-17 17:33:11 +02:00
wmayer
d21a60b294 All: modernize C++11
* replace deprecated headers
2022-03-23 22:44:18 +01:00
wmayer
51186c018e Sketcher: modernize C++11
* use nullptr
2022-03-23 19:26:15 +01:00
Abdullah Tahiri
ee98a3d87f Sketcher: Some code comments 2022-03-13 19:28:38 +01:00
Abdullah Tahiri
7294d4d7a3 Sketcher: move comment to right position 2022-03-12 18:45:16 +01:00
Abdullah Tahiri
5e88ee99f5 Sketcher: BSpline code review and fix
=====================================

- Avoid using EditCurve for the double use of storing the pole positions and the last mouse position. Split into individual vector for poles and previous cursor position (with appropriate names).
- Store all pole geoids to better show the intend of the code.
- Avoid indexing when referring the last inserted value of a std::vector, use back() instead.
- Encapsulate code to draw the bspline polygon and the cursor text to the given position. This allow to select the right function for every case, while avoiding unclear names, such as "mousemove()".
- Refactor code to finish command, to avoid calling unclear names such as "releasebutton" to better show the intend of the function call.
- Ensure deleted pole does not appear anymore in the scenograph.
2022-03-12 15:47:50 +01:00
Ajinkya Dahale
201ef90a89 [Sketcher] Constrain first pole when created
By doing this, duplicate radius constraints are not made when deleting and
redefining second pole.
2022-03-09 16:43:47 +01:00
Ajinkya Dahale
3fa1735088 [Sketcher] Redraw correctly on pole delete in "create b-spline"
This ensures that the last preview line drawn is always at the cursor and that
the coordinates are always w.r.t. the last defined pole.
2022-03-09 16:43:47 +01:00
Uwe
4f5c29edd6 [Gui] Quarter: remove unused includes 2022-03-09 01:12:15 +01:00
Ajinkya Dahale
ec2522130b [Sketcher] Allow deleting last knot during B-Spline creation 2022-03-06 16:14:07 +01:00
Ajinkya Dahale
c6f19758d1 [Sketcher] Reduce duplicate code in DrawSketchHandlerBSpline 2022-03-06 16:14:07 +01:00
Abdullah Tahiri
79f52556f4 Sketcher: Clean up old crosshair code
====================================

- Remove old unconnected code
- Move member functions to correct cpp file
2022-03-04 06:26:46 +01:00
Ajinkya Dahale
06f290e311 [Sketcher] Allow setting B-Spline degree at creation 2022-02-27 16:48:23 +01:00
wmayer
f7392d47b9 Sketcher: fix warnings:
* fix -Winconsistent-missing-override
* fix -Woverloaded-virtual that is also a bug because the DrawSketchHandlerArcOfParabola didn't set the suitable mouse cursor
2022-02-17 21:14:37 +01:00
Abdullah Tahiri
f7741d4399 DrawSketchHandler: activation and deactivation via NVI pattern
==============================================================

With the introduction of overridable default behaviour for commands, it makes sense to keep control of the execution path of the activation and deactivation.

Non-virtual interface pattern enforces execution control of the virtual functions, while allowing the behaviour to be overriden in a case by case basis.
2022-02-17 19:37:48 +01:00