Commit Graph

80 Commits

Author SHA1 Message Date
Eric Price
dc6799fb7c 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
2ef683e56f 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
81d3690397 Measure: Fix quickmeasure globalplacement. 2024-09-19 08:47:57 -05:00
hlorus
b07b257542 Measure: Fix crash when removing referenced element
Also improve error messages
Fixes #16183
2024-09-02 12:39:05 -04:00
mosfet80
66878494a8 clean Measurement.cpp
clean Measurement.cpp
2024-09-02 18:04:24 +02:00
pre-commit-ci[bot]
010e6872be [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]
7c6b8cc9ab [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
079f7d4097 [MeasureGui] Fix order of setting properties to avoid update with outdated data 2024-08-19 12:16:19 -04:00
luzpaz
bc150dc73c Fix trailing newlines and minor typo fixes 2024-07-23 16:16:30 +02:00
hlorus
d8bbb3c804 Measure: Resolve App::Link elements 2024-07-17 17:56:37 +02:00
hlorus
60d69d706d Measure: Reduce boilerplate code by adding some helper methods 2024-07-17 17:53:12 +02:00
Chris Hennes
e17a0bee5f 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
07c25e768e Measure: Fix memory leak in MeasureDistanceInfo
Fixes #15349
2024-07-14 15:21:47 +02:00
luzpaz
2837b46c3e Fix various typos throughout the codebase 2024-07-08 17:19:20 -05:00
hlorus
fb53d4cd4f Measure: Add X, Y and Z component properties to MeasureDistance 2024-07-01 08:25:03 -05:00
hlorus
4a573ee4cb Measure: Migrate old App::MeasureDistance to new type 2024-06-11 17:57:01 +02:00
hlorus
2cfa09041b [Measure] Add MeasureDistanceDetached 2024-06-11 17:57:01 +02:00
wmayer
17613bf929 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
560cab6f31 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
aef423731d Merge pull request #14011 from hlorus/measure-icons
Add measurement icons
2024-05-20 10:54:06 -05:00
hlorus
381d10e305 MeasureGui: Add icons
Co-Authored-By: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com>
2024-05-14 17:55:06 +02:00
Chris Hennes
b52c6ed9bc 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
a934421906 Change default UMF colors (#13781) 2024-05-06 11:16:48 -05:00
PaddleStroke
818e122420 Core / Measure: Introduce QuickMeasure 2024-05-06 18:12:14 +02:00
hlorus
50b5399d52 [Measure] Remove unused properties from measure preferences 2024-05-03 11:36:48 +02:00
wmayer
2ea6bc17b6 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
bed703a6f9 [Measure] Add features, viewproviders and preferences for unified measurement facility 2024-04-29 09:27:22 -04:00
liukaiwen
329904a055 [cmake] some definitions do not matter build now 2023-09-27 18:17:14 +08:00
wmayer
da00501288 Mod: modernize C++: use equals default 2023-08-22 11:16:49 +02:00
luzpaz
79e150a81b Fix trailing whitespace, typos, headers
Fix trailing whitespace, typos, and header uniformity.
2023-01-23 00:34:37 +01:00
wandererfan
9e48f5a158 [Measure]fix angle returns supplementary value 2023-01-07 16:32:03 -05:00
Uwe
474f403ca7 [Measure] : remove unused headers 2022-12-14 03:53:30 +01:00
wandererfan
38f8137884 [Meas]handle long subElement names in reference 2022-12-02 14:19:53 -05:00
luz paz
452008f65d Fix header uniformity for various workbenches/directories
Also includes some trailing whitespace fixes
2022-11-29 04:48:57 +01:00
Uwe
d11e416845 [Measure] remove a unused include
- also some sorting
2022-11-23 03:50:45 +01:00
wandererfan
694aefc197 [Measurement]apply globalPlacement to geometry 2022-11-14 16:38:06 -05:00
wandererfan
312d62cc18 [Measurement]support for 3 point angle 2022-11-04 08:28:13 -04:00
wmayer
c87e1cc1c2 clang: fix warnings [-Winconsistent-missing-override] 2022-08-09 17:36:25 +02:00
berniev
71dc5ead2f Mod: Use override etc 2 2022-08-09 12:52:26 +02:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
47ac049e14 Mod: use emplace_back 2022-08-05 10:36:16 +02:00
Uwe
0dabdab140 [Measure] Measurement.cpp: add missing include 2022-07-03 21:38:52 +02:00
Uwe
4dced53a00 [Part] Pa* to Pre*: remove unneeded includes
- also sort includes
2022-07-03 20:47:03 +02:00
wmayer
48c6777d82 Points: include header with export macros 2022-03-24 20:46:47 +01:00
wmayer
d21a60b294 All: modernize C++11
* replace deprecated headers
2022-03-23 22:44:18 +01:00
wmayer
635534cb15 Measure: modernize C++11
* use nullptr
2022-03-23 19:26:15 +01:00
Uwe
c455d1a085 [Measure] remove unused file 2022-03-20 19:26:22 +01:00
Uwe
887fa15b01 [Measure] remove unused includes 2022-03-20 17:56:00 +01:00
Uwe
a012dc23a4 [Measure] remove Python.h from headers
is not necessary anymore
2022-03-20 17:41:04 +01:00
wmayer
0f9768fb33 Fix coverity issue:
* CID 332682: Resource leak
* CID 350607: Resource leak
* CID 332677: Resource leak
2022-03-14 11:35:04 +01:00