Commit Graph

116 Commits

Author SHA1 Message Date
tetektoza
ec8cff9e5f Measurement: Provide correct VP name for COM (#23329)
* Measurement: Provide correct VP name for COM

This patch tries to provide proper ViewProvider name for COM, which
results in a proper pixmap assignment, which won't fallback to the
default measurement's tool icon for COM.

Since MeasurePython runs before actual COM python proxy assignments,
we can't access proxy easily from this point of code.

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

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

* Measure: Use starts_with instead of find

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

* Update src/Mod/Measure/App/MeasureBase.cpp

---------

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-09-03 05:17:24 +00:00
theo-vt
0c4e125e44 Quickmeasure: Make measuring holes easier (#23385)
* Measure: Add circle center distance types to quickmeasure

* Measure: Add cylinder axis distance types to quickmeasure

* Measure: Fix PointToCylinder minimum distance not computing

* Quickmeasure: compute circle and cylinder diameters when they are closed

* Quickmeasure: add angle measurement between cylinder & circle axes

* Quickmeasure: Remove minimum distance between circle center and cylinder surface

* [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-08-31 21:57:00 +02:00
Max Wilfinger
9cae60a70f Update UI strings from Crowdin reports for consistency 2025-08-28 11:45:38 -05:00
wmayer
75236d4b13 Measure: Allow any surface type for MeasureArea 2025-08-25 09:23:54 +02:00
wmayer
1acafb240a Measure: Fix several crashes in Measurement
Measurement::getShape() used to call ShapeFinder::getLocatedShape()
that failed to return a valid shape in many cases. And the calling
instance didn't check for a valid shape either which caused
a segmentation fault.

Solution:
Replace ShapeFinder::getLocatedShape() with Part::Feature::getShape()
that works more reliably and where needed check for a valid shape
before accessing it.

This fixes issue 19452 and improves the fix for 19349
2025-08-25 09:21:33 +02:00
wmayer
2b2a82d901 Measure: Fix crash in Measurement::length() when selecting infinite edge (e.g. PD datum line) 2025-08-25 09:21:33 +02:00
luzpaz
ce9da36314 Fix various typos 2025-08-12 12:18:23 -05:00
theo-vt
79738eec38 Measure: give a hint to ::getShape so that compound shapes may be resolved 2025-08-11 00:24:56 +02:00
Ryan Kembrey
adff20f7dc Measure: Update UI strings for consistency
Closes: #22370
2025-08-04 20:13:26 +02:00
Ian 'z0r0' Abreu
ab225f5672 fixing unnecessary list import 2025-07-28 08:59:52 -05:00
Syres916
7e6775d2c0 [Measure] Fix seg fault in MeasurePosition::execute if subElements is empty (#22016)
* [Measure] take into account if subElements is empty

* [Measure] Remove unnecessary else block
2025-06-23 10:44:51 -05:00
Chris Hennes
b307395c59 Measure: Remove redundant check for edges > 0 2025-06-20 22:49:34 +02:00
theo-vt
13e7952ccc PartDesign: Fix hole centered on point edge case (#21257)
* Light refactor of getTopoShape function

* Fix hole edge case

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

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

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Refactor simplifyCompound()

* Use Base::Flags<GetShapeOption>

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

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

* Shorten enum name and move it from class scope to namespace scope

* [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>
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-05-29 22:37:54 +02:00
hlorus
c9b87c5862 Measure: Add MeasureElementType::Surface 2025-05-20 12:01:14 +02:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Ladislav Michl
c293d74566 Base: rename Exception's PascalCase methods to camelCase 2025-05-05 23:50:01 +02:00
Benjamin Nauck
bc462c44cc Measure: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:38 +01:00
tritao
6c2c6847eb CMake: Cleanup targets with transitive dependencies 2025-03-17 12:12:06 +00:00
Chris Hennes
4fcdac28fb Merge pull request #19583 from hyarion/refactor/base-type
Refactor Base::Type
2025-03-17 00:03:22 -05: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
Chris Hennes
7f1c43a335 Merge pull request #19636 from kadet1090/color-in-base
Base: Move App::Color to Base
2025-03-02 16:36:40 -06:00
Benjamin Bræstrup Sayoc
755229df23 Build: suppress warnings from 3rd party libraries
Warnings from 3rd parties are not relevant and are only polluting the warning output. Marking these libraries as SYSTEM suppresses warning.

https://gcc.gnu.org/onlinedocs/cpp/Invocation.html#index-I
https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html
2025-02-25 14:39:05 +00:00
Joao Matos
cc6ffb44de Core: Move PyCXX library to src/3rdParty. 2025-02-24 16:36:06 +00:00
Benjamin Nauck
17ed01bbf2 Measure: Use constant for Type::BadType instead Type::badType() 2025-02-24 08:30:18 +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
Joao Matos
27ebc68a11 CMake: Modernize build files using outdated Python variables. 2025-02-16 10:21:26 -06:00
luzpaz
67c772553b Fix typos
Found via codespell
2025-01-29 08:31:01 +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
4ba83f0f50 [TD]use transformShape instead of transformGeometry 2025-01-13 21:14:10 -06: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
Ladislav Michl
2ea8a633ac Base: Quantity: return std::string 2024-12-23 17:48:42 +01:00
Ladislav Michl
0907c7bfda Base: Units: return std::string 2024-12-23 17:48:42 +01:00
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