Commit Graph

2581 Commits

Author SHA1 Message Date
Abdullah Tahiri
8d33a24092 Remove unnecessary ViewProvider retrieving and checking, as it is unused 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
65ec96d12d Rename angleSnapEnabled to angleSnapRequested for consistency with the other snap flags 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
75fd0dbc73 Remov warning -squash group by meaningful groups 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
e763fd3d80 Remove warning - SnapManager initialisation order in constructor different from class declaration 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
41408b411f Encapsulate interface data members 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
50b3662535 Rename preference parameter 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
af0f4b10f6 Remove left-over code 2023-03-19 19:14:22 +01:00
Paddle
de57296576 Sketcher: Snap: Add 'Snap at angle' to Arc of Ellipse DSH. 2023-03-19 19:14:22 +01:00
Paddle
4922a48997 Sketcher: Snap: Add 'Snap at angle' to Ellipse DSH. 2023-03-19 19:14:22 +01:00
Paddle
7b7368b04b Sketcher: Snap: Add 'Snap at angle' to Line DSH. 2023-03-19 19:14:22 +01:00
Paddle
e62d6b854b Sketcher: Snap: Add 'Snap at angle' to Arc DSH. 2023-03-19 19:14:22 +01:00
Paddle
7d97a5d8da Sketcher: Snap: Add 'Snap at angle' support to DrawSketchHandler. 2023-03-19 19:14:22 +01:00
Paddle
0f274c2e07 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
flachyjoe
21c2eb6014 Sketcher: Add circle to circle distance constraint 2023-03-19 14:05:35 +01:00
Paddle
5090cf3436 Sketcher: Constraint Widget: Change showHideButton from QPushButton to QToolButton to avoid style problems. 2023-03-18 18:22:21 +01:00
Abdullah Tahiri
64eb85b1ea ElementWidget: remove unnecesary element pointer
================================================

This should fix this (I cannot reproduce it):
https://forum.freecad.org/viewtopic.php?p=667579#p667579

Lately I added the geometry pointer to the item. This has indeed
the potential for an already deleted pointer being accessed.

This PR removes the geometry pointer from the item and relies on the
ViewProvider to indirectly access an updated pointer.
2023-03-18 11:32:22 +01:00
Abdullah Tahiri
522679321c ElementWidget: reorganise implementation class declarations 2023-03-18 11:32:22 +01:00
Abdullah Tahiri
3f19bcbeef Sketcher: Elements Widget - Fix crash when moving external geometry to another layer
====================================================================================

As reported:
https://forum.freecad.org/viewtopic.php?p=667426#p667426

Support for moving external geometry to another layer will come in the future.
2023-03-18 07:45:04 +01:00
Abdullah Tahiri
5242f6d048 ElementsWidget: Move ElementFilterList to implementation
========================================================

Only moving code from header to implementation.
2023-03-18 07:45:04 +01:00
Abdullah Tahiri
7cc3fe480c ElementsWidget: Move Delegate to implementation
===============================================

Only moving code from header to implementation.
2023-03-18 07:45:04 +01:00
Paddle
66ab1e3bf3 Sketcher: Add parameter observer for system unit, such that the view is updated when user change the unit system through the sizeLabel widget. 2023-03-17 14:04:24 +00:00
Paddle
d09b1e1499 Sketcher: Solver Message simplification 2023-03-14 16:28:14 +01:00
Abdullah Tahiri
5b3c86d8e3 Sketcher: Constraint - notification and internal geometry command clean up
==========================================================================

- Migration of all constraints to the new non-intrusive notification framework.

- Removal of internal geometry command

- Command to create manually internal geometries is removed (deprecated).
2023-03-13 16:21:01 +01:00
wmayer
580b775690 clang: fix -Wunused-parameter, -Wunused-variable, -Wswitch 2023-03-12 15:05:21 +01:00
Abdullah Tahiri
340ccb8ed6 Sketcher: SketchObject using the new notification system
========================================================

- CriticalMessage old signal is reconverted to new notification system. This enables to remove the obsolete old system.

- An example of how common errors can be provided with translation support is added, so that App notifications appear
translated in the NotificationArea.
2023-03-12 06:06:29 +01:00
Uwe
adb972319f [Sketch] reverse commit 944c02f12b
- as discussed in #8838 (the PR will be improved after the weekend)
2023-03-11 17:26:42 +01:00
Paddle
944c02f12b Sketcher: Solver Message Widget simplification. 2023-03-11 16:08:16 +01:00
Abdullah Tahiri
f99e76056e Sketcher: Remove "Show Edit Section" from preferences
=====================================================

In a previous commit the Edit Section and its preferences where removed, however
Adrián Insaurralde realised that the setting for showing or not this section had been left behind:
https://github.com/FreeCAD/FreeCAD/pull/8716#issuecomment-1462364487

This commit just removes that settings.
2023-03-10 18:19:28 +01:00
Abdullah Tahiri
8569a4fb30 Sketcher: Remove references to non-existing icons
=================================================

User Syres realised that some commands that are in use by the solver messages url referenced non-existing icons, which
triggers errors in the report view while customising:
https://forum.freecad.org/viewtopic.php?p=666167&sid=16ac6777c440d632e5f60083fb4327ca#p666167

This commit removes them.
2023-03-10 18:18:58 +01:00
luzpaz
6802bed99d Fix various typos and whitespace 2023-03-10 14:40:46 +01:00
wmayer
45e3d0be96 Sketch: export GeoListModel::getGeoListModel to fix linking error with MinGW 2023-03-09 19:38:40 +01:00
Abdullah Tahiri
c604d1741d Console/ILogger: Refactor and extension
=======================================

Refactor:
 - Substitute the use of variadic templates with parameter packs.
 - Use recently incorporated external library "fmt" to handle printf like formating.
 - Extensive cleaning of pragmas and unnecessary forward declarations.
 - Parameter packs and libfmt provide a much stronger type checking now, so
   conversions that are by standard implicit as bool to int need an explicit static_cast
   to avoid compilation warnings.

Extension:
 - Include a notifier field, so that the originator of the message can be provided. E.g. Document#DocumentObject
 - Include a new type of message called CriticalMessage, this message is intended to have
   special behaviour in the future. Namely, it will be used to notify forward compatilibity issues.
   It will be used to substitute the current signal/slot mechanism.
 - Include two new types of messages for user notifications (Notification and TranslatedNotification). This messages
   will be use to convey UI notifications intended for the user (such as non-intrusive message about the usage of a tool). There
   are two versions to mark whether the string provided as a message is already translated or not. When using the console system for
   notifications, these notifications may originate from the App or the Gui. In the former, it is generally the case that the strings
   of messages are not (yet) translated (but they can be marked with QT_TRANSLATE_NOOP). In the latter, often the messages to be provided
   are already translated.

Python support for CriticalMessage, Notification and TranslatedNofification, including shortcuts:

    Crt = FreeCAD.Console.PrintCritical
    Ntf = FreeCAD.Console.PrintNotification
    Tnf = FreeCAD.Console.PrintTranslatedNotification
2023-03-07 16:13:23 +01:00
wmayer
94d89e53c2 Sketcher: remove unused private field 'form' 2023-03-02 22:44:04 +01:00
Abdullah Tahiri
41a7b146f5 Sketcher: Remove Edit Controls from the TaskBar 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
74f136bbac Sketcher: TaskSketcherElements - Very Basic Layer Management
============================================================

This class needs quite some rework, as it is mixing model-view model and item model.

Eventually, the whole needs to be moved to a QTreeWidget for layers' implementation.

This commit:
1. Moves back implementation only class item to the cpp file.
2. Adds a contextual submenu to change the selection from one layer to another in the
naive fixed 3 layer implementation.
3. Adds checkboxes to hide geometry.

It is the minimal modification to enable a user work with the 3 layer implementation.
2023-03-02 20:42:48 +01:00
Abdullah Tahiri
a32a49d2de ViewProvider: 3 fixed visual layers implementation
==================================================

Naive 3 layer implementation to enable the removal of current rendering order.

Layers is conceived to be much more powerful, when combining User Layers, which
work at structural level (conceptually grouping of geometry by the user) and visual
layers (which control the representation of parts of User layers).

However, that implementation will take quite some time and effort to get it right.

This commit enables 3 layers:
1. Normal layer (legacy one)
2. Discontinuous layer (experimental layer which discontinuous edges)
3. Hidden layer (a normal layer which is hidden)

One geometry can be added to one and only one visual layer at a given time.

So this enables to hide geometry (by assigning it to the hidden layer), which is
useful for selection when lines are overlapping, acting as a work-around for the
rendering order. It also allows to rework the rendering order (without the user
being affected), which is also necessary for the final visual layers implementation.
2023-03-02 20:42:48 +01:00
Abdullah Tahiri
ddd1ab43d8 Sketcher: Elements Widget - Add Visual Layer metadata 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
0f1e10d0db Utils: setSafeGeomLayerId 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
6e763b678a Utils: getGeoIdsOfEdgesFromNames 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
d01edd53a2 EditCoinManager: Refactor and extend layer support to use VisualLayerList property and ViewProviderSketchGeometryExtension 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
9478870d50 EditCoinManager: Apply Visual Configuration configuration 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
a8ebeaa27d ViewProviderSketch: update geometry layer configuration on visual layer property change 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
2f34f01c10 Sketcher: EditModeCoinManager - support to update layer configuration
=====================================================================

- Refactor scenograph creation to enable local update
- Support to perform a local update
2023-03-02 20:42:48 +01:00
Abdullah Tahiri
c75a7b524b Sketcher: ViewProviderSketch
============================

Adding PropertyVisualLayerList to ViewProviderSketch
2023-03-02 20:42:48 +01:00
Abdullah Tahiri
581327c67d Sketcher: PropertyVisualLayerList
=================================

This is a property (intended for ViewProviderSketch), containing a list of visual layer configurations.

This property enables to define and serialise the configuration of visual layers, as well as reacting to
changes to it.
2023-03-02 20:42:48 +01:00
Abdullah Tahiri
a6588536e1 Sketcher: VisualLayer
=====================

New class allowing to define a VisualLayer:
- whether it is visible or not.
- the line width to be used by coin for this layer.
- the line pattern to be used by coin for this layer.
2023-03-02 20:42:48 +01:00
Abdullah Tahiri
8dba7f1ddb Utils: New Function to retrieve the VisualLayerId 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
49586be475 Sketcher: Extend ViewProviderSketchGeometryExtension to hold the VisualLayerId
==============================================================================

In the Layers implementation there are User Layers, which have no direct impact on visualisation,
and allow to group conceptually related geometry into logical entities, and Visual Layers, which
define how geometries are visualised (or even whether they are visualised or not).

For User Layers, SketchObject is responsible for the definition of the layers, and SketcherGeometryExtension
is responsible for indicating the User Layer to which a geometry belongs (via a LayerId field).

For Visual Layers, ViewProviderSketch is responsible for the definition of the visual layers, and
ViewProviderSketchGeometryExtension is responsible for indicating the visual layer to which a geometry belongs.

With this commit, ViewProviderSketchGeometryExtension:
- takes over the responsibility of carrying a visual layer Id.
- is extended to be persistent and serialise the Id.
- is extended to be accesible from Python.
2023-03-02 20:42:48 +01:00
Yorik van Havre
46653420a6 merged crowdin translations 2023-02-27 16:01:15 +01:00
Yorik van Havre
3ad0e233d5 updated ts files 2023-02-27 15:35:51 +01:00