Commit Graph

134 Commits

Author SHA1 Message Date
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
hlorus
8fb03c0583 MeasureGui: Auto close task on document deletion 2024-09-18 13:03:56 -05:00
Benjamin Bræstrup Sayoc
a76143b4ca Revert "[Measure] Fix redundant variable assignment"
Fixes #16564. This reverts commit a7831eee4b.

Co-authored-by: Murmele <Murmele@users.noreply.github.com>
2024-09-18 08:36:22 -05:00
Benjamin Bræstrup Sayoc
b0928cf115 [Measure] Redirect enter key press to apply button
Fixes #16401. Now call of the save function is dependent on whether the apply button is enabled. The button is only enabled if valid objects to save.
2024-09-12 16:23:17 +02:00
Benjamin Bræstrup Sayoc
b64cd15535 [Measure] Fix redundant variable assignment 2024-09-12 16:17:29 +02:00
Murmele
f7d5d9f0d8 Measure: Show delta option also in interactive mode (#16379)
* Initial commit to apply delta also for interactive measurement
* Not required special logic to check if possible, it can be easily checked if the property exists
* remember setting so it is not required to turn it always on
2024-09-09 21:39:27 -05:00
Syres916
1fc508651b [Measure] Disable QuickMeasure for TechDraw, Spreadsheet, Part Container and Origin objects (#16225)
* [Measure] Disable QuickMeasure for TechDraw objects
* [Measure] Add spreadsheet, Part containers and origins to the exemptions
2024-09-08 16:50:26 -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
hlorus
979ca3bbd1 [MeasureGui] Use temporary measure object creation (#15122)
* MeasureGui: Store measure type in TaskMeasure

* MeasureGui: Avoid adding measurement to document during command interaction

* [Gui] Add check for document in VPDocumentObject::getActiveView

* MeasureGui: Track the document when adding objects

* MeasureGui: Cleanup python measurement creation

* [Gui] Add isAnnotationViewProvider method

* [Gui] Check if viewprovider is added as an annotation in getActiveView

* [Gui] Add takeAnnotationViewprovider method to Gui::Document

* [Gui] Make addViewProvider public

* [MeasureGui] Add existing view provider to document when storing measurement

* [MeasureGui] Fix invocation of initial label placement

* [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-09-02 11:54:05 -04: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
wmayer
7cf6c4f5df Measure: Prepare for clang-format 2024-08-25 13:39:38 +02:00
luzpaz
b2f549f114 Measure: fix linting TaskMeasure.cpp
Adds missing whitespace before opening brackets (observed in #15907)
2024-08-22 18:54:45 -05:00
hlorus
5d38aed6e8 MeasureGui: Return the relative label offset for the initial position 2024-08-19 12:25:05 -04:00
hlorus
c7d6518f87 MeasureGui: Explicitly trigger the initial positioning of measurements 2024-08-19 12:25:05 -04: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
Chris Hennes
debe1f933b Merge pull request #15481 from Syres916/Measure_Restrict_Availability
[Measure] Correctly restrict command availability
2024-07-20 23:33:03 -05:00
Syres916
76b8be7082 [Measure] Fix Lint Feedback 2024-07-17 18:18:13 +01: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
Syres916
63f246ea70 [Measure] Correctly restrict availability 2024-07-17 14:43:09 +01:00
wmayer
d4cd9a396a PyObject_CallObject returns new reference 2024-07-15 18:05:30 +02:00
PaddleStroke
04d9d28f27 Measure: Quickmeasure: disable for sketch in edit mode due to incorrect behavior. 2024-07-15 10:08:31 -05: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
Chris Hennes
f8deaaaf86 Merge pull request #15190 from hlorus/measure_dependency_violation
MeasureGui: Fix measure dependency violation
2024-07-13 19:56:23 -05:00
Chris Hennes
52af37064c Correct typo 2024-07-10 08:08:15 -05:00
luzpaz
2837b46c3e Fix various typos throughout the codebase 2024-07-08 17:19:20 -05:00
Chris Hennes
650ccfcd6b Measure: Fix repeated element name in UI file 2024-07-08 12:20:15 -04:00
hlorus
eb05effb9a MeasureGui: Insert measure command into menu & toolbar 2024-07-05 10:54:38 +02:00
hlorus
ab1d86235d [MeasureGui] Move measure cmd and task into measure module
...to avoid core depending on modules
2024-07-04 14:56:49 +02:00
hlorus
e49d950eef MeasureGui: Use SoFrameLabel to display delta dimensions in MeasureDistance 2024-07-01 18:14:33 +02:00
hlorus
adb5eaf38c MeasureGui: Add colon after symbol of delta dimensions 2024-07-01 18:14:24 +02:00
hlorus
1d861559f3 MeasureGui: Paint icons in textcolor 2024-07-01 17:51:51 +02:00
hlorus
600f44484d MeasureGui: Show delta symbol in front of component dimensions 2024-07-01 08:25:03 -05:00
hlorus
a9adc5c24b MeasureGui: Optionally show delta components in VPMeasureDistance 2024-07-01 08:25:03 -05:00
hlorus
a3471e41af MeasureGui: Add globalSeparator to VPMeasureBase
This allows annotations in global space
2024-07-01 08:25:03 -05:00
hlorus
2aa37bce27 MeasureGui: Add back DimensionLinear node kit 2024-07-01 08:25:03 -05:00
hlorus
fb53d4cd4f Measure: Add X, Y and Z component properties to MeasureDistance 2024-07-01 08:25:03 -05:00
Roy-043
123f05aecb Measure: Prefs: add unit to DefaultFontSize (px) and title in sentence case 2024-06-26 11:52:35 -05:00