Commit Graph

67 Commits

Author SHA1 Message Date
Benjamin Bræstrup Sayoc
0bfae905d9 [TechDraw] Move CenterLine into own file 2023-04-06 13:51:35 -04:00
Benjamin Bræstrup Sayoc
1f0ba98de5 [TechDraw] Move CosmeticVertex into own file 2023-04-06 13:51:35 -04: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
wandererfan
704fb894a5 [TD]getters and setters for geometry
- make attributes private (or protected) and use
  getters and setters instead of accessing attributes
  directly.
2023-02-28 08:15:06 -05:00
Uwe
01c7df9f4f [TD] A* - C*: remove unused includes
- also sort includes
- also sort PreCompiled.h
2022-10-03 23:05:36 +02:00
marioalexis
87dfe33833 TechDraw: Replace C cast 2022-09-18 11:06:51 -05:00
wandererfan
2dfc8667b6 [TD]default LineFormat ctor 2022-09-07 16:06:54 -04:00
wandererfan
aa2b1b8392 [TD]CI clang warnings 2022-09-05 17:48:38 -04:00
wandererfan
6bb936e87c [TD]cosmetic vertex size consistency 2022-08-28 13:13:20 -04:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
Benjamin Bræstrup Sayoc
f30c30b06f [TechDraw] Simplify code getting default line weights 2022-08-02 16:13:01 -04:00
Uwe
7b4e5d7522 [TD] remove more superfluous nullptr checks 2022-07-20 02:32:52 +02:00
Uwe
36add10c86 [TD] App: remove some superfluous nullptr checks 2022-07-19 02:03:50 +02:00
Benjamin Bræstrup Sayoc
f7c236a071 [TechDraw] Gather rotation calculations in a single function 2022-07-16 16:00:10 -04:00
Benjamin Bræstrup Sayoc
dd4e7ff159 [TechDraw] Improve readability of Cosmetic.cpp 2022-07-16 16:00:10 -04:00
Benjamin Bræstrup Sayoc
6356459ab6 [TechDraw] Refactor CosmeticEdge constructors
Use constructor delegation and default parameters for CosmeticEdge
2022-07-16 16:00:10 -04:00
Benjamin Bræstrup Sayoc
a5e10cc49b [TechDraw] Use constructor delegation for CosmeticEdge 2022-07-16 16:00:10 -04:00
Benjamin Bræstrup Sayoc
95f1c6f240 [TechDraw] Use default parameters for LineFormat constructor 2022-07-16 16:00:10 -04:00
Wanderer Fan
1c97b3d5df [TD]fix ExtendShorten handling of CenterLine 2022-04-23 18:43:27 -04:00
Uwe
19c8a76c62 [TD] App Headers: remove unused header - part 3/3 2022-03-25 01:13:34 +01:00
wmayer
e8f9c8a1d3 TD: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
Wanderer Fan
855941d5bb [TD]fix misplaced section line
- BRepBndLib::Add results in wrong bbox center.
- replaced with BRepBndLib::AddOptimal
2022-03-03 09:31:29 -05:00
edi271
1a8e88eeec [TD] Move Circulation method to DrawUtil 2022-01-21 11:22:40 -05:00
Wanderer Fan
28c5890bc9 [TD] avoid memory leaks by using shared_ptr
TD geometry objects are sometimes double deleted.  This
change uses shared_ptr instead of raw pointers to manage
deletions.
2022-01-07 13:34:20 -05:00
wmayer
3fa4a321d3 TD: replace usage of raw pointers of Vertex and Face with shared pointers.
This fixes issue 4741: Broken File After Using Landmark Dimension in TechDraw
2021-12-10 14:25:24 +01:00
wmayer
5dbf7e93d7 Gui: fix -Winconsistent-missing-override, TD: fix -Wunused-parameter 2021-08-21 12:15:43 +02:00
Uwe
50da5a74d8 Update src/Mod/TechDraw/App/Cosmetic.cpp
Co-authored-by: 0penBrain <48731257+0penBrain@users.noreply.github.com>
2021-08-03 13:23:14 +02:00
donovaly
e9a94d1e78 [TD] comment the new centerline behavior
add missing info to understand the new centerline behavior as introduced with commit d1476c64
2021-08-03 13:23:14 +02:00
donovaly
2bc5ac2e4b [TD] fix centerline crashes and bugs
the PR fixes the following things:
- change the way centerlines between 2 lines are calculated. The current implementation leads to many bugs and even crashes (e.g. when the 2 selected lines are parallel ones of a square). There are different forum threads from the last 1.5 years.
The new endpoint line sorting is the one described here: https://forum.freecadweb.org/viewtopic.php?f=35&start=20&t=44255&sid=989a668890f954c13ef81e4a04ee6912#p501179

- as consequence the erroneous and misleading line end flipping can go and is removed (only used internally)

- when creating a new centerline, you see it immediately

- when creating a new or editing an existing centerline and press Cancel, the creation/editing is aborted

- fix crash when the 2 selected lines are bot horizontal and one tries to create a vertical centerline

- fix crash when changing the orientation  of an existing centerline and the result would be invalid

- cleanup the code a bit
2021-05-15 05:21:29 +02:00
donovaly
4bae944950 [TD] make LineGroup selectable
At the moment one has to specify the LineGroup as string. But one doesn't know what groups exist. So one has to check the Wiki, learn there where the groups are defined and then open the definition file with a text editor.

This PR simplifies this by reading the existing groups out of the definition file and fill the combobox accordingly.
It also give the user info what the selected LineGroup defines via the tooltip.

A nice side effect is that no typos can occur since you don't have to enter the LineGroup name as text.
2020-12-03 17:24:49 +01:00
wandererfan
fa111f86ad [TD]draw line through 2 points 2020-08-19 09:02:25 -04:00
wmayer
4807fd3b33 PVS: V730 Not all members of a class are initialized inside the constructor 2020-07-18 10:59:27 +02:00
wandererfan
862b2cdf83 [TD]makeCosmeticLine Y inversion 2020-07-12 09:04:59 -04:00
wandererfan
94e5f205ee [TD]CosmeticVertex default size 2020-06-23 08:21:13 -04:00
wandererfan
476b19590b [TD]Fix CosmeticVertex size 2020-06-09 16:12:14 -04:00
wandererfan
eaf2f0e8a4 [TD]Simplify Cosmetic List & PyObject handling 2020-05-16 07:42:45 -04:00
wandererfan
a3029fec74 [TD]Centralize preference getters 2020-04-24 11:13:49 -04:00
wandererfan
26ea08e8c5 [TD]Fix handling of CL flip parameter 2020-03-21 09:40:22 -04:00
wandererfan
cb2a3d529c [TD]Landmark Dims initial impl 2020-02-25 17:21:00 -05:00
wmayer
f23188a99e TechDraw: [skip ci] fix 'copy-constructor' of CenterLine 2019-12-17 12:41:14 +01:00
wandererfan
8cbcd243e6 [TD]Py routines for CenterLines 2019-12-16 20:36:10 -05:00
wandererfan
b54212f82c [TD]Python routines and extension for line formating 2019-12-16 20:36:10 -05:00
wandererfan
f63cd9255a [TD]Python routines & extension for CosmeticVertex 2019-12-16 20:36:10 -05:00
wandererfan
e64929de14 [TD]const-ness for dump function parameter 2019-11-10 15:58:45 -05:00
wandererfan
a7c491e639 [TD]Fix wrong default for parameter 2019-11-07 16:59:10 -05:00
wandererfan
44b1f46858 [TD]Allow skip restore cosmetics
- temporary work around due to format changes during v019
  devl
2019-11-06 20:31:02 -05:00
wandererfan
cf94e56905 [TD]Save geometry and tag with centerline 2019-11-06 20:31:02 -05:00
wandererfan
f539a0ea8c [TD]use UUID for CosmeticEdges instead of indices 2019-11-06 20:31:02 -05:00
wandererfan
b34eb9de77 [TD]Implement unique tags for Cosmetic Vertex 2019-11-02 14:59:32 -04:00
wandererfan
88b07896e6 [TD]Extent Dimensions 2019-11-02 14:59:32 -04:00