Commit Graph

225 Commits

Author SHA1 Message Date
theo-vt
a431ccc156 Quickmeasure: Allow measuring the length of a parabola 2025-10-19 12:31:47 -05:00
Chris Hennes
9780cf931f Update translations 2025-10-05 2025-10-07 19:21:58 +02:00
Benjamin Nauck
99c24f1c2b Measure: Remove from menu + transfer ownership back
As discussed in 23399, discoverability is really poor as users doesn't know what Quick Measure is,
neither is it easy to find out as there's no visual feedback when toggling this feature.
The intension was to keep the command and only remove it from the menu, but that wasn't possible
due to ownership of quick measure object was inside the command. In addition the parameter had to
be renamed as well as mashing the qm button made them end up in an unknown state.

As the measurement can be disabled now by simply hiding the info text from context menu, we don't
need to keep the old toggling functionality.
2025-10-04 21:48:48 +02:00
Benjamin Nauck
6aff735482 Gui: Only measure with Quick Measure if showing in status bar 2025-10-04 21:48:48 +02:00
Markus Reitböck
93830929ae Measure: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
 should be considered an optimization, not a requirement. In particular, do not explicitly include a
 precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
 generated precompile header on the compiler command line instead. This is more portable across
 the major compilers and is likely to be easier to maintain. It will also avoid warnings being
 generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-23 22:39:35 +02:00
Markus Reitböck
749ac36615 do not use precompiled header for setting global compiler definitions and to disable compiler warnings
only 4 of these warnings are still relevant, CMake shall be used to disable them

Compiler definitions:

  NOMINMAX:
    * is already globally defined in SetGlobalCompilerAndLinkerSettings.cmake

  WIN32_LEAN_AND_MEAN:
    * use CMake target_compile_options on relevant targets

Warnings that still occur:

  C4251, C4273, C4275: all related to dllimport / export
    * use CMake target_compile_options on relevant targets

  C4661: no suitable definition provied for explicit template instantiation request
    * triggered in Mesh because of Vector3D in Base - not all functions are defined in header
    * use CMake target_compile_options on relevant targets

Warnings that are Currently not triggered (fix code if they appear again):

  C4005: macro redefinition

  C4244: argument conversion, possible loss of data

  C4267: conversion from size_t to type, possible loss of data

  C4305: truncation from type1 to type2
    * only occurrence disabled in Reader.cpp

  C4522: multiple assignment operator specified

  C5208: unnamed class in typedef name

Obsolete Compiler warnings:

  C4181: not mentioned in Microsoft docs anymore

  C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
    * throw(optional_type_list)  deprecated in C++17

  C4482: nonstandard extension used: enum 'enumeration' used in qualified name
    * not generated for compilers that support C++11

  C4503: 'identifier': decorated name length exceeded, name was truncated
    * obsolete since Visual Studio 2017

  C4786: not mentioned in Microsoft docs anymore
2025-09-11 20:21:04 -05:00
wmayer
93db4c7d8a CMake: Replace include_directories with target_include_directories 2025-09-08 19:04:34 +02:00
Chris Hennes
84c810dc4a Merge pull request #23521 from z0r0/python-interface-bindings-final
Core: Python interface bindings cleanup
2025-09-08 10:58:15 -05:00
Chris Hennes
fd20bdd6d8 Update translations 2025-09-03 2025-09-04 11:37:11 +02:00
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
Ian 'z0r0' Abreu
0217c1ef97 updating docblock locations. 2025-09-02 08:28:47 -04:00
Ian 'z0r0' Abreu
8d56e3e529 reverting author metadata 2025-09-02 08:25:37 -04:00
Ian 'z0r0' Abreu
b24040ee52 Adding license documentation to interface class docblocks. 2025-09-01 21:50:59 -04:00
Benjamin Nauck
e5ed0b3cb9 Merge pull request #23399 from wwmayer/quick_measure
Measure: Fix quick measure command
2025-09-01 21:11:26 +02: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
Ian 'z0r0' Abreu
6e75aef81c Finalizing Python interface bindings for Import, Measure, Mesh, Points. 2025-08-31 15:34:03 -04:00
Max Wilfinger
9cae60a70f Update UI strings from Crowdin reports for consistency 2025-08-28 11:45:38 -05:00
Chris Hennes
b1b97e44f1 Update translations 2025-08-28 16:14:49 +02:00
wwmayer
8512585a41 Measure: Fix quick measure command
* Clear status bar when switching off quick measure
* Activate quick measure by default
* Remove command from toolbar as there is currently no icon
2025-08-27 16:01:54 +02:00
wmayer
4a5217075c Measure: Fix some linter warnings 2025-08-25 09:29:29 +02:00
wmayer
9540cfe0ea Measure: Improve TaskMeasure dialog
+ Use Qt's translation of the Save and Close buttons
+ Use QShortcut instead of eventFilter() because the latter is
  too aggressive eating all Enter and ESC events

This fixes the remaining issues as mentioned at the PR 17109
2025-08-25 09:29:29 +02:00
wmayer
75236d4b13 Measure: Allow any surface type for MeasureArea 2025-08-25 09:23:54 +02:00
wmayer
8165d12607 Measure: Fix TaskMeasure
Made several fixes to TaskMeasure:
* Move to correct namespace
* Handle possible exception in update() method
* Add null pointer checks for buttonBox
* Cannot use 'Measure::MeasurePython' as template argument in addObject<>
  because the macro PROPERTY_HEADER_WITH_OVERRIDE determines the invalid
  string 'App::FeaturePythonT<FeatureT>' so that an exception is raised

Note: The changes might fix issue 20304
2025-08-25 09:21:33 +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
5d3f9cac3f Measure: Implement quick measure as command and make it toggable
The quick measure can considerably slow down the system when selecting
part elements. With this change the user is able to turn off this
bottleneck.
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
Chris Hennes
3e1cc8302a Update translations 2025-08-18 17:55:24 +02:00
WandererFan
c15cfd6615 [Meas]Fix visibility at load (#23145)
* [Meas]Fix visibility at load

* [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-18 10:36:05 -05: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
bb9d0a44ec Measure: Use string based addObject as workaround as type is an alias (#22462)
* [Measure] Revert one specific piece of code from PR19142

* Measure: Add comment for workaround

---------

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2025-07-14 18:41:55 +00: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
Kris
0090566724 Gui: Move Submenu Commands in Tool Menu (#20864)
* Moved tools submenu commands and title case

* Apply suggestions from code review

Co-authored-by: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com>

---------

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
Co-authored-by: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com>
2025-06-19 08:33:36 +02:00
pre-commit-ci[bot]
f03900b58d [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-06-13 10:40:48 +02:00
Syres916
6eecd08f7c [Gui] C++ preparation for deprecation of QCheckBox…
…stateChanged -> checkStateChanged
2025-06-13 10:40:48 +02:00
Yorik van Havre
bba4a7b990 Translations: updated ts files 2025-06-02 11:07:28 +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
e4238f58e1 Measure: Fix delta label text size scaling (#21467)
* Measure: Fix delta label font size

- Add font size field to ViewProviderMeasureBase which connects to other fields
- Remove dead code in DimensionLinear which internally is using FrameLabel
- Connect FrameLabels's fontsize property to DimensionLinear's property

* [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-05-20 12:10:35 +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
Florian Foinant-Willig
8a733f450b Measure: Prevent user to remove core properties 2025-04-22 23:52:17 +02:00
Benjamin Nauck
f932c7e4e0 Use Base::toRadians() instead of manually converting 2025-04-15 07:16:36 +02:00
Kacper Donat
b300c80b90 Base: Use explicit pointer syntax for freecad_cast (#20694)
* Base: Use explicit pointer syntax for freecad_cast

This aligns our custom cast with other casts

* All: Use explicit pointer syntax for freecad_cast
2025-04-11 14:11:33 +00:00
Kacper Donat
35a9673a75 Base: Rename Base::freecad_dynamic_cast into freecad_cast
This is to make it shorter and easier to use. QT does the same thing
with their qobject_cast.
2025-04-07 10:32:28 -05:00
Jonathan Zirkle
ee6f757c57 Mod: Convert from dynamic to static casts (#20452) 2025-03-31 15:17:51 +02:00
Benjamin Nauck
bc462c44cc Measure: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:38 +01:00