Commit Graph

66 Commits

Author SHA1 Message Date
Benjamin Bræstrup Sayoc
2aba9a86ce TechDraw: fix wrong color on edges
Fixes #20561
2025-04-07 12:05:53 +02:00
Andrea
da66720d3a REMOVE old QT<= 5.14 code
Ubuntu 22.04  use qt 1.15.3.
In the code is still used qt code <5.10.
A cleanup was done by removing qT code version used in ubuntu 18.04.
2025-03-05 09:32:06 +01:00
Kacper Donat
a72a63232a Base: Move App::Color to Base
Every basic data type is stored in Base module, color is standing out as
one that does not. Moving it to Base opens possibilities to integrate it
better with the rest of FreeCAD.
2025-02-17 21:10:26 +01:00
Benjamin Bræstrup Sayoc
79fdfb2cad Remove magic number and hard type enums in CenterLine.h
- Remove currently present magic numbers
- Hard type enums, so magic numbers can no longer be introduced. We don't want people to introduce magic numbers.
2025-02-17 12:16:49 -05:00
Ladislav Michl
0ee3c9f8e6 Base: Drop QString-std::string conversion functions from Tools
Convenience helpers function Tools::toStdString and Tools::fromStdString
were implemented for Qt4 or older to perform utf8 aware conversion as
QString::toStdString/QString::fromStdString were using toAscii/fromAscii
internally (see https://dreamswork.github.io/qt4/classQString.html).

Since Qt5 QString uses toUtf8/fromUTf8, which makes the helper functions
obsolete (see https://doc.qt.io/qt-5/qstring.html#fromStdString).
2024-12-02 23:30:53 -05:00
Max Wilfinger
7d21d9edb8 Fix source string typos mentioned on Crowdin (#15261) 2024-07-08 17:18:31 -05:00
WandererFan
b71c2a3278 [TD]Cosmetic function overhaul (#14216)
* [TD]Cosmetic geometry and tools update

- all cosmetics to store geometry in same form
- all cosmetics to survive scaling and rotation
- extension functions to survive scaling and rotation

* [TD]overhaul leader point storage and editing

- add py routine makeLeader(points)

* [TD]add leader conversion utility

* [TD]Set Leader RotateWithView default to true

* [TD]fix intersection vertex position

* [TD]add CosmeticEdge::makeLineFromCanonicalPoints

* [TD]fix 2 Extension tools

- positioning in DrawCosmeticCircle
- mishandling of points in execLineParallelPerpendicular

* [TD]Remove duplicate constexpr

* [TD]fix 2x Cosmetic arc tools

* [TD]refactor LineFormat out of Cosmetic

* [TD]move cosmetic appearance settings to LineFormat

* [TD]remove 2 unused methods

* [TD]apply format to blue line & circle tools

* [TD]fix ballon arrowhead does not rotate with view

* [TD]fix CosmeticCircle3Points

* [TD]allow multiple cosmetic object deletions

* [TD]fix extend/shorten centerline
2024-05-23 09:41:42 -04:00
wandererfan
762e1b53ff [TD]Standard Line Styles - Gui components 2023-12-01 11:27:29 -05:00
Benjamin Bræstrup Sayoc
45232752fd [TechDraw] CenterLine should use enums 2023-08-18 10:22:17 -04:00
wandererfan
6a0d3dedfb [TD]fix pathological centerline for points 2023-07-06 19:20:08 -04:00
wandererfan
970fd86705 [TD]fix #9471 - prevent impossible centerline 2023-05-07 10:00:00 -04:00
luzpaz
129d5882a7 Migrate domain name from freecadweb to freecad (#9352)
* Migrate domain name from freecadweb to freecad
* Migrate src/Mod/Material files
* Migrate Stylesheet related files
* Migrate *.svg files
* Migrate miscellaneous files
* Migrate some build files
* Migrate recently added TD AR_IRAM template files

Closes #6415
2023-04-24 15:19:20 -05:00
Benjamin Bræstrup Sayoc
ef5fc4f237 [TechDraw] Simplify return logic 2023-04-10 23:34:05 -04:00
Benjamin Bræstrup Sayoc
15fe52a04b [TechDraw] Simplify retrievement of user preferences
for all TechDraw files
2023-04-10 23:34:05 -04:00
wmayer
25a63f8750 TD: move to new style connect() 2023-02-01 01:33:34 +01:00
luzpaz
d28d63b87b TechDraw: header uniformity + trailing whitespace 2023-01-21 20:11:08 -05:00
wandererfan
12db3618df [TD]remove obsolete log messages 2023-01-13 12:15:33 -05:00
Uwe
cbd0140dcd [TD] Task*, part 2/2: remove unused includes
- also some sorting
- also take care of PreCompiled.h
2022-12-07 19:49:05 +01:00
Uwe
16abb8d548 [TD] DrawUtil: remove unused includes
- also sort includes
- also move a definition to it
- also adapt two Gui files accordingly
2022-10-08 03:35:59 +02:00
wandererfan
acf17905ed [TD]CI clang warnings 2022-09-05 17:48:38 -04:00
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
Benjamin Bræstrup Sayoc
86dfd0a862 [TechDraw] Simplify code getting default line weights 2022-08-02 16:13:01 -04:00
Uwe
31bc9f3913 [TD] remove some more superfluous nullptr checks 2022-07-20 02:53:48 +02:00
Uwe
af18a97913 [TD] Gui: remove more superfluous nullptr checks 2022-07-19 03:40:32 +02:00
Benjamin Bræstrup Sayoc
1ae137aeba [TechDraw] Improve readability of TaskCenterLine.cpp 2022-07-15 11:31:11 -04:00
Wanderer Fan
584af812ad [TD]fix extra undo on TaskCenterLine cancel 2022-05-11 09:57:53 -04:00
wmayer
fd8719c85c TD: [skip ci] activate PCH of TechDraw (Gui) and use forward declarations
For MSVC this reduces compile time by ~20%
2022-03-25 13:54:47 +01:00
Uwe
2e7cb2c3fb [TD] remove a single-header file 2022-03-25 04:11:53 +01:00
wmayer
a99be14233 TD: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
Wanderer Fan
cb280afbc4 [TD]remove redundant edits from 9 Task dialogs 2022-01-22 14:51:20 -05:00
Wanderer Fan
e91cc8e329 [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
luz paz
eab17ddff5 Fix various typos 2021-07-31 09:46:50 +02:00
wmayer
07c65c65d6 TD: fix -Wunused-private-field 2021-06-12 11:00:53 +02:00
donovaly
b981f9056c [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
Alexander Golubev
33cca2e6c6 TD: fix center line style settings
forum thread: https://forum.freecadweb.org/viewtopic.php?f=35&t=57783
2021-04-17 11:39:13 +02:00
luz paz
373e3a68aa [TD] icon uniformity for ActiveView and FaceCenterLine commands
Renamed SVGs, saved as plain svg, updated appropriate areas in the source code
2021-04-05 14:41:30 +02:00
donovaly
b5f57ed2f0 [TD] make pointers to the UI std::unique_ptr
as noted in https://github.com/FreeCAD/FreeCAD/pull/4271#discussion_r554673632
the pointer to the UI should be a unique pointer.

This PR does this for all TD dialogs that don't already use a unique_ptr.
2021-01-19 19:24:27 +01:00
donovaly
a1915d313a [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
luz paz
2befcd9502 TD: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the TechDraw Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
luz paz
a3cb87b117 TechDraw: Header uniformity and whitespace fixes 2020-11-14 16:59:51 +01:00
wmayer
b25dee58d5 Coverity: Uninitialized scalar/pointer field 2020-07-20 17:34:30 +02:00
wmayer
421f6c52cb Coverity: Dereference after null check 2020-07-20 17:34:25 +02:00
wmayer
e9bc970c28 PVS: V522 There might be dereferencing of a potential null pointer 2020-07-18 10:59:27 +02:00
wandererfan
add17980b3 [TD]Eliminate replace fcns for Cosmetic objs 2020-05-16 07:42:45 -04:00
wandererfan
e80c576241 [TD]Centralize preference getters 2020-04-24 11:13:49 -04:00
wandererfan
1c5b2c8e27 [TD]fix crash on bad centerline selection 2020-04-17 10:11:24 -04:00
donovaly
9064768a5c [TD] TaskCenterLine add missing unit initialization
next try because PR #3275 cannot be merged.
2020-03-28 20:53:19 -04:00
donovaly
28e40f8dc5 [TD] Centerline dialog refurbish
- group the radio buttons
- make edit dialog apply immediately
2020-03-23 09:24:25 -04:00
wandererfan
30a0047cd4 [TD]Fix handling of CL flip parameter 2020-03-21 09:40:22 -04:00
donovaly
f9c9d1ee14 [TD] cleanup and fixes for Centerlines
- merge the flip Ends option to the main dialog
- use a QuantitySpinBox with angular unit for the angle
- store the state of the flipping correctly
- cleanup UI of dialog to avoid vertical whitespace
2020-03-19 09:33:31 -04:00