Commit Graph

52 Commits

Author SHA1 Message Date
wmayer
beabfd9e06 Base: fixes #10462: mesh.unite() causes segementaion fault 2023-09-03 11:14:34 +02:00
wmayer
5610c22cbb Base: modernize C++: use equals default 2023-08-20 18:10:17 +02:00
Abdullah Tahiri
9d9f928b2d Console: Extend framework with intended recipient and content type metainformation
==================================================================================

Limitations of the current framework:
- Codes the translated state only for TranslatedNotification as part of the type.
- Does not code the intended recipient (user, developer, ...)

Problems:
- Some errors are intended for developers, some errors may only be intended for users,
if, for example, there is another developer error which already contains all the information.
The current framework may lead to information duplication or to showing to the user developer
information, which is perceived as annoying.
- Logs shall be in English (report view), while every message to the user (UI) shall be translated.
The current framework can only differentiate where to report based on subscription (legacy logs do not
subscribe to notifications), and for notifications, whether it is translated or not depends on the type.
It is not possible to code errors or warnings that are already translated.

Solution:
- To extend the ILogger interface with additional metainformation, indicating the intended recipient
(User, Developer, All), and the content of the message (translated, untranslated, untranslatable). The latter
is useful for dynamic strings that won't find a match in the translation framework.

Bonus:
- This extended version allows to do away with translatednotification, as now any message can be independently
marked as translated or untranslated or untraslatable.
- It is now possible to provide the right icon of severity (error, warning, info), even when it is only user intended
and already translated.
2023-05-23 14:24:45 +02: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
wmayer
b358407e3b Base: refactor InventorBuilder 2022-12-13 17:48:51 +01:00
wmayer
a91e6e9ba6 Base: set values in constructor of NormalItem 2022-12-13 12:47:42 +01:00
wmayer
0c8d2b237d Base: remove deprecated methods of InventorBuilder 2022-12-12 20:50:59 +01:00
wmayer
ddd54e3165 Base: refactor InventorBuilder 2022-12-11 23:52:18 +01:00
wmayer
f2f9df6d39 Base: refactor InventorBuilder 2022-12-09 14:43:59 +01:00
wmayer
baf230dcee Base: refactor NodeItem 2022-12-05 18:35:50 +01:00
wmayer
6d22c1634c Base: refactor InventorBuilder 2022-12-02 19:06:27 +01:00
wmayer
c195e15f5b Base: refactor InventorBuilder and add more unit tests 2022-12-02 18:53:47 +01:00
wmayer
e7c6262d11 Base: fix InventorBuilder and add more unit tests 2022-12-01 18:05:57 +01:00
wmayer
0349009e39 Base: refactoring of InventorBuilder 2022-11-30 12:29:09 +01:00
wmayer
4725e466f2 Base: fix build failure with MSVC, overloaded operator << must be in header file 2022-11-29 18:21:12 +01:00
wmayer
9537b3e84c Base: refactoring of InventorBuilder 2022-11-29 15:20:43 +01:00
wmayer
cf3225b50f Base: refactoring of InventorBuilder 2022-11-29 13:28:00 +01:00
wmayer
abd044fe33 Base: refactoring of Builder3D/InventorBuilder 2022-11-27 20:06:00 +01:00
wmayer
5ed096226e Base: refactoring of Builder3D/InventorBuilder 2022-11-27 18:29:58 +01:00
wmayer
f0e22410db Base: start of refactoring of InventorBuilder 2022-11-27 16:45:16 +01:00
wmayer
dafe5f11fb Base: start of refactoring of Builder3D 2022-11-27 15:02:44 +01:00
wmayer
4aefcb5cc2 Base: fix build failure with MSVC 2022-10-05 21:47:47 +02:00
wmayer
716ceecd02 Base: add helper function to convert a string of a triple of floats into Vector3f 2022-10-05 18:58:51 +02:00
wmayer
f15fe90339 Base: [skip ci] optimize writing Inventor file 2022-08-28 13:01:12 +02:00
wmayer
f4f03d022e Base: [skip ci] whitespace improvements 2022-08-28 12:20:49 +02:00
marioalexis
6f6854edd5 Base: Fix warning -Wrange-loop-construct 2022-08-28 12:04:21 +02:00
wmayer
d1b6764514 Base: support of SoFaceSet in InventorLoader 2022-08-26 14:51:43 +02:00
wmayer
9d041d8497 Base: implement loading of OpenInventor files (currently only SoIndexedFaceSet is supported) 2022-08-26 12:39:04 +02:00
wmayer
8c298493de Mod: replace std::ifstream/std::ofstream with Base::ifstream/Base::ofstream 2022-08-21 12:46:53 +02:00
berniev
15419982d4 Base: Modernise ctors dtors defs etc 2022-08-02 12:37:46 +02:00
Uwe
4b2ffd2eca [Base] remove superfluous nullptr checks 2022-07-18 03:16:22 +02:00
wmayer
316352fa50 Base: [skip ci] fix slight regression caused with 13549473e 2022-06-30 13:13:00 +02:00
mosfet80
c86f0ce670 Remove old msc ver. Freecad 0.20 require 64 bit and windows 7 or higher. For this reason, msc libraries less than 1800 will no longer be used. (#7036)
* remove msc<1800
2022-06-28 00:42:33 +02:00
Uwe
a04db55476 [Base] remove unnecessary Boolean comparisons 2022-06-19 15:17:50 +02:00
wmayer
91e4e468dd Base: move ILogger sub-classes to their own source files in order to reduce including stream classes in client code 2022-03-06 10:13:47 +01:00
Uwe
a816ee1fa1 [Base] BoundBox etc.: remove unused includes 2022-03-02 13:59:59 +01:00
wmayer
cad0d01883 Base: modernize C++11
* remove redundant void-arg
* use nullptr
* replace deprecated headers
2022-01-25 20:21:30 +01:00
luz paz
01b21e0d06 Base: Fix header uniformity, whitespace, and doxygen
[skip ci]
2020-11-22 18:12:16 +01:00
wmayer
5a45efd5f9 Coverity: Uninitialized scalar variable 2020-07-20 17:34:23 +02:00
wmayer
a5fbf61dea Base: [skip ci] support of spheres in InventorBuilder 2020-04-08 18:01:13 +02:00
luz.paz
011e5aedfa src/Base: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/Base` files
2019-12-25 11:38:58 +01:00
ezzieyguywuf
9fcc18b08e Refactor and rename ConsoleObserver...
...Renamed to "ILogger", to designate that this is an Interface for a
Logger. This "Interface" is pure virtual, so that it cannot be
instantiated directly. This makes it clear that it is intended to be
derived.

Finally, got rid of all the individual log-style methods and replaced
with SendLog. The idea here is that day-to-day users will only interact
with ILogger through ConsoleSingleton (or, likely, LoggerSingleton in
the future). This singleton will manage an arbirtary collection of
ILogger, and call SendLog with the appropriate parameters based on what
the user requests.

Therefore, the singleton itself will have the individual Log, Message,
Error, etc... methods, while stil allowing us to simplify the code base
of ILogger and its derived classes.
2019-10-20 11:46:15 +02:00
wmayer
52916175ed start to replace old C-style casts with static_cast or reinterpret_cast, avoid implicit casts 2019-09-16 17:59:18 +02:00
Unknown
9c5407d259 Builder3D: doxy typo/grammar fixes
[skip ci]
2017-12-04 08:20:55 -05:00
wmayer
6008bb1691 extend InventorBuilder 2017-10-16 11:03:21 +02:00
wmayer
fb7094bf31 use specialized exception classes 2017-04-28 18:49:11 +02:00
wmayer
56f5b9c568 + extend InventorBuilder to add an SoPolygonOffset node 2016-07-30 14:20:00 +02:00
wmayer
21e44f274b + extend Inventor builder to support material nodes 2015-12-16 16:09:31 +01:00
wmayer
c633ec4075 + make API of InventorBuilder more flexible and add new methods 2015-11-26 15:27:40 +01:00
wmayer
bbd5a882b3 + extend Inventor builder, project curve on mesh 2015-04-22 17:15:49 +02:00