Commit Graph

748 Commits

Author SHA1 Message Date
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
wmayer
b831d9d7f2 TD: remove some more deprecated Py2 code 2021-04-26 11:01:59 +02:00
wmayer
9209d35390 TD: fix memory leaks in BaseGeom::baseFactory() and make code more readable 2021-04-23 17:05:13 +02:00
luz paz
738a697d94 [TD] remove Py2 code from TD 2021-04-22 13:08:56 +02:00
Chris Hennes
bd86b4dcfe [TD] Remove deprecated Qt < 5.9 code 2021-04-02 12:02:54 +02:00
Benjamin Nauck
bb5ac30e24 TechDraw: [skip ci] convert source files from iso-8859 to utf-8
All other source files are either plain ascii or utf-8, this converts
the last few to utf-8.
2021-03-25 18:02:12 +01:00
Aapo
505ba2e42f [TD] DrawViewPart.cpp: Fix a crash when user sets the PropertyVector Direction to zero. 2021-02-25 12:40:59 +01:00
wmayer
3ad1d8fccc TD: [skip ci] implement DrawView::recompute to handle all OCC exception types 2021-02-25 12:39:50 +01:00
wmayer
2de6a80bb4 TD: [skip ci] explicitly nullify geometryObject in DrawViewPart::partExec to avoid to leave it a dangling pointer in case makeGeometryForShape raises an exception 2021-02-25 11:34:29 +01:00
Aapo
e39ef22c1b [TD] Hotfix for Dimension label Arbitrary value regression in DrawViewDimension.cpp 2021-02-25 10:28:42 +01:00
wmayer
5c4fcaef1d TD: [skip ci] Fix coverity warning
Coverity warnings fixed:

CID 316559 (#1 of 1): Uninitialized scalar variable (UNINIT)
3. uninit_use_in_call: Using uninitialized value we. Field we.idx is uninitialized when calling push_back

CID 316549 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member pageheight is not initialized in this constructor nor in any functions that it calls.

CID 186161 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member parent is not initialized in this constructor nor in any functions that it calls.

CID 305170 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking this->m_baseFeat suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

CID 186152 (#2 of 2): Uninitialized pointer field (UNINIT_CTOR)
3. uninit_member: Non-static class member m_mdi is not initialized in this constructor nor in any functions that it calls.

CID 192588 (#1 of 1): Same on both sides (CONSTANT_EXPRESSION_RESULT)
pointless_expression
2021-02-21 16:30:30 +01:00
vosk
100a7ade4c [TD] - Fix geometry object leaking on every exec 2021-02-19 16:50:56 +01:00
Aapo
f0992574bd [TD] ShapeExtractor.cpp: Fix linked View source bug, link targets were translated but not scaled in TD. 2021-02-05 22:41:09 +01:00
Yorik van Havre
e947b9bb3b TechDraw: Exposed GeomHatch functionality to Python in TechDraw.makeGeomHatch() 2021-02-02 17:49:44 +01:00
Aapo
9f49b122f4 [TD] Dimensions: donovaly's minor fixes for TheoreticalExact dimensions. 2021-01-31 15:17:46 +01:00
Aapo
f362930664 [TD] Improve arbitrary tolerance and unit handling for Equal Tolerances. 2021-01-31 15:17:46 +01:00
Aapo
dbef970697 [TD] Add under- and overtolerances for Dimension Task layout, fixes for Dimension tolerance refresh and behavior. 2021-01-31 15:17:46 +01:00
Aapo
5350a2c3d0 [TD] Fix degree sign processing for equilateral angular plusminus dimensions. 2021-01-31 15:17:46 +01:00
Aapo
e6ef62e711 [TD] Fix regression in Dimensions: Setting arbitrary under tolerance was somehow lost. 2021-01-31 15:17:46 +01:00
Chris Hennes
475f7049c5 Add the standard-defined "xml" namespace if it is not specified
The XML standard stipulates:
The prefix xml is by definition bound to the namespace name http://www.w3.org/XML/1998/namespace. It MAY, but need not, be declared, and MUST NOT be bound to any other namespace name. Other prefixes MUST NOT be bound to this namespace name, and it MUST NOT be declared as the default namespace.

If the document does not explicitly include this namespace, it is added. This prevents errors due to the use of the namespace in some imported SVG files. In debug builds those errors emit warning messages, and in Windows debug builds those errors cause an abort() to be called.
2021-01-24 22:35:27 -06:00
Aapo
691051e1df [TD] Fix Dimension unit printing problem for US building units and other multivalueschema. 2021-01-18 21:52:35 +02:00
donovaly
1a296a4006 [TD] add dialog to modify some dimension settings
also fix issue that tolerance could be set despite theoretically exact is true under some circumstances

also some wording improvements

also a minor fix to use 0.0 instead of DBL_MIN
2021-01-15 05:21:49 +01:00
donovaly
81ff5a422f [TD] don't allow tolerances for exact values
as discussed here: https://forum.freecadweb.org/viewtopic.php?f=35&t=54218
when a value is theoretically exact it must not have a tolerance

This PR
* fixes this
* also fixes the bug that OverTolerance must not be negative if the tolerances are equal
2021-01-13 04:05:31 +01:00
donovaly
96eaff8e4e [TD] some fixes
- the setting "Standard and Style" only affects new dimensions, thus it must be italic

- fix bug that the Property 'LockPosition' appears for dimensions -> this is an option for views and thus must be hidden for dimensions

- since tolerances are in the vast majority fractions of a millimeter/inch, set its stepsize to 0.1
(I hope I did it right in handleChangedPropertyType.)

- fix inconsistent newlines in TaskBalloon.h

- improve wording for a heading
2021-01-10 00:29:34 +01:00
donovaly
2232b1d48e [TD] handle equal tolerances correctly
the common rule is that if a dimension has equal over- and undertolerance, they are output on the same line as the dimension concatenated using the ± character.

This PR does this.

Note that this is not just cosmetics, it is even standardized in the GD&T norms.

also:
* use one format specifier for tolerances since the norms don't allow a different format for the over- and the undertolerance
* some code optimizations like a self-explaining function name, remove unnecessary/outdated comments
2021-01-08 15:14:37 +01:00
donovaly
12c9aa00cf [TD] update balloon dialog
2 weeks ago the properties EndTypeScale and LineVisible were added but not to the dialog.

This PR adds them t the balloon dialog-

It also took the opportunity to cleanup the code:
- add missing tooltips
- uniform tooltips in App and Gui
- uniform the UI element names
2021-01-02 11:49:20 +01:00
Aapo
e20a21a97d [TD] DrawViewDimension Tolerances, print zero tolerances without plus sign and decimals. 2020-12-30 18:49:59 +01:00
donovaly
665a1106f7 [TD] fix bug with angular and small values
* angular as reported here: https://forum.freecadweb.org/viewtopic.php?f=35&t=53473&start=10#p461507
* small values: since we convert to e.g. mm, we must then not output e.g. 'µm'
* also a code optimization, fix a typo, removal of a meanwhile misleading comment
2020-12-30 16:20:27 +01:00
wmayer
eac4062b3f Boost: [skip ci] Fix build warnings from deprecated Boost headers (v1.75) 2020-12-29 15:34:25 +01:00
Mateusz Skowroński
98f63ba60f Fix build warnings from deprecated Boost headers (they are used internally by Boost). Thanks @wwmayer for the hint. 2020-12-29 10:20:53 +01:00
Yorik van Havre
107ac45ddd Merge pull request #4175 from donovaly/TD-unit-dimension-fix
[TD] fix unit conversion for dimensions
2020-12-23 14:10:04 +01:00
Aapo
5a25f91beb [TD] ShapeExtractor.cpp: Avoid processing infinite-sized shapes (Datum objects etc). 2020-12-22 17:46:19 +01:00
donovaly
9213dace6b [TD] fix unit conversion for dimensions
as reported here: https://forum.freecadweb.org/viewtopic.php?f=35&t=53473
my commit 957ce2f38787 introduced a regression because now units are no longer converted when the unit is displayed.

This PR fixes this.
2020-12-21 01:27:41 +01:00
Aapo
5f497ab37a [TD] Balloon, fix Origin and scale refresh bugs, make Balloon scale change more reasonable per UI click. 2020-12-18 12:45:34 +01:00
Aapo
d81e377546 [TD] Balloon, fix EndTypeScale refresh bug. 2020-12-18 12:45:34 +01:00
Aapo
294136e9bd [TD] Balloon, move property LineVisible to View tab and fix a refresh bug. 2020-12-18 12:45:34 +01:00
Aapo
7d260787b9 [TD] Balloon, change ordering of the data properties to more logical. 2020-12-18 12:45:34 +01:00
Aapo
2077709329 [TD] Make Dimension Tolerances respect the Prefs formatSpec when creating a Dimension. 2020-12-17 17:30:29 +01:00
Yorik van Havre
bae52813df Merge pull request #4109 from donovaly/TD-dimensioning-fix
[TD] treat dimensions the same way, no matter if with unit or not
2020-12-14 12:08:46 +01:00
Yorik van Havre
8aa4e821c5 Merge pull request #4069 from aapo-aapo/TD-Balloon-improvements
[TD] TechDraw Balloon improvements with two new App::PropertyType properties
2020-12-14 11:56:08 +01:00
wmayer
b3cd06afe8 Py: fix memory leaks by incorrect use of PyList_Append 2020-12-13 16:30:04 +01:00
Aapo
6670197fad [TD] Add Balloon property LineVisible for making the Balloon line visible or hidden. 2020-12-07 23:40:12 +02:00
Aapo
d274805567 [TD] Add Balloon property EndTypeScale for scaling line end decorations (arrows etc). 2020-12-07 23:40:12 +02:00
donovaly
36686f78b1 [TD] treat dimensions the same way, no matter if with unit or not
fixes the issue reported here: https://forum.freecadweb.org/viewtopic.php?f=35&t=52545&start=40#p454483
2020-12-05 03:58:39 +01:00
Aapo
f72bf9d325 [TD] Make DrawViewSpreadSheet respect DrawPage::redrawCommand() update mechanism. 2020-12-05 00:50:20 +02:00
Aapo
3dd77d7e89 [TD] Fix column index range checking bug in std::string DrawViewSpreadsheet::getSheetImage(void) 2020-12-05 00:50:19 +02:00
Mark O'Donovan
e88dff8902 Remove unused variable in DrawViewDimension.cpp 2020-12-04 17:13:56 +01: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
donovaly
7f856a251f tolerances can be negative, thus the decimal precision check must be adapted 2020-12-03 15:50:06 +01:00
donovaly
a2b523fb39 [TD] fix unit mismatch bug
- also make global decimal option italic since it only affects new dimensions
- also fix a typo in UnitsApi.h
2020-12-03 15:50:06 +01:00