Commit Graph

120 Commits

Author SHA1 Message Date
bofdahof
fb71aa3292 Sketcher: apply std::ranges 2025-03-16 17:18:12 -05:00
tritao
551c2e48fb Gui: Reorganize the selection files into a top Selection folder. 2025-02-03 17:56:57 +01:00
Joona Okkonen
f0fb8ddabe Sketcher: Fixed mapping error when attempting to create a sketch inside a group. (#18971)
* Sketcher mapping error fix

Fixed an issue in the Sketcher where attempting to create a sketch while a group is selected caused a mapping error. Now, when a sketch is created with a group selected, the sketch will be placed inside the group.

* Update to use new templated countObjectsOfType

This commit updates the code to use the new templated version of countObjectsOfType, aligning with recent changes in the main branch.

---------

Co-authored-by: Joona <jookkone@edu.lapinamk.fi>
2025-01-20 11:11:09 -06:00
Benjamin Nauck
08fe94ef25 Add template based Document::countObjectsOfType
Also convert code to use this new method
2025-01-14 14:23:46 +01:00
Benjamin Nauck
74f3aee9a7 Add template based SelectionSingleton::countObjectsOfType
Also convert code to use this new method
2025-01-13 18:55:15 +01:00
Chris Hennes
ea7e17ba00 Merge pull request #18126 from Ondsel-Development/core_LCS2
Core datums : Card2 : Core implementation
2024-12-06 12:12:04 -05:00
Jiří Pinkava
e06ce1189c [PartDesign]: Sort sketches in Attach sketch tool alphabetically
The order of sketches in sketch attaching tool is now determined
by the order in which they were added to document.
Sorting them alphabetically makes IMHO much easier to find a sketch
by user, compared to current state, especially in large and complex
projects with lot of sketches. Of cuser thix expects the user
use sensible names for the sketches.
2024-12-06 11:52:59 -05:00
PaddleStroke
8f43f3cc8b Core: Rename 'OriginFeature' file to 'Datums' 2024-11-26 15:36:48 +01:00
mwganson
4e5f91ceed [Sketcher] Address issue #17629, where Attach sketch command allows sketch to be attached to itself 2024-11-05 14:41:00 +01:00
Max Wilfinger
8ff5a1f688 Fix source string typos mentioned on Crowdin (#15261) 2024-07-08 17:18:31 -05:00
wmayer
95df9e3244 Sketcher: fix crash in CmdRenderingOrder::updateIcon()
If a parameter in the observed parameter group is changed then CmdRenderingOrder::OnChange() is called but the ActionGroup may not be created yet
2024-04-17 21:52:32 +02:00
Roy-043
f54723fc73 Sketcher: Improve menu text of Sketcher_MapSketch
The old menu text of Sketcher_MapSketch did not describe the tool very well. Not just a face can be selected.

"Map sketch to face..." -> "Attach sketch..."

Forum topic:
https://forum.freecad.org/viewtopic.php?t=86112
2024-03-28 12:05:08 +01:00
Chris Hennes
9df1472e43 Sketcher: Translate QWidgetAction items
Explicitly set the context used by tr() to fix missing context without it.
2024-03-11 18:17:32 +01: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
wmayer
31ed14db83 modernize C++: use noexcept 2023-08-07 16:06:58 +02:00
wmayer
6ff3ee9951 Sketch: modernize C++: use override 2023-08-04 17:09:53 +02:00
Roy-043
df102ed005 Sketcher: Minor improvements to some GUI texts 2023-06-07 19:51:19 +02:00
Abdullah Tahiri
78ae9c1d7d SketcherGui: apply clang-format 2023-05-25 17:08:03 +02:00
Roy-043
254cec4067 Sketcher: Improve grid and snap related GUI texts
- Always use sentence case (as elsewhere in Sketcher)
- 'Toggle grid' instead of 'Activate grid'.
- Some other minor changes.
2023-05-25 14:10:45 +02:00
Abdullah Tahiri
2bc3295cf3 Sketcher: Obey non-intrusive preferences for modal pop-ups
==========================================================

This commit turns the remaining blocking pop-ups in which the user can only click "ok"
into non-intrusive notifications, depending on the user preferences in settings.
2023-05-24 18:35:41 +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
Chris Hennes
d002fb4e8e Sketcher: Translate the menu entries in attach dialog 2023-04-28 19:09:45 -05: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
Chris Hennes
ba57b420d1 Sketcher: Translate the attacher GUI dropdown 2023-04-22 15:12:15 +02:00
Edoardo Morandi
3a6464d3ba fix: uninitialized class variable
This specific boolean variable could be used uninitialized. Assigning it
a default value is cheap and it avoids the issue.
2023-04-16 00:59:16 +02:00
Abdullah Tahiri
40ed989991 Missing overrides 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
1db929e702 Refactor of CmdSketcherSnap and SnapSpaceAction to reduce verbose calls to retrieve preference parameters 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
53304af62c Refactor parameter in a single place 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
669b2d0993 Prevent unnecessary update of snapAngle, block signals when auto updating 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
3975d4bb34 Remove unnecessary ViewProvider retrieving and checking, as it is unused 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
febaca9070 Rename preference parameter 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
e5e1f54729 Remove left-over code 2023-03-19 19:14:22 +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
0penBrain
f1bd743b1b Sketcher/Grid: fix error in parameter function call
Sketcher/Grid: fix algorithm computing the automatic grid spacing

Sketcher/Grid: forcefully redraw grid when one of its parameter is changed

Sketcher/Grid: always authorize user to change grid spacing, even if 'auto spacing' is enabled

Sketcher/Grid: apply a default factor of 10 for 'auto spacing' if number of subdivision is 1
2023-02-25 23:13:55 +01:00
Abdullah Tahiri
f486ee74a4 Sketcher: Grid - correction of design decisions
===============================================

Removal of ViewProviderGridExtension properties:
-GridStyle
-GridSnap

Improvement of ViewProviderGridExtension API:
- color via App::Color

Toolbar grid command:
- Conversion of Snapping to edit parameter
- Snap gets a class enum to support future Snapping functionalities as edit parameter

Sketcher Settings:
- Removal of snap preference

Behaviour:
- ShowGrid, GridAuto, GridSize preferences do not change any existing VP. They apply to any newly created sketch.
- Do not limit grid to hardcoded values

Snap to grid:
- Code updated to use closestpoint functionality provided by the extension,

Several other fixes
2023-02-25 23:13:55 +01:00
Abdullah Tahiri
0f6ac5e40a Sketcher: command - review code improvements 2023-02-25 23:13:55 +01:00
Abdullah Tahiri
279b684e56 Sketcher: Grid Command - Correct dependencies 2023-02-25 23:13:55 +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
Abdullah Tahiri
fe405fcefb Sketcher: Refactor miscelaneous command isActive() 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
e24daabf1f [Sketch] Gui: A - D: remove unused headers
- also some sorting
2022-12-11 23:47:03 +01:00
wmayer
cbac99a8ed Sketcher: [skip ci] remove unused includes 2022-09-25 11:09:29 +02:00
0penBrain
c910ff6509 Sketcher/BackEdit: makes clip plane switch side according to view side 2022-09-09 16:09:42 +02:00
berniev
180edfa3cc Mod: Single arg ctors must be explicit 2022-08-24 16:55:20 +02:00
berniev
71dc5ead2f Mod: Use override etc 2 2022-08-09 12:52:26 +02:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
53ba98d636 Mod: use empty 2022-08-06 19:30:13 +02:00
Uwe
0399b3f087 [Sketch] remove superfluous nullptr checks 2022-07-18 02:51:49 +02:00
Zheng, Lei
8bec44934b Fix mixed line endings 2022-04-26 12:52:55 -05:00
Chris Hennes
589369a2cc Sketcher: PR6497 move return statement to new line 2022-03-29 13:25:06 -05:00