Commit Graph

1700 Commits

Author SHA1 Message Date
wmayer
712ad544a5 App: fix some lint warnings 2023-04-07 12:41:46 +02:00
berniev
38f4f3a2fc simplifying a function
Dramatic simplification of legacy code by separating code and data and applying some later C++.
Function removed from Application.cpp as it was in a anonymous namespace and could not easily be subjected to unit testing.
Added ProgramOptionsUtilities.h
2023-04-07 12:37:05 +02:00
0penBrain
8dcbd7080e Expression: use a precision that ensures no floating point issue 2023-04-05 19:51:51 +02:00
wmayer
03b58bb289 Core: make the init scripts more robust against invalid package.xml files
See also: https://forum.freecad.org/viewtopic.php?t=77170
2023-03-28 10:49:21 +02:00
CarlOlson
3e139a2eb1 add generated code chnages, remove unused file and add bison *.output to gitignore 2023-03-26 18:48:59 +02:00
CarlOlson
b778a28b8a update expression grammar to handle parens around cond 2023-03-26 18:48:59 +02:00
wmayer
a2579ebb92 Core: support to load old project files containing image planes
See forum: https://forum.freecad.org/viewtopic.php?p=670545#p670545
2023-03-26 13:51:07 +02:00
Chris Hennes
249b7db3dd Merge pull request #9012 from wwmayer/fix_from_string
App: in PropertyPythonObject::fromString only assign a dict to __dict…
2023-03-25 12:32:44 -05:00
Chris Hennes
3b6cbc3f67 Merge pull request #8974 from chennes/toponamingMappedElement
App/Toponaming: Add MappedElement
2023-03-25 10:56:55 -05:00
Chris Hennes
d871779299 App/Toponaming: Add tests to MappedElement 2023-03-24 10:05:09 -05:00
wmayer
da295a7317 App: in PropertyPythonObject::fromString only assign a dict to __dict__ attribute 2023-03-24 14:43:38 +01:00
Syres916
fb3200e847 [App] Urgent Backout commit 0998756
09987560c3 Humble apologies, back to the drawing board and more testing required.
2023-03-23 15:04:38 +00:00
Chris Hennes
b4d41291dc App/Toponaming: clang-tidy cleanup of MappedElement 2023-03-23 09:46:33 -05:00
Chris Hennes
320d06239e App/Toponaming: Add MappedElement class 2023-03-23 09:46:32 -05:00
Chris Hennes
d0f46f3fd4 Merge pull request #8923 from Ondsel-Development/toponaming-p1-4
[Core] Create `ElementMap.h` and tests
2023-03-23 09:40:56 -05:00
Chris Hennes
f679823c6e Merge pull request #8955 from wwmayer/issue_8556
Move image loading to core
2023-03-22 16:00:43 -05:00
Ajinkya Dahale
776e940006 [Core] Create ElementMap and tests
Test is a dummy for now. `ElementMap.h` only contains const values.
2023-03-22 21:53:23 +05:30
luzpaz
f1bbcd9e13 Fix typos and whitespace 2023-03-22 17:10:38 +01:00
wmayer
5871c2bb46 Gui: add function to scale image 2023-03-22 16:24:51 +01:00
wmayer
13a6c3d2dc Core: move image plane to core system 2023-03-22 13:44:00 +01:00
Syres916
c9832a9f2d [App] Minor improvment to error handling for...
... a rare event, see https://forum.freecad.org/viewtopic.php?t=76947
2023-03-21 16:43:45 +01:00
Chris Hennes
5a25153f7f Merge pull request #8785 from Pesc0/master
Toponaming: Added MappedName class
2023-03-20 13:09:44 -04:00
Pesc0
6354c37041 Added all tests and minor fixes 2023-03-19 02:55:24 +01:00
Pesc0
9af5a71e92 Fixed tests 2023-03-18 19:44:18 +01:00
Chris Hennes
6c9f1a119d App/Toponaming: Finish Doxygen comments 2023-03-18 17:59:35 +01:00
Uwe
607c6e89a3 [App] [skip ci] register PropertyVelocity
- was forgotten once the property was implemented some days ago
2023-03-18 05:45:45 +01:00
Florian Foinant-Willig
d751fd6944 Fix missing python addProperty and removeProperty of Document object 2023-03-17 10:34:32 +01:00
Chris Hennes
e800ae29e1 App/Toponaming: Begin adding Doxygen comments 2023-03-17 02:21:29 +01:00
Chris Hennes
cd57046c7a App/Toponaming: MappedName clang-tidy cleanup 2023-03-17 02:21:29 +01:00
Pesc0
2ec169f2a9 MappedName unit tests almost complete 2023-03-17 01:43:34 +01:00
Pesc0
c39f603744 Added initial tests to MappedName 2023-03-17 01:43:34 +01:00
Pesc0
9200160502 Added MappedName class 2023-03-17 01:42:53 +01:00
Chris Hennes
902914aaff Merge pull request #8776 from chennes/toponamingIndexedName
App: Toponaming indexed name
2023-03-14 19:21:19 -05:00
Chris Hennes
45c0b634fa App: Clean up IndexedName and add tests
Fixes the matching algorithm when provided a vector of existing names:
The original algorithm was equivalent to a 'startswith' algorithm, when it should
have been testing for exact and complete string equality. This also does some
refactoring to rename and clarify variables and functions, simplifies some
functions by using standard library calls when possible, and addresses various
linter complaints. It also applies our current clang-format to the files.

Co-authored-by: Ajinkya Dahale <AjinkyaDahale@users.noreply.github.com>
2023-03-14 13:08:23 -05:00
wmayer
adf1651938 App: fixes #7833: Python2/3 FIXME code in App/FreeCADInit.py to be reviewed
The workaround was needed for Py2 on Windows. Since with Py3 it works as expected the workaround can be removed
2023-03-13 14:07:59 +01:00
Chris Hennes
ba34c6fb87 App: Add IndexedName class
Ported from development/toponaming.
2023-03-12 11:03:52 -05:00
Abdullah Tahiri
0e881f9f06 Gui: Remove old signal for critical messages in favour of Notification Area
===========================================================================

The former system of autoclosing messageboxes is removed in favour of the Notification Area.
2023-03-12 06:06:29 +01:00
Daniel-Khodabakhsh
071200ac8a Add various matrix related expression functions (#8603)
Adds a few new Expression functions with the goal to:

- Simplify Placement, Rotation, Vector and Matrix object creation.
- Add new matrix functions for rotation and translation.
2023-03-11 20:13:23 -06:00
wmayer
4cd2b1df29 App: add CC 3.0 licenses 2023-03-09 12:44:14 +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
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
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
Chris Hennes
acbf7e6f80 App: Minor loop cleanup in Property.h
As discussed in PR #8683
2023-02-27 23:07:27 +01:00
Uwe
62e0fee913 [App] attempt to fix compiler warnings in Property.h
- "conversion from 'size_t' to 'int', possible loss of data" in for loops by modernizing the for loops
- fix warning about uninitialized variable
2023-02-27 02:20:01 +01:00
Uwe
7b851646e2 [App] sort units in FreeCADInit.py 2023-02-27 00:12:06 +01:00
Uwe
4f87850788 [App] [skip ci] some comment fixes
- also a sorting fix
2023-02-26 23:19:19 +01:00
Uwe
0f2df33396 [App] register all available unit properties
- was missing in #6717
2023-02-26 19:12:25 +01:00
Uwe
ead3e5a3e6 [App] sort properties
- to keep better the overview
2023-02-26 18:07:41 +01:00
M G Berberich
9c1d80d9e6 add cbrt (cube root) to expressions (#8629)
This adds a function cbrt(arg) to the freecad-expressions that computes
the cube root of arg. Instead of arg^(1/3) this handles the units of the
argument, so that one can compute units from p.e. ml to mm.
  cbrt(27 ml) → 30 mm
instead of
  (27 ml)^(1/3) → 30
2023-02-26 17:49:58 +01:00