Commit Graph

58 Commits

Author SHA1 Message Date
wmayer
c2694fd7d9 Base: cppcoreguidelines 2023-11-24 00:11:32 +01:00
wmayer
c07c7c9fc9 fix performance-*
* performance-type-promotion-in-math-fn
* performance-trivially-destructible
* performance-noexcept-move-constructor
* performance-faster-string-find
2023-11-16 01:22:09 +01:00
wmayer
5c306f6e2a fix readability-*:
* readability-uppercase-literal-suffix
* readability-named-parameter
2023-11-16 01:22:08 +01:00
wmayer
f539138dd9 fix readability-*:
* readability-const-return-type
* readability-container-data-pointer
* readability-container-size-empty
* readability-delete-null-pointer
* readability-else-after-return
* readability-inconsistent-declaration-parameter-name
* readability-redundant-member-init
* readability-redundant-smartptr-get
* readability-redundant-string-cstr
* readability-use-anyofallof
* readability-static-definition-in-anonymous-namespace
* readability-static-accessed-through-instance
* readability-simplify-boolean-expr
2023-11-16 01:22:08 +01:00
wmayer
e85c383bff Base: apply clang format 2023-11-13 12:01:26 -05:00
wmayer
ba95a534d5 Base: extend ShapeHintsItem to allow to set vertex ordering and shape type 2023-11-08 21:03:33 +01:00
wmayer
9fc5c2d8e4 Base: fixes #10462: mesh.unite() causes segementaion fault 2023-09-03 11:14:34 +02:00
wmayer
db0f6534c3 Base: modernize C++: use equals default 2023-08-20 18:10:17 +02:00
Abdullah Tahiri
e3702ac2d8 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
c604d1741d 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
2fa8fb45d8 Base: refactor InventorBuilder 2022-12-13 17:48:51 +01:00
wmayer
6e71964d4e Base: set values in constructor of NormalItem 2022-12-13 12:47:42 +01:00
wmayer
2e1ec82930 Base: remove deprecated methods of InventorBuilder 2022-12-12 20:50:59 +01:00
wmayer
f4f60d4737 Base: refactor InventorBuilder 2022-12-11 23:52:18 +01:00
wmayer
8d6255b0e8 Base: refactor InventorBuilder 2022-12-09 14:43:59 +01:00
wmayer
ffb97abfbe Base: refactor NodeItem 2022-12-05 18:35:50 +01:00
wmayer
4dc1fc8f01 Base: refactor InventorBuilder 2022-12-02 19:06:27 +01:00
wmayer
663a9e665b Base: refactor InventorBuilder and add more unit tests 2022-12-02 18:53:47 +01:00
wmayer
97ab7714fe Base: fix InventorBuilder and add more unit tests 2022-12-01 18:05:57 +01:00
wmayer
e18cb45673 Base: refactoring of InventorBuilder 2022-11-30 12:29:09 +01:00
wmayer
c16b94c669 Base: fix build failure with MSVC, overloaded operator << must be in header file 2022-11-29 18:21:12 +01:00
wmayer
c16e4670fd Base: refactoring of InventorBuilder 2022-11-29 15:20:43 +01:00
wmayer
b325ab93dc Base: refactoring of InventorBuilder 2022-11-29 13:28:00 +01:00
wmayer
567e0434e6 Base: refactoring of Builder3D/InventorBuilder 2022-11-27 20:06:00 +01:00
wmayer
16e80093c4 Base: refactoring of Builder3D/InventorBuilder 2022-11-27 18:29:58 +01:00
wmayer
c988f1d472 Base: start of refactoring of InventorBuilder 2022-11-27 16:45:16 +01:00
wmayer
8f136f60c6 Base: start of refactoring of Builder3D 2022-11-27 15:02:44 +01:00
wmayer
96606c557c Base: fix build failure with MSVC 2022-10-05 21:47:47 +02:00
wmayer
e6798c53cf Base: add helper function to convert a string of a triple of floats into Vector3f 2022-10-05 18:58:51 +02:00
wmayer
196983cf95 Base: [skip ci] optimize writing Inventor file 2022-08-28 13:01:12 +02:00
wmayer
47f69d1389 Base: [skip ci] whitespace improvements 2022-08-28 12:20:49 +02:00
marioalexis
4cd8e2e93f Base: Fix warning -Wrange-loop-construct 2022-08-28 12:04:21 +02:00
wmayer
89ad254b7c Base: support of SoFaceSet in InventorLoader 2022-08-26 14:51:43 +02:00
wmayer
8b7f721cd0 Base: implement loading of OpenInventor files (currently only SoIndexedFaceSet is supported) 2022-08-26 12:39:04 +02:00
wmayer
5014bab534 Mod: replace std::ifstream/std::ofstream with Base::ifstream/Base::ofstream 2022-08-21 12:46:53 +02:00
berniev
8aff4a7503 Base: Modernise ctors dtors defs etc 2022-08-02 12:37:46 +02:00
Uwe
53571f7196 [Base] remove superfluous nullptr checks 2022-07-18 03:16:22 +02:00
wmayer
a427c1e99e Base: [skip ci] fix slight regression caused with d162d9371 2022-06-30 13:13:00 +02:00
mosfet80
d162d9371c 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
6b09da9ab6 [Base] remove unnecessary Boolean comparisons 2022-06-19 15:17:50 +02:00
wmayer
58a719e207 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
1eeb1fecd0 [Base] BoundBox etc.: remove unused includes 2022-03-02 13:59:59 +01:00
wmayer
4d87039635 Base: modernize C++11
* remove redundant void-arg
* use nullptr
* replace deprecated headers
2022-01-25 20:21:30 +01:00
luz paz
d5f6c096b8 Base: Fix header uniformity, whitespace, and doxygen
[skip ci]
2020-11-22 18:12:16 +01:00
wmayer
12670655a9 Coverity: Uninitialized scalar variable 2020-07-20 17:34:23 +02:00
wmayer
492d3c5c06 Base: [skip ci] support of spheres in InventorBuilder 2020-04-08 18:01:13 +02:00
luz.paz
6f11ed298a 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
f27e4590a6 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
1f3d2389bc 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
3579f38d62 Builder3D: doxy typo/grammar fixes
[skip ci]
2017-12-04 08:20:55 -05:00