Commit Graph

84 Commits

Author SHA1 Message Date
PaddleStroke
df3bf98ef7 Measure: Fix quickmeasure problem with Part::Line objects 2024-11-11 18:17:36 +01:00
wmayer
04a6f38ec8 Measure: When measuring the distance between circles then use the center points as reference
See forum: https://forum.freecad.org/viewtopic.php?t=91570
2024-10-23 21:52:37 +02:00
pre-commit-ci[bot]
925335d5c1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-22 22:37:01 -05:00
wmayer
9a66ad7302 Measure: Use Base::toDegrees to convert radian to degree 2024-10-22 22:37:01 -05:00
Eric Price
69676a0f9d Measurement: Avoid null shapes to be returned in all code branches (Fix #16820)
Returning a null shape would have triggered an exception in the bottom branch but not in the top one - which later leads to a segfault - solution - raise an exception. OOC doesn't like null shapes.
2024-09-25 12:29:48 -05:00
Eric Price
54c278c123 Measurement: Correctly handle unknown selections to avoid segfaults (Fix 16794)
The measurement code did not handle mixed selections of known and unknown types correctly. Although a unknown selected object would leave the type at Invalid, selecting both known and unknown objects would have the type determined by the known object type and treat the unknown as the same. This causes exceptions and - worst case a segmentation fault.

This fix introduces a new category "other" which - if present in a selection always forces type to Invalid. This should be forward compatible in case new types are introduced in the future.
2024-09-25 07:48:56 -05:00
PaddleStroke
0be29b11b7 Measure: Fix quickmeasure globalplacement. 2024-09-19 08:47:57 -05:00
hlorus
62a44a94f6 Measure: Fix crash when removing referenced element
Also improve error messages
Fixes #16183
2024-09-02 12:39:05 -04:00
mosfet80
3b60bf7194 clean Measurement.cpp
clean Measurement.cpp
2024-09-02 18:04:24 +02:00
pre-commit-ci[bot]
73cb5bafe0 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-08-26 23:55:17 +02:00
pre-commit-ci[bot]
0797cd2f00 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-08-25 11:42:43 +00:00
hlorus
01611c6a1c [MeasureGui] Fix order of setting properties to avoid update with outdated data 2024-08-19 12:16:19 -04:00
luzpaz
a71f49f4f6 Fix trailing newlines and minor typo fixes 2024-07-23 16:16:30 +02:00
hlorus
572235cff8 Measure: Resolve App::Link elements 2024-07-17 17:56:37 +02:00
hlorus
bb7f84c32a Measure: Reduce boilerplate code by adding some helper methods 2024-07-17 17:53:12 +02:00
Chris Hennes
463b2d9451 Merge pull request #15010 from hlorus/measure_distance_components
MeasureGui: Add MeasureDistance X, Y and Z components back
2024-07-14 23:46:04 -05:00
wmayer
14ec1e6603 Measure: Fix memory leak in MeasureDistanceInfo
Fixes #15349
2024-07-14 15:21:47 +02:00
luzpaz
9a1f487cdb Fix various typos throughout the codebase 2024-07-08 17:19:20 -05:00
hlorus
84ca0bfda4 Measure: Add X, Y and Z component properties to MeasureDistance 2024-07-01 08:25:03 -05:00
hlorus
71505c3b40 Measure: Migrate old App::MeasureDistance to new type 2024-06-11 17:57:01 +02:00
hlorus
96fba15cb1 [Measure] Add MeasureDistanceDetached 2024-06-11 17:57:01 +02:00
wmayer
859d47bac7 Measure: Fix exception handling
If a Base::Exception is thrown in Measurement::getShape() then it's handled by the catch(...) handler and
converted into a Base::RuntimeError. This behaviour hides the original Base::Exception.

Example:
Selecting a datum plane raises the error 'Measurement: Unknown error retrieving shape' because the
original Base::ValueError isn't forwarded.
2024-06-02 08:15:57 +02:00
wmayer
4185605d5e clang/gcc: Add build option FREECAD_WARN_ERROR to force to make warnings into errors 2024-05-29 13:37:07 +02:00
Chris Hennes
53da36a93a Merge pull request #14011 from hlorus/measure-icons
Add measurement icons
2024-05-20 10:54:06 -05:00
hlorus
b3ea58a503 MeasureGui: Add icons
Co-Authored-By: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com>
2024-05-14 17:55:06 +02:00
Chris Hennes
1028345ae6 Merge pull request #13811 from hlorus/remove_measure_prefs
[Measure] Remove unused properties from measure preferences
2024-05-13 10:39:18 -05:00
Max Wilfinger
302a202fa6 Change default UMF colors (#13781) 2024-05-06 11:16:48 -05:00
PaddleStroke
e5780a5e3d Core / Measure: Introduce QuickMeasure 2024-05-06 18:12:14 +02:00
hlorus
7d5ac7e797 [Measure] Remove unused properties from measure preferences 2024-05-03 11:36:48 +02:00
wmayer
56f84c8042 Fix various compiler warnings:
* fix -Wunused-parameter
* fix -Wunused-function
* fix -Wunused-private-field
* fix -Wunused-variable
* fix -Winconsistent-missing-override
2024-04-30 16:59:31 +02:00
hlorus
36d16b2243 [Measure] Add features, viewproviders and preferences for unified measurement facility 2024-04-29 09:27:22 -04:00
liukaiwen
4f8fe8fd4a [cmake] some definitions do not matter build now 2023-09-27 18:17:14 +08:00
wmayer
a3057e946b Mod: modernize C++: use equals default 2023-08-22 11:16:49 +02:00
luzpaz
729685316e Fix trailing whitespace, typos, headers
Fix trailing whitespace, typos, and header uniformity.
2023-01-23 00:34:37 +01:00
wandererfan
aeeb62d204 [Measure]fix angle returns supplementary value 2023-01-07 16:32:03 -05:00
Uwe
561bb7f747 [Measure] : remove unused headers 2022-12-14 03:53:30 +01:00
wandererfan
ad2de02d0c [Meas]handle long subElement names in reference 2022-12-02 14:19:53 -05:00
luz paz
95d89622de Fix header uniformity for various workbenches/directories
Also includes some trailing whitespace fixes
2022-11-29 04:48:57 +01:00
Uwe
424cd1d319 [Measure] remove a unused include
- also some sorting
2022-11-23 03:50:45 +01:00
wandererfan
075cbb64f0 [Measurement]apply globalPlacement to geometry 2022-11-14 16:38:06 -05:00
wandererfan
92819be7fd [Measurement]support for 3 point angle 2022-11-04 08:28:13 -04:00
wmayer
2062f9ce87 clang: fix warnings [-Winconsistent-missing-override] 2022-08-09 17:36:25 +02:00
berniev
ddafb98813 Mod: Use override etc 2 2022-08-09 12:52:26 +02:00
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
2d4c5a4cfb Mod: use emplace_back 2022-08-05 10:36:16 +02:00
Uwe
49f707e885 [Measure] Measurement.cpp: add missing include 2022-07-03 21:38:52 +02:00
Uwe
6fb7f614c7 [Part] Pa* to Pre*: remove unneeded includes
- also sort includes
2022-07-03 20:47:03 +02:00
wmayer
924d779fc7 Points: include header with export macros 2022-03-24 20:46:47 +01:00
wmayer
97330443a2 All: modernize C++11
* replace deprecated headers
2022-03-23 22:44:18 +01:00
wmayer
b5c71395f1 Measure: modernize C++11
* use nullptr
2022-03-23 19:26:15 +01:00