- was reported and automatically fixed by Qt's Designer that the size in the file is incorrect, (the sum of the widget's widths is wider than the main widget's specified size)
- vector must be initialized and vector size requires a const int
- also some sorting
- also some formatting changes to be consistent (either always "x." or "x.0")
Removal of unnecessary comparison.
`QThread::idealThreadCount()` returns the ideal number of threads that the process can run in parallel or 1 if it fails to determine it.
=======================================
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
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