Commit Graph

1542 Commits

Author SHA1 Message Date
Chris Hennes
39d39f34c3 Update translations 2025-09-25 2025-09-25 17:25:13 +02:00
Chris Hennes
29c69a4689 Update translations 2025-09-15 2025-09-16 09:55:13 +02:00
Markus Reitböck
f0eca551b3 Base: 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-14 09:47:01 +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
Markus Reitböck
965109dd73 missing includes in Base, App and Gui headers (#23854)
* missing includes in Base, App and Gui headers

header should be self contained

* use cstddef header instead of stddef.h

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

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-09-11 18:58:44 -05:00
Chris Hennes
3d65ae46d5 Merge pull request #23746 from 3x380V/cmake
CMake: Use scoped include and library directories
2025-09-10 21:54:51 -05:00
Chris Hennes
58a8d589a7 Update translations 2025-09-09 2025-09-10 08:53:41 +02:00
wmayer
93db4c7d8a CMake: Replace include_directories with target_include_directories 2025-09-08 19:04:34 +02:00
Chris Hennes
1f05f5eda4 Merge pull request #23351 from 3x380V/fileinfo
Core: Modernize Fileinfo
2025-09-07 21:28:11 -05:00
Ladislav Michl
88f76f3605 Base: UnitsSchema: use basic imperial conversion constants
Use well defined basic constants for conversion of imperial units.
This makes code hopefully easily readable and verificable.
2025-09-05 17:31:55 +02:00
Ladislav Michl
1cd47c2dd4 Base: add back Imperial for Civil Engineering unit conversions
Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
2025-09-05 17:31:54 +02:00
Ladislav Michl
02e02b56a9 Base: pass format specifiers to UnitsSchemasData::runSpecial
Make toFractional() aware of desired fractional inch denominator.

Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
2025-09-05 17:31:54 +02:00
Ladislav Michl
01b547912f Base: QuantityFormat: avoid storing formatting defaults
User defined precision and fractional inch are stored on QuantityFormat
construction making changes persistent to object life time.
Change that so until not explicitely overriden, user defined values
are always returned.

Co-authored-by: Matthias Danner <28687794+matthiasdanner@users.noreply.github.com>
2025-09-05 17:31:54 +02:00
Ladislav Michl
e7cd72b2e0 Base: refactor unit formatting defaults
Defaults for both precision (number of digits after decimal point)
and denominator (number of fractions) are defined on various places
making difficult to find which default is used for various tasks.
Store these values at one central place: UnitsApi. Unless overriden
by user, default values are defined by unitSchemasDataPack.
2025-09-05 17:31:54 +02:00
Ladislav Michl
28c256ba07 Gui: fix 'Minimum fractional inch' preference visibility
Default Unit Schema is not yet changed in onUnitSystemIndexChanged
callback handler, so index needs to be used to request currently
selected one.

Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
2025-09-05 17:31:54 +02:00
Ladislav Michl
afa5be6ff5 Base: Quantity: attribute pressure quantities to pressure unit
Although CompressiveStrength is of the same dimension as Pressure,
make it more straightforward and use base unit.
2025-09-05 17:31:54 +02:00
Ladislav Michl
2d6a946949 Base: Quantity: remove redundant 'this' 2025-09-05 17:31:54 +02:00
Ladislav Michl
a067083a0b Base: UnitsApi: remove nowhere called init() 2025-09-05 17:31:54 +02:00
Ladislav Michl
8eea79fe05 Base: make UnitsApi::toNumber method of Quantity
This static method takes Quantity as a parameter, so make it
method of Quantity directly.
2025-09-05 17:31:54 +02:00
Ladislav Michl
e3852f7732 Base: make UnitsApi::toString method of Quantity
This static method takes Quantity as a parameter, so make it
method of Quantity directly.
2025-09-05 17:31:54 +02:00
Chris Hennes
fd20bdd6d8 Update translations 2025-09-03 2025-09-04 11:37:11 +02:00
Benjamin Nauck
04e085cba3 Merge pull request #23344 from 3x380V/moment
Core: Distinguish between energy and torque physical quantities
2025-09-02 23:58:19 +02:00
Chris Hennes
8221ab77d7 Merge pull request #23503 from maxwxyz/issue-22123
Fix STEP import with bad string behavior
2025-08-31 23:23:25 -05:00
Chris Hennes
c26e3e9756 Base: Allow all valid Python 3 identifier characters
Note: Does not check for keywords, only character classes (not a change from the original code).
2025-08-31 21:39:49 +02:00
pre-commit-ci[bot]
b44dc26ff1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-08-31 12:42:10 +00:00
wmayer
696c18b6da App: Fix output string to XML
Not all unicode characters are allowed as XML output. When writing disallowed characters the SAX parser throws an exception
when loading a project file that results into a broken document and thus to a possible loss of data.

This PR replaces all disallowed characters with an underscore and prints a warning.

This fixes https://github.com/FreeCAD/FreeCAD/issues/22123
Note: It does not fix an already corrupted project file.
2025-08-31 14:38:05 +02:00
captain0xff
6e896b1248 PartDesign: add interactive gizmos 2025-08-30 17:02:52 +02: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
xtemp09
f20c1a0102 Simplify repr() function 2025-08-25 10:38:39 -05:00
Ladislav Michl
3354125a0f Base: Add moment to the internal unit schema 2025-08-25 00:05:06 +02:00
Ladislav Michl
f934e86dc1 Base: Quantity: Assign work unit to all energy quantities
Fixes: 847e2f5c85 ("Base: Units: refactor")
2025-08-25 00:05:06 +02:00
wmayer
12acd1da6c Base: Modernize FileInfo 2025-08-22 15:20:25 +02:00
Kacper Donat
3a209a7e90 Base: Allow constexpr Color
This changes Base::Color class so it can be used as constexpr, useful
for defining various defaults.
2025-08-12 21:25:41 +02:00
Andrés Barreiro
584022fb7d Add deduction guide for Base::Overloads 2025-08-11 11:53:23 +02:00
Chris Hennes
eea9f81a90 Base: Clean up ParameterManager::LoadDocument 2025-08-04 18:04:59 +02:00
Chris Hennes
983ec3815c Base: Disable default entity resolution
Fixes CWE-611, guards agains XML external entity attacks.
2025-07-24 22:23:39 +02:00
Chris Hennes
803a050082 Base: Add missing header to PCH 2025-07-22 08:59:03 +02:00
Chris Hennes
6974c83f9a Base: Switch from toTimeSpec to toTimeZone for Qt 6.9 compatibility 2025-07-20 22:48:48 +02:00
Chris Hennes
95a7dfd515 Remove boost::filesystem includes 2025-07-18 20:26:56 +02:00
Kacper Donat
a32594faea Gui: Add ThemeTokenManager class to contain theme parameters
This class aims to implement Design Token idea into FreeCAD themes. It
allows themes to use generic variables with generic values so we could
use one qss theme and change the style based on values from preference
packs.
2025-07-07 00:07:31 +02:00
Kacper Donat
38ec685f2d CAM: Fix origin indicator for Job
This commit fixes how origin (coordinate system) indicator looks. Before
it showed as disc, and now it shows as point which is more approperiate
given the context.
2025-07-05 18:46:01 +02:00
wmayer
abe64f7576 Base: Use nested std::array for Matrix4D class 2025-06-16 10:05:43 +02:00
wmayer
74a22df884 Base: Simplify Base::Matrix4D
As discussed in https://forum.freecad.org/viewtopic.php?t=65959 reduce code duplications
2025-06-16 10:05:43 +02:00
wmayer
4634e62867 Base: Use i,j consistently for iterations Matrix4D
As discussed in https://forum.freecad.org/viewtopic.php?t=65959
use consistently i,j to iterate over rows and columns
2025-06-16 10:05:43 +02:00
wmayer
2f736ded84 Base: Do not use short int in Matrix4D
As discussed in https://forum.freecad.org/viewtopic.php?t=65959
replace short with int.
2025-06-16 10:05:43 +02:00
Chris Hennes
9714e2f87a Base: Disable XML external entity expansion
Addresses https://github.com/FreeCAD/FreeCAD/security/code-scanning/29
2025-06-13 10:44:01 +02:00
Benjamin Nauck
7105a2332e Merge pull request #21147 from 3x380V/units
Units rework II
2025-06-04 15:58:00 +02:00
wmayer
edc8013670 Base: Fix size in array 2025-06-04 14:14:20 +02:00
wmayer
9a7646ab74 Base: Fix typo 2025-06-04 14:14:20 +02:00