Commit Graph

30758 Commits

Author SHA1 Message Date
marioalexis
3e61ca0fbb FEM: Add cylinder filter function 2023-03-08 17:16:41 +01:00
xtemp09
eda50c13b0 [Mesh] Minor code update
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.
2023-03-08 13:20:45 +01:00
berniev
6c9d7ebc7a an example of using constexpr array for data
simplifies code and removes the need for a class.
2023-03-07 23:22:44 +01:00
ronnystandtke
939ff4468f Bug fixes and improvements for workbenches settings (#8725)
* removed header strings from ui file so that they can be dynamically set from cpp file
* use enum for column numbers
* only replace load button with loaded indicator (much faster and checkboxes no longer get unselected by loading a workbench)
* improved i18n (allows better positioning of argument for translators)
* improved column ordering (buttons and checkboxes much closer to icon and name)
* fixed variable camelCase (checkbox -> checkBox)
* exit for-loop if button was found
* added check for nullptr
2023-03-07 12:42:22 -06:00
xtemp09
3ecd69e0c5 [FEM] Replacement of hardware_concurrency() with idealThreadCount()
I encountered problems with std::thread::hardware_concurrency() with mingw-w64 < v8.1.

QThread::idealThreadCount() is a better alternative.
2023-03-07 17:41:35 +01:00
Abdullah Tahiri
ee0c3ad5c1 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
Abdullah Tahiri
7643c35c3f App: DocumentObject - New full label member function
====================================================

Before this commit there is a function getFullName(), which
produces a string in the form document#objectname. For "document"
the real name of the document is taken, whereas for objectname it
is the initial name (Sketch, Sketch001), not the label.

The new function fo this commit, getFullLabel(), provides a string
documentlabel#documentobjectlabel, that are
probably easier to identify for end users.
2023-03-07 16:13:23 +01:00
Yorik van Havre
bb1b61dac9 Merge pull request #8759 from marioalexis84/tools-generate
Tools: Update generateDS.py file to Python3
2023-03-07 14:44:07 +01:00
wmayer
3cafc5e782 Gui: Add download location to side bar of file dialog 2023-03-07 14:41:26 +01:00
wmayer
be7e78aaf9 Gui: fix regression with the default visibility of toolbars
If the user e.g. activates the Clipboard toolbar then it should not be hidden any more if the user switches to another workbench.
The way it is now the user has to make this toolbar visible over and over again when changing the workbench. This also has the negative effect that
the workbench selector changes its position
2023-03-07 10:43:12 +01:00
wmayer
0e6cf0d9dd Part: set minimum angular deflection to 1 deg
See also forum: https://forum.freecad.org/viewtopic.php?t=76614
2023-03-07 10:41:38 +01:00
edi271
9fb39b63a7 [TD] Solve two issues in CmdHoleShaftFit 2023-03-06 20:02:21 -05:00
marioalexis
8fa5cc2821 Tools: Update generateDS.py file to Python3 2023-03-06 17:54:27 -03:00
wmayer
35300b5295 Qt6: port template and Cloud module to Qt6 2023-03-06 12:25:55 +01:00
Jonas Bähr
0397618094 PD: Retranslate InvoluteGear's Task Panel on language change
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.
2023-03-06 00:19:04 +01:00
mosfet80
5e534b9e83 fix commit 2023-03-04 17:51:43 -06:00
mosfet80
206931ccc1 Revert addonManager 2023-03-04 17:51:43 -06:00
mosfet80
654f32dc07 remove python2 import 2023-03-04 17:51:43 -06:00
mosfet80
bed7b76524 remove Python2 code 2023-03-04 17:51:43 -06:00
wmayer
4b4718dd17 App: using fmtlib causes a linking failure together with boost's graphviz classes
To fix this failure a workaround is move the graphviz handling from Document.cpp to a separate source file
See also: https://github.com/FreeCAD/FreeCAD/pull/8350
2023-03-04 19:08:11 +01:00
xtemp09
692399787b [TechDraw] Improved readability of DrawViewSpreadsheet.cpp
I was stretching my fingers
2023-03-04 09:59:02 -05:00
wmayer
977e726f47 Part: extend command Part_PointsFromMesh to support any geometric type 2023-03-04 14:44:58 +01:00
Adrian Insaurralde Avalos
2d68ad5e7a [Gui] Split "File" toolbar and add "Clipboard" toolbar
"File" is split into "File", "Edit" and "Help"
"Clipboard" is hidden by default
2023-03-03 22:47:11 -06:00
Adrian Insaurralde Avalos
8200cde106 [Gui] ToolBarManager: add feature to make toolbars hidden by default 2023-03-03 22:47:11 -06:00
Syres916
1ad4eef455 [Gui] Recent macros, improve wording of Hint msg 2023-03-03 20:29:38 -06:00
Syres916
858a1d23a3 [Gui] Recent macros, enhance warning msg
See discussion : https://forum.freecadweb.org/viewtopic.php?f=3&t=75350
2023-03-03 20:29:38 -06:00
wmayer
28a9830b85 FEM: implement interface of ComplexGeoData 2023-03-03 18:17:54 +01:00
Chris Hennes
f9ed455922 OpenSCAD: Improve shape-checking in group action 2023-03-03 10:11:20 -06:00
luzpaz
5e9539cd9c Fix typos [skip ci] 2023-03-03 09:09:26 -06:00
wmayer
aedaefe5b2 Sketcher: remove unused private field 'form' 2023-03-02 22:44:04 +01:00
Abdullah Tahiri
2896c1445a Sketcher: Remove Edit Controls from the TaskBar 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
d86686029c 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
d1be41efe0 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
dbdd04e05b Sketcher: Elements Widget - Add Visual Layer metadata 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
630ed6b470 Utils: setSafeGeomLayerId 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
b6b897c0bf Utils: getGeoIdsOfEdgesFromNames 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
93143c680c EditCoinManager: Refactor and extend layer support to use VisualLayerList property and ViewProviderSketchGeometryExtension 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
16b029f729 EditCoinManager: Apply Visual Configuration configuration 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
57bad38993 ViewProviderSketch: update geometry layer configuration on visual layer property change 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
5caaf174d4 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
f2d6b287ab Sketcher: ViewProviderSketch
============================

Adding PropertyVisualLayerList to ViewProviderSketch
2023-03-02 20:42:48 +01:00
Abdullah Tahiri
6a3d751352 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
e0a5d3d017 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
c2e0c86d93 Utils: New Function to retrieve the VisualLayerId 2023-03-02 20:42:48 +01:00
Abdullah Tahiri
873e34cd6e 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
wmayer
a7c37aacb0 Part: Compute center of gravity for compounds
* 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
2023-03-02 19:34:18 +01:00
Chris Hennes
24446e5e2d Addon Manager: Correct typo 2023-03-01 21:21:37 -06:00
mosfet80
d50f1c9b3e Merge branch 'master' into removeGZstream 2023-03-01 19:43:56 +01:00
Andrew
ace46189c2 remove unused FDstream file 2023-03-01 12:28:00 -06:00
wmayer
5774721284 Test: expected failure of Rotation::setValue() in unit tests 2023-03-01 18:43:15 +01:00