* 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>
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.
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
==========================================================
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.
========================
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.
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
===============================================
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
==============================
Fix unresolved issues:
https://github.com/FreeCAD/FreeCAD/pull/7754/files#r1025493443https://github.com/FreeCAD/FreeCAD/pull/7754/files#r1019077589https://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).