This makes use of the recent additions to `TaskPanelPython` and
`UiLoader`, cf. #8602, to retranslate the UI without having to close and
reopen it again.
Retranslation of the part from the UI file is now handled by FreeCAD
internally, but the tool tips from the property descriptions still need
to be reassigned with the translated versions.
============================================================
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.
==================================================
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.
=====================================================================
- Refactor scenograph creation to enable local update
- Support to perform a local update
=================================
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.
=====================
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.
==============================================================================
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.
* If the compound contains solids then other shape types like faces or edges are ignored
* If the compound contains no solids but faces then edges are ignored
* If the compound contains no faces but edges then vertexes are ignored