Commit Graph

396 Commits

Author SHA1 Message Date
Benjamin Nauck
65c6614081 Sketcher: Use constant for Type::BadType instead Type::badType() 2025-02-24 08:30:18 +01:00
Kacper Donat
12a69fe296 Base: Add isNullOrEmpty string helper
This adds isNullOrEmpty string helper that cheks if string is... well
null or empty. It is done to improve readability of the code and better
express intent.
2025-02-21 15:04:43 +01:00
Benjamin Bræstrup Sayoc
c0c6df10ec Sketcher: Use QStringLiteral 2025-02-10 18:32:45 +01:00
tritao
65466d580b Gui: Reorganize the selection files into a top Selection folder. 2025-02-03 17:56:57 +01:00
Benjamin Nauck
dd6aa9f3c7 Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's
Regex based changes, manually verified
2025-01-27 16:08:18 +01:00
tritao
8aa50c4380 Gui: Reorganize the dialog files into a top Dialogs folder. 2025-01-24 16:28:02 -06:00
Benjamin Nauck
08c9a191e2 Add template based SelectionSingleton::countObjectsOfType
Also convert code to use this new method
2025-01-13 18:55:15 +01:00
Chris Hennes
fde778faeb Merge pull request #18273 from Ondsel-Development/sk_group_drag
Sketcher: Group dragging
2024-12-09 12:29:49 -05:00
Kacper Donat
651cefde4d Gui: Use getObject<T>() helpers in classes
This commit is generated using regex based find and replace:

```
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*getObject\(\s*\)\)/getObject<$1>/
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*([^)]*)\s*->\s*getObject\(\s*\)\)/$2->getObject<$1>()/
```

To regenerate if needed.
2024-12-06 18:29:39 +01:00
PaddleStroke
b92bda03da Sketcher: Rename movePoint to moveGeometries. 2024-12-06 16:45:47 +01:00
PaddleStroke
0a06ceff4d Sketcher: Dimension: Handle case of vertical/horizontal lines 2024-10-28 17:29:40 +01:00
Benjamin Bræstrup Sayoc
5ce6c7933a [Sketcher] If origin selected: don't do distance to origin
In auto constrainer. Fixes #12684
2024-10-07 09:02:43 -05:00
PaddleStroke
d01d71198d Sketcher: CommandConstraints: Make sure points are created as constructions in few functions. 2024-09-03 18:28:54 +02:00
Ajinkya Dahale
6a1afdc4e2 [Sketcher] Fix endpoint-to-endpoint/edge tangency substitution
Only substitute if the point(s) involved are `start`/`end`. Centers do
not make sense here.
2024-08-25 07:33:59 +05:30
PaddleStroke
4527112392 Sketcher: Dimension: Fix right click/esc so that it dismiss the dimension before exiting the tool. 2024-07-15 18:26:03 +02:00
Max Wilfinger
7d21d9edb8 Fix source string typos mentioned on Crowdin (#15261) 2024-07-08 17:18:31 -05:00
wmayer
8668d48b2d Sketch: Fix compiler warnings 2024-07-08 19:27:39 +02:00
Chris Hennes
fe007b205b Merge pull request #14979 from Ondsel-Development/sk_ovp_switching
Sketcher: Dimension: Fix 2 bugs.
2024-07-08 11:26:39 -05:00
ppphp
51c6dbd3e3 fix unique ptr usage in sketch (#15008)
* fix unique ptr usage in sketch

* [pre-commit.ci] auto fixes from pre-commit.com hooks
2024-07-08 10:53:49 -05:00
PaddleStroke
d92742f9c6 Sketcher: Dimension: Prevent the use of Undo from crashing. 2024-07-02 15:48:47 +02:00
PaddleStroke
fa0fdf22cf Sketcher: Dimension: Fix constraint switching. Refactor a little bit by adding finishDimensionCreation to reduce code copies. 2024-07-02 09:49:47 +02:00
wmayer
f6e67a009d Fix several compiler warnings
* -Wmaybe-uninitialized
* -Wunused-parameter
* -Wunused-variable
* -Wnonnull
* -Wstringop-truncation
* -Wstringop-overflow
2024-06-19 21:14:23 -05:00
wmayer
83d91d61c6 Sketcher: Fix accessibility of some group commands
The affected commands are:
* Sketcher_CompLine
* Sketcher_CompCreateArc
* Sketcher_CompCreateConic
* Sketcher_CompCreateFillets
* Sketcher_CompCurveEdition
* Sketcher_CompSlot
* Sketcher_CompHorVer
* Sketcher_CompToggleConstraints
2024-05-23 10:14:46 +02:00
PaddleStroke
711a7ad827 Sketcher: Dimension : little fixes 2024-05-06 18:40:46 +02:00
Max Wilfinger
3d2419effc Sketcher / UI: Update Sketcher Toolbars (#13763)
* Update Sketcher toolbar UIs.
Group all create tools for arcs, conics.
Group toggle driving/active constraints.
Update arrangement of icons.

* Change default to unified coincidence tool.
2024-05-06 18:05:56 +02:00
PaddleStroke
2e7a1cf358 Sketcher: Dimension tool : add arc length 2024-05-06 17:50:17 +02:00
Roy-043
0a514c201a Sketcher: Make constraints menu texts more consistent
The current constraints menu texts are not very consistent. Particularly the mix of adverbs (horizontally) and adjectives (symmetrical) is strange.
2024-04-22 11:01:06 -05:00
wmayer
b64e3e750f Sketch: add command to context-menu to change value of constraint
The edit datum dialog is opened by double-clicking on a dimensional constraint in a sketch. However, the double-clicking event doesn't work realiably on
some systems. As a workaround this PR adds the command to the context-menu.

For more details see the forum thread: https://forum.freecad.org/viewtopic.php?t=71137
2024-04-08 18:01:44 +02:00
sliptonic
75c589d355 Merge pull request #12602 from FlachyJoe/arc-distance
Sketcher : ArcLength Constraint
2024-04-01 10:43:35 -05:00
Roy-043
a7251a6c3a Sketcher: Spelling colinear -> collinear
I have not changed the name of the `areColinear` function.
2024-03-26 07:40:14 +01:00
Florian Foinant-Willig
a8254a4e0c Sketcher : ArcLength Constraint 2024-03-25 22:32:20 +01:00
PaddleStroke
9d43e7fda7 Sketcher : fix error in className of CmdSketcherCompHorizontalVertical 2024-03-18 13:23:54 -04:00
Josh Coalson
a8ae56e06a Part: Rename AttachExtension::Support property to AttachmentSupport, to avoid name conflict with base features. Fixes #7052 2024-03-04 18:22:43 +01:00
Max
4e29ce1fcf add description of colinear function to Sketcher_ConstrainTangent 2024-03-04 18:20:18 +01:00
wmayer
51a01b9e2b Fix compiler warnings:
fix [-Winconsistent-missing-override]
fix [-Wunused-lambda-capture]
fix [-Wunused-variable]
fix [-Wswitch]
2024-02-26 11:01:37 -06:00
LemonBoy
aa977648c3 Fix icon order in constraint menu
Closes #12264
2024-02-12 11:50:41 -06:00
PaddleStroke
ada76964c3 Sketcher: CommandConstraint.cpp : modernize for loops and use some auto 2024-02-12 11:14:22 -06:00
PaddleStroke
f06bcf3163 Sketcher: Parallel: Ignore selected points instead of throwing an error. 2024-02-12 11:14:22 -06:00
Ajinkya Dahale
3f1f6387d1 [Sketcher] Handle spline selection in Dimension tool 2024-02-08 23:46:17 +05:30
Ajinkya Dahale
65b4dd10ae [Sketcher] Expose general tangency with B-splines to Sketcher
The following commits were squashed into this

[Sketcher] Handle some corner cases in AngleViaPoint

[Sketcher] Avoid redundant constraints with B-splines...

When involving tangent, perpendicular and angle constraints.

[Sketcher] Add pre-commit changes

[Sketcher] Do not allow 2-selection tangent with B-spline

Also...

[Sketcher] Report error when using direct tangency with B-splines

[Sketcher] Fix malformed constraint when B-spline is selected second

To clarify, this means the second curve selected. The position of the point in
selection order does not matter in angle-via-point.

[Sketcher] Fix wrong number for B-Spline tangent on redundancy

[Sketcher] Remove existing point-on-object in some redundant cases

Particularly when point constrained on a B-spline is being used for
tangent, perpendicular or angle via point with the same B-spline.

[Sketcher] Fix direction issue with B-spline tangents.

Without these changes the solver might try to "twist" the B-spline to make the
angle between curves be 0 instead of PI (which may be closer to the initial shape).
2024-02-08 20:04:28 +05:30
Max Wilfinger
476089a2ad sketcher: create contextual right click menu 2024-01-08 12:39:17 -05:00
Paddle
9bb9eb8b21 Sketcher_dimension : Fixes https://github.com/FreeCAD/FreeCAD/issues/11904 2024-01-07 20:53:22 -06:00
Max Wilfinger
ee6dacdca7 add capabilities to auto-dimension tool to dimension distances between arc-point, arc-circle, arc-arc 2024-01-05 09:25:53 -06:00
Max Wilfinger
a662fbb2ff always show auto HorVer tool command in the toolbar when the tool is present (concise toolbar oprion) 2023-12-31 10:44:08 -06:00
Abdullah Tahiri
01207a499f Sketcher: Activate new icon for optional unified coincident constraint 2023-12-21 15:36:56 +01:00
Kacper Donat
a8f0f5964e Gui: Allow ActionGroups to not remember choice
This is fix to issue mentioned in the #11717, on discord and forum that
for smart dimension tool the chosen tool should not be remembered. This
will ensure that the "smart" tool is always visible on the toolbar and
other tools are accessible in case that such explicit choice is needed.
2023-12-18 17:51:48 +01:00
Florian Foinant-Willig
df32ad2d38 Fix isCircleOrArc usage 2023-12-17 16:01:29 +01:00
Abdullah Tahiri
4d860203fc Sketcher: Utils/CommandConstraints/EditModeConstraintCoinManager - refactor duplicated code 2023-12-17 16:01:29 +01:00
Abdullah Tahiri
e29617c3fb Sketcher: Redraft circle/arc to circle/arc constraint command 2023-12-17 16:01:29 +01:00
Florian Foinant-Willig
d2a579bdc6 Sketcher: Extend distance constraint to arcs 2023-12-17 16:01:29 +01:00