Commit Graph

224 Commits

Author SHA1 Message Date
Chris Hennes
8500ed0520 Update translations 2025-10-05 2025-10-07 19:21:58 +02:00
Benjamin Nauck
a2ae5af2b4 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
2e850f0611 Gui: Only measure with Quick Measure if showing in status bar 2025-10-04 21:48:48 +02:00
Markus Reitböck
ab8fafdf96 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
496b31b087 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
ac51455a0a CMake: Replace include_directories with target_include_directories 2025-09-08 19:04:34 +02:00
Chris Hennes
b699349e9b 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
c0d1151633 Update translations 2025-09-03 2025-09-04 11:37:11 +02:00
tetektoza
ed27c9947d 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
78ec52f1a8 updating docblock locations. 2025-09-02 08:28:47 -04:00
Ian 'z0r0' Abreu
b1c551026e reverting author metadata 2025-09-02 08:25:37 -04:00
Ian 'z0r0' Abreu
b0b9f8fc35 Adding license documentation to interface class docblocks. 2025-09-01 21:50:59 -04:00
Benjamin Nauck
c48e1bbae2 Merge pull request #23399 from wwmayer/quick_measure
Measure: Fix quick measure command
2025-09-01 21:11:26 +02:00
theo-vt
bb099b0962 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
ca435629b8 Finalizing Python interface bindings for Import, Measure, Mesh, Points. 2025-08-31 15:34:03 -04:00
Max Wilfinger
3b215da227 Update UI strings from Crowdin reports for consistency 2025-08-28 11:45:38 -05:00
Chris Hennes
f3c675ed5b Update translations 2025-08-28 16:14:49 +02:00
wwmayer
ae2748f2e4 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
792c0ae5e8 Measure: Fix some linter warnings 2025-08-25 09:29:29 +02:00
wmayer
f42f3dc069 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
f00fbe0070 Measure: Allow any surface type for MeasureArea 2025-08-25 09:23:54 +02:00
wmayer
d1a84ab538 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
14de080897 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
8e247bb469 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
213c0940df 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
40b1ea294c Update translations 2025-08-18 17:55:24 +02:00
WandererFan
db5e855ed8 [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
a5a59ff2e3 Fix various typos 2025-08-12 12:18:23 -05:00
theo-vt
2c7d830603 Measure: give a hint to ::getShape so that compound shapes may be resolved 2025-08-11 00:24:56 +02:00
Ryan Kembrey
20844bec71 Measure: Update UI strings for consistency
Closes: #22370
2025-08-04 20:13:26 +02:00
Ian 'z0r0' Abreu
66ada8e10a fixing unnecessary list import 2025-07-28 08:59:52 -05:00
Syres916
aa605f0126 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
a7ec15f725 [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
7619b638e7 Measure: Remove redundant check for edges > 0 2025-06-20 22:49:34 +02:00
Kris
0b6a451790 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]
bc5cf27109 [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
39dc1e6210 [Gui] C++ preparation for deprecation of QCheckBox…
…stateChanged -> checkStateChanged
2025-06-13 10:40:48 +02:00
Yorik van Havre
26e16765b0 Translations: updated ts files 2025-06-02 11:07:28 +02:00
theo-vt
1a0a68ae69 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
86fe91ba31 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
900afce86f Measure: Add MeasureElementType::Surface 2025-05-20 12:01:14 +02:00
bofdahof
ba2c2ca5ad Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Ladislav Michl
9683cf1e4f Base: rename Exception's PascalCase methods to camelCase 2025-05-05 23:50:01 +02:00
Florian Foinant-Willig
d5ba39d0ca Measure: Prevent user to remove core properties 2025-04-22 23:52:17 +02:00
Benjamin Nauck
21fbf8e539 Use Base::toRadians() instead of manually converting 2025-04-15 07:16:36 +02:00
Kacper Donat
77e40b9747 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
9d97d1c895 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
4ca7d1a297 Mod: Convert from dynamic to static casts (#20452) 2025-03-31 15:17:51 +02:00
Benjamin Nauck
f72ffc438b Measure: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:38 +01:00
tritao
cdab9c7837 CMake: Cleanup targets with transitive dependencies 2025-03-17 12:12:06 +00:00