=================================
Original idea of Werner:
https://github.com/FreeCAD/FreeCAD/pull/10643#issuecomment-1712966545
I really liked this syntax to avoid repetition and even explicit consideration of Types when type checking.
I thought it would be a pitty to get it lost.
Update Python tests to work with other locales
This fixes issues #10917 and #10924
Numeric values were beign compared to strings that did not take into account localizations. The test was modified to work regardless of localization.
There is still a known issue when working with pt_BR.UTF8. The default encoder for this localization is not UTF8 resulting in an error working with a parameter that returned the UTF character for the Greek letter mu in its units.
=================================================================
When in Sketcher edit mode, a tool button is activated, while the view has been changing to view of a different type, it segfaults.
This commit checks the pointer of the view to ensure correct type before activation, and refusing to activate if not of the correct type.
fixes#10809
Currently this check isn't enabled but when pushing a PR then the lint checker warns about non-explicit constructors which is
a bit annoying because the PR must be updated to fix the warning or in most cases it won't be fixed at all.
By enabling this check the developer already sees the warning before pushing a PR.
Related issue:
#5603.
Previous PRs:
#10766#10838
The remaining Plane class functions have been processed (some are unchanged):
`setup`
* Updated to use new functions.
* The `direction` etc. arguments are never used AFAICT.
* Added `from draftutils import gui_utils`.
`reset`
* Unchanged.
`setTop`
* Calls `super().set_to_top()`. That function does not use `align_to_point_and_axis` but specifies exact vectors for improved accuracy.
* `import FreeCADGui` already happens at the top of the file.
* The code block after `if FreeCAD.GuiUp:` was kept for now.
`setFront`
* Idem.
`setSide`
* This function sets the WP to the left side position, and not to the right side postion as in the Draft_SelectPlane command.
* Idem.
`getRotation`
* Revised.
* The function has an akward name as it returns a Placement.
* The special code for Arch active container is obsolete (was already commented out in other functions).
`getPlacement`
* The `rotated argument` is ignored now. It was only used in the context of the old `placement_from_face` algorithm. See `DraftGeomUtils.placement_from_face` for the new implementation.
* Calls `super().get_placement()`.
`getNormal`
* Basically unchanged.
`setFromPlacement`
* Revised to call `super()` functions.
`inverse`
* Unchanged.
`save`
* Unchanged.
`restore`
* More compact code, but basically unchanged.
`getLocalCoords`
* Calls `super().get_local_coords()` which does not rely on Draft code, but creates a matrix and returns `mtx.inverse().multVec(point)`.
`getGlobalCoords`
* Calls `super().get_global_coords()` which creates a matrix and returns `mtx.multVec(point)`.
`getLocalRot`
* Calls `super().get_local_coords()`.
`getGlobalRot`
* Calls `super().get_global_coords()`.
`getClosestAxis`
* Calls `super().get_closest_axis(vec)` which translates the vector to the WP coordinate system and then finds the closest axis by comparing the absolute coordinates of the vector.
`isGlobal`
* Not used anywhere AFAICT.
* Calls `super().is_global()` which also checks the `position` attribute.
* As before the function works without any tolerance.
`isOrtho`
* Not used anywhere AFAICT.
* The original algorithm did not work properly (there was a comment). All angles were measured relative to the global Y axis. If the WP was randomly rotated around that axis the function would still return `True`. The new algorithm, `super().is_ortho()`, uses rounded Yaw, Pitch and Roll angles to check for orthogonality.
`getDeviation`
* Not used anywhere AFAICT.
* Unchanged.
`getParameters`
* Calls `super().get_parameters()` which uses the local `_get_prop_list` function.
`setFromParameters`
* Calls `super().set_parameters()` which uses the local `_get_prop_list` function.
`_get_prop_list`
* Function used internally. Returns a list of attribute.
* Gui: added buttons to restore the default values of the selected Tab or Group
* reformatted texts for better translations
* Morphed buttons from QPushButton to QToolButton
* added code to resize items list and buttons on language change
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>