Commit Graph

2981 Commits

Author SHA1 Message Date
tritao
65466d580b Gui: Reorganize the selection files into a top Selection folder. 2025-02-03 17:56:57 +01:00
Chris Hennes
5e9dd297fe Merge pull request #19232 from WandererFan/miscSmallFixes
[TD]minor fixes x3
2025-02-03 17:54:20 +01:00
wandererfan
d26812e048 [TD]fix crash on delete while dialog open (#18120) 2025-02-03 17:51:46 +01:00
Pascal de Bruijn
11c77e4099 TechDraw: Export with default filename (#19033)
* TechDraw: Export with default filename

* TechDraw: templates consistent drawing_number/revision_index
2025-02-03 11:34:14 -05:00
Max Wilfinger
45897379e6 Merge pull request #19097 from hyarion/refactor/template-based-is-derived-from
Simplify code by using BaseClass' isDerivedFrom<> and is<>
2025-01-27 20:40:08 +01:00
Benjamin Guest
9990408035 TechDraw: Fix dimension alignment issue.
Fixes issue #19121 "dimension numbers placed lower than normal".

Problem:

QGCustomText has a new method `alignmentRect` which can optionally return a
`tightBoundingRect` instead of the regular `boundingRect`. The
`alignmentRect` is used for laying out the `QGIDatumLabel`, however
QGraphicsItemGroup's `childrenBoundingRect` use the childrens'
`boundingRect` and knows nothing of `alignmentRect`. The result is an
improperly sized label and frame and miss alignment. Additionally
`childrenBoundingRect` calculations includes hidden views, so even though
the `m_tolTextOver` and `m_tolTextUnder` are hidden they still affect
the bounding rect size.

Solution:

1. Implement new method `QGIDatumLabel::tightBoundingRect` this
   calculates the bounding rect using the subview's
   `aligmentRect` if there is text in the custom text.
2. Use `tightBoundingRect` in place of `boundingRect` to for the drawing of
   arrows and the exact dim frames.
3. This PR acknowledges that there are some edge case fonts that while not
   clipped may not interface perfectly with arrows and the exact dimension
   frame.
4. Fix vertical alignment of `m_tolTextOver` / `m_tolTextUnder`
5. Incorporate PR Review comments
2025-01-27 20:39:41 +01:00
marcuspollio
40392c37c4 TechDraw: rename user-facing strings Arch to BIM 2025-01-27 17:58:45 +01:00
Dan Taylor
5535c1bd0b TechDraw: Fix finding outlines consisting of a single closed edge 2025-01-27 17:55:50 +01:00
Pascal de Bruijn
b95b500e5b TechDraw: fix editable/autofill scale in Templates 2025-01-27 17:50:18 +01:00
wandererfan
01f4e08f47 [TD]fix front view position in projection group (fix #19085) 2025-01-27 17:34:13 +01:00
Benjamin Nauck
cb4ee4737d Simplify logic using freecad_dynamic_cast 2025-01-27 16:08:19 +01:00
Benjamin Nauck
45c997f40a Manual changes to improve isDerivedFrom usage 2025-01-27 16:08:19 +01:00
Benjamin Nauck
dd6aa9f3c7 Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's
Regex based changes, manually verified
2025-01-27 16:08:18 +01:00
wandererfan
85fcf8c1b8 [TD]fix cosmetic circle arc handling 2025-01-24 17:29:22 -05:00
wandererfan
d8227d0683 [TD]control svg scaling at object level 2025-01-24 16:34:18 -05:00
wandererfan
a1933ff64f [TD]allow showing units on individual dimensions 2025-01-24 13:04:00 -05:00
João Matos
8a384a2b70 CMake: Improve Import dependency check for TechDraw module. (#19036)
* CMake: Fix missing Import dependency check for TechDraw module.

* CMake/TechDraw: Conditionally use Import library.

* CMake: Fix missing dependency check for Module and PartDesign measure in TechDraw.
2025-01-19 13:33:16 -06:00
Yorik van Havre
fe60505c17 Translations (#18923)
* Updated ts files

* Merged crowdin translations

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-13 21:30:30 -06:00
Tobias Frost
7a5a3d1ffc spelling fixes (#18688)
* Fixes spelling of "Allow to" to "Allow one to"

and those variants:
Allows to -> Allows one to
allow to -> allow one to
allows to -> allows one to

* Fix "Let's -> Lets"

(and lower case variant.)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/3rdParty/salomesmesh/inc/MED_Wrapper.hxx

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Base/PyObjectBase.cpp
Update src/App/ExtensionContainer.h
Update src/App/PropertyContainer.h

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Use gerund in user-facing texts.

* Use gerund for two more user-facing strings.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

---------

Co-authored-by: Tobias Frost <tobi@debian.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-01-13 11:22:20 -06:00
WandererFan
e9c30cf370 [TD]Dimension font clipping (fix #11452) (#18771)
* [TD]separate alignment and rendering bounding rectangles

* [TD]use alignment rectangle (fix #11452)
2025-01-13 11:13:59 -06:00
Pascal de Bruijn
c4116daf99 TechDraw: Component Drawing as default document type (#18827)
Presumably Component Drawings are more common as opposed to Assembly Drawing's
therefore FreeCAD's default should reflect this.

find src/Mod/TechDraw/Templates -iname "*.svg" -exec sed -i 's#Assembly Drawing#Component Drawing#g' "{}" \;
2025-01-13 11:59:57 -05:00
Syres916
b86e1adb22 [Techdraw] Import SVG files with UTF-8 encoding (#18816)
* [Techdraw] Fix importing SVG files with UTF-8 encoding

* [Techdraw] fix Lint feedback
2025-01-06 18:32:56 +01:00
WandererFan
93aa3b312f [TD]Fix RichText parent in scene (fix #18283) (#18768)
* [TD]allow DrawViewAnno to be attached to another view

* [TD]allow image and spreadsheet attach to view

* [TD]ensure correct parent in scene

* [TD]refactor command helpers to separate file

- gathering the helpers in one place
- helper redundancy to be address in another change

* [TD]create symbol, spreadsheet, image with parent

* [TD]fix claimChildren for some views

- also includes many lint fixes
2025-01-06 18:11:25 +01:00
WandererFan
a3e49023d1 [TD]Symbol scaling (fix #14400) (#18757)
* [TD]add legacy/new svg scaling pref

* [TD]Change Svg scaling logic (fix 14400)
2025-01-06 18:02:37 +01:00
WandererFan
abb50a4daa [TD]Long and link dim refs (fix #13375) (#18641)
* [Meas]Changes for TD dimension refs for links

* [TD]App changes for dim refs to links

* [TD]Gui changes for dim refs to links

* [TD]fix 2 lint messages

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-23 17:36:22 -05:00
wandererfan
8e653ca7fb [TD]fix highlight style preference 2024-12-23 12:32:19 -05:00
WandererFan
300f3bca4c [TD]Section line and rotation fix 17831 (#18663)
* [TD]fix SectionLine colour (fix 17831 part 1)

* [TD]fix wrong rotation in Section task (fix 17831 part 2)
2024-12-23 11:03:31 -06:00
Ladislav Michl
2ea8a633ac Base: Quantity: return std::string 2024-12-23 17:48:42 +01:00
FEA-eng
970beb4457 Fix typos in TechDraw advanced preferences - tooltips (#18510) 2024-12-23 10:38:12 -06:00
luzpaz
7782fd6827 Trim lines ending with superfluous whitespace 2024-12-22 08:50:37 -05:00
Tobias Frost
0d628cb5fc Fix SPDX Identifier to match license 2024-12-20 12:05:44 -05:00
Ladislav Michl
2afdd58a88 TechDraw: Ensure tolerance font size is > 0 2024-12-16 12:23:51 -05:00
PaddleStroke
e657ce9473 TechDraw: Assembly exploded views : revert #17726 2024-12-16 11:22:26 -06:00
Chris Hennes
a88f30877c Update src/Mod/TechDraw/Gui/QGILeaderLine.cpp 2024-12-16 18:16:03 +01:00
wandererfan
3cadb489d9 [TD]allow weld symbol on rotated leader 2024-12-16 18:16:03 +01:00
wandererfan
a92acbd457 [TD]fix leader autohorizontal on rotated base view 2024-12-16 18:16:03 +01:00
WandererFan
fa327ec152 [TD]Fix transparent area in pdf (fix #18443) (#18507)
* [TD]fix transparent areas in pdf (#18443)

* [TD]restore use of PDF/A-1b format

- was not working in older versions of QPdfWriter
2024-12-16 10:47:08 -06:00
WandererFan
f12999724b [TD]respect locale for date autofill (#18132)
* [TD]respect locale for date autofill

* [TD]fix merge conflict

* Apply suggestions from code review

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-12-13 11:07:54 -06:00
wandererfan
0f6809f325 [TD]fix #18050 hidden line color 2024-12-09 17:39:54 +01:00
wandererfan
8f8bdd5c93 [TD]add shape validation tool for debugging 2024-12-09 17:37:33 +01:00
Kacper Donat
651cefde4d Gui: Use getObject<T>() helpers in classes
This commit is generated using regex based find and replace:

```
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*getObject\(\s*\)\)/getObject<$1>/
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*([^)]*)\s*->\s*getObject\(\s*\)\)/$2->getObject<$1>()/
```

To regenerate if needed.
2024-12-06 18:29:39 +01:00
Kacper Donat
deb15a57e4 Gui: Add getObject<T>() helpers to various classes
Obtaining specific kind of document object is very common task. This
commit introduces handy helper which makes that a lot easier.
2024-12-06 18:19:53 +01: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
Benjamin Bræstrup Sayoc
36f2aa6152 [TechDraw] Translations and grammer (#16301)
Co-authored-by: WandererFan <WandererFan@gmail.com>
2024-12-02 12:27:39 -05:00
wandererfan
797c1180b0 [TD]prevent use of non-exist/hidden tab in exports 2024-11-29 12:28:25 -05:00
wandererfan
8581cd01e2 [TD]prevent crash on attempt to print hidden page 2024-11-29 12:28:25 -05:00
wandererfan
2e82c330d4 [TD]prevent fail on auto switch to hidden tab 2024-11-29 12:28:25 -05:00
wandererfan
1ef62a1de8 [TD]add preference for auto workbench switch 2024-11-29 12:28:25 -05:00
wandererfan
1de4dc600d [TD]fix area calculation 2024-11-25 17:49:21 +01:00
Benjamin Bræstrup Sayoc
cdb92768fe [TechDraw] Return logic simplification (#16504)
* [TechDraw] AppTechDrawPy.cpp return logic simplification

* [TechDraw] CosmeticExtension.cpp return logic simplification

* [TechDraw] DrawBrokenView.cpp return logic simplification

* [TechDraw] HatchLine.cpp return logic simplification

* [TechDraw] LineGenerator.cpp return logic simplification

* [TechDraw] Preferences.cpp return logic simplification

* [TechDraw] ShapeExtractor.cpp return logic simplification

* [TechDraw] MDIViewPage.cpp return logic simplification

* [TechDraw] QGILeaderLine.cpp return logic simplification

* [TechDraw] QGIRichAnno.cpp return logic simplification

* [TechDraw] QGTracker.cpp return logic simplification
2024-11-18 16:14:47 -03:00