Commit Graph

175 Commits

Author SHA1 Message Date
tritao
cdab9c7837 CMake: Cleanup targets with transitive dependencies 2025-03-17 12:12:06 +00:00
Chris Hennes
9a77120e82 Merge pull request #20142 from bofdahof/ranges
Apply C++20 std::ranges (mainly to std::find)
2025-03-17 03:08:27 -05:00
Chris Hennes
cae6d0549c Merge pull request #20040 from PaddleStroke/patch-12
QuickMeasure: Do not measure datums
2025-03-17 00:26:37 -05:00
Chris Hennes
9e0d77d7f4 Merge pull request #19583 from hyarion/refactor/base-type
Refactor Base::Type
2025-03-17 00:03:22 -05:00
bofdahof
beb5dd9629 Measure: apply std::ranges 2025-03-16 17:16:56 -05:00
PaddleStroke
91bfa4b02c QuickMeasure: Do not measure datums 2025-03-16 15:48:46 -05:00
hasecilu
b98eed2574 Measure: add Spanish translation 2025-03-13 10:56:18 -06:00
Chris Hennes
3ce193ddb8 Merge pull request #19921 from mosfet80/QT_CLEAN
REMOVE old QT<= 5.14 code
2025-03-11 20:54:59 +00:00
Andrea
078e315d8f Remove unnecessary check (duplicated)
before including the library, it is uselessly checked if the variable __QtAll__ and __InventorAll__ have been defined. The same check is performed again once the library is included
2025-03-10 21:53:00 +01:00
Andrea
2d4ab5af20 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
1a2070c36f 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
ee1c73cd04 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
15076cb504 Core: Move PyCXX library to src/3rdParty. 2025-02-24 16:36:06 +00:00
Benjamin Nauck
ea5bfc4d32 Measure: Use constant for Type::BadType instead Type::badType() 2025-02-24 08:30:18 +01:00
Kacper Donat
13fbab9e42 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
aace8f7bee CMake: Modernize build files using outdated Python variables. 2025-02-16 10:21:26 -06:00
GS-GOAT
afe122738f Measurement: save 'Show Delta' state between commands #19204 (#19430)
* Measurement: save 'Show Delta' state between commands #19204

When users set Show Delta option to off in the Measure tool, the setting
was not being preserved when the tool was invoked again. This was due to    
using an uninitialized value as the default when loading the preference.  

Changes staged in: FreeCAD\src\Mod\Measure\Gui\TaskMeasure.cpp 

Fixed by:
- Using explicit 'true' as default value when loading Show Delta
preference 
- Maintains existing save functionality
- Ensures consistent behavior on first use
Fixes #19204

* Changed few things to ensure the delta state is saved #19204

added changes:-
1. settings.endGroup()
When we call beginGroup(), it creates a prefix for all subsequent settings operations, All settings will be stored under the "TaskMeasure" group.
endGroup() is needed to close this grouping scope
Without it, subsequent settings operations would still use the "TaskMeasure" prefix

2. settings.sync()
By default, QSettings caches changes in memory and writes them to disk later
sync() makes an immediate write to the settings file
This ensures the setting is saved right away rather than waiting for Qt to decide when to save.
Makes the setting change immediately available for future commands.

-Fixes Measurement: save 'Show Delta' state between commands #19204

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

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

* Added proposed changes to autoSaveChanged() and newMeasurementBehaviourChanged() functions #19204 #19430

Added settings.endGroup() to the following functions:-
1.autoSaveChanged()
2.newMeasurementBehaviourChanged() 
Each beginGroup() should be followed by endGroup().

No need for explicitily calling sync() as it is called automatically from QSettings's destructor and by the event loop at regular intervals.(Refer documentation for more info)

-Fixes Measurement: save 'Show Delta' state between commands #19204 #19430

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-02-11 13:10:53 -06:00
Chris Hennes
a3004c2c0a Merge pull request #19142 from hyarion/refactor/add-template-addobject
Add new addObject<T>() function
2025-02-11 09:42:47 -06:00
Benjamin Nauck
edb4817872 Mod: Use new addObject<T>(...) that requires additional changes 2025-02-10 18:35:38 +01:00
Benjamin Nauck
f1ab1ee0ad Mod: Fix mistakes in type system class names 2025-02-10 18:33:00 +01:00
Benjamin Bræstrup Sayoc
b0b62f3f26 Measure: Use QStringLiteral 2025-02-10 18:32:45 +01:00
tritao
551c2e48fb Gui: Reorganize the selection files into a top Selection folder. 2025-02-03 17:56:57 +01:00
panintended
0511a4d04d QuickMeasure: display correct angle units
Add angle unit user string getter, fix typos for length unit equivalent

Fixes #19307
2025-01-30 15:48:30 +01:00
luzpaz
d982743b70 Fix typos
Found via codespell
2025-01-29 08:31:01 +01:00
Benjamin Nauck
97bf3c5e33 Manual changes to improve isDerivedFrom usage 2025-01-27 16:08:19 +01:00
Benjamin Nauck
6f535f19fb 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
Chris Hennes
8c3bb779fb Merge pull request #19019 from hyarion/refactor/countObjectsOfType
Refactor countObjectsOfType in selection and document
2025-01-14 16:05:12 -06:00
Benjamin Nauck
08fe94ef25 Add template based Document::countObjectsOfType
Also convert code to use this new method
2025-01-14 14:23:46 +01:00
wandererfan
dc77ba60b1 [TD]use transformShape instead of transformGeometry 2025-01-13 21:14:10 -06:00
WandererFan
f144a87539 [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
Chris Hennes
bca4b4f743 Measure: Pass empty arg to QStringLiteral macro
Silences compiler warning about missing expected macro argument (MSVC warning C4003).
2024-12-23 17:55:15 +01:00
Ladislav Michl
0b3adee2ab Base: Quantity: return std::string 2024-12-23 17:48:42 +01:00
Ladislav Michl
379d7ea9d5 Base: Units: return std::string 2024-12-23 17:48:42 +01:00
luzpaz
b0a29fde31 Fix various typos 2024-12-22 08:47:13 -05:00
Murmele
037a46ec70 Add possiblity to autosave current measurement and restarting new measurement (#17717)
* initial commit to implement more interactive measurement functionality

Files: TaskMeasure.cpp and TaskMeasure.h

* Enable artifacts for easy download

Files: sub_buildWindows.yml

* clearSelection before setting new selection

Files: TaskMeasure.cpp

* No need for mSkipSelectionChange

Reason/Description: Because the next onSelectionChanged will be triggered asynchronly
Files: TaskMeasure.cpp and TaskMeasure.h

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

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

* block selection

* Block selection must be done on the taskMeasure, because it is the signal observer

* Set autosave to false by default

Reason/Description: Because the measurement tool is intended to be a temporary tool
Files: TaskMeasure.cpp and TaskMeasure.h

* Add tooltip

Files: TaskMeasure.cpp

* No need to set the selection style

Reason: Because it was changed to normal, so no need to re set it
Files: TaskMeasure.cpp

* No need to clear and reset the selection

Reason/Description: Because it will be done directly in the application. It was required with greedy selection, but now it is anymore required
Files: TaskMeasure.cpp

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

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

* Revert "Enable artifacts for easy download"

This reverts commit 8118323ab4104ada1fb89eebbe72965c5f2f2b67.

* Move autosave and selection mode into a group box and add a possibility to hide those options

Files: TaskMeasure.cpp and TaskMeasure.h

* Use toolbutton with a normal menu instead of a normal QPushButton

Reason/Description: Because it integrates much better
Files: TaskMeasure.cpp and TaskMeasure.h

* QAction uses a bool for the checkstate

Files: TaskMeasure.cpp and TaskMeasure.h

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

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

* Fix compile warnings

Reason/Description: cleanup and fix warnings
Files: TaskMeasure.cpp and TaskMeasure.h

* Add better tool tip

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

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

* fix typo

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-09 11:08:02 -06:00
luzpaz
a633be7342 Fix various typos
Found via codespell.
2024-11-15 20:18:46 +01:00
PaddleStroke
96c1e86e5d Measure: Fix quickmeasure problem with Part::Line objects 2024-11-11 18:17:36 +01:00
wmayer
4e1023cda1 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]
bec354d602 [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
c2a923a027 Measure: Use Base::toDegrees to convert radian to degree 2024-10-22 22:37:01 -05:00
hlorus
bae847a18d MeasureGui: Revert temporary measure object creation (#17109)
* MeasureGui: Revert temporary measure object creation

Reverts the temporary creation of measurement objects that was added in #15122

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

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

* MeasureGui: Adress review comments

- Remove _mDocument and _mGuiDocument
- Replace c-style casts with dynamic_cast
- Add file guard
- Remove leftover canAnnotate method

* MeasureGui: Fix crash when selecting elements from different documents

* MeasureGui: Add additional type check in ensureGroup

* [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-10-14 17:54:13 +02:00
Eric Price
29a4f08ed3 Changed QuickMeasurement to be conservative (#17060)
* Changed QuickMeasurement to be conservative

QuickMeasurement should not measure while tool dialogs are open
this includes but is not limited to editing sketches
also changed several other sanity checks to be opt-in vs opt-out, as discussed.

* move the test if it is safe to measure to when the measurement actually happens - avoids any potential race conditions
2024-10-07 08:33:31 -05:00
PaddleStroke
c6e4f8a946 QuickMeasure: Prevent crash by limiting selection to Part::Features (#16921)
* QuickMeasure: Prevent crash by limiting selection to Part::Features

* chennes' fix

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

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-10-03 09:49:09 -05:00
Benjamin Nauck
dbeeb1534a Fix macos crashes when unhandled exceptions reaches qt 2024-10-02 21:11:41 -06:00
hlorus
299c27ab12 MeasureGui: Also hide delta measurements 2024-09-30 18:24:19 +02:00
hlorus
d186909f20 MeasureGui: Remove leftover reset of _mMeasureObject
This was introduced in af9097ce87 due to a faulty resolve of a merge conflict
2024-09-30 18:22:58 +02:00
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
hlorus
fd83f98c26 MeasureGui: Move _mMeasureType member to local variable
Fixes #16565
2024-09-22 20:34:45 -05:00
PaddleStroke
81d3690397 Measure: Fix quickmeasure globalplacement. 2024-09-19 08:47:57 -05:00