Commit Graph

45 Commits

Author SHA1 Message Date
PhoneDroid
c913317c28 [ Base ]: Updated SPDX 2025-10-14 10:00:04 -05:00
Markus Reitböck
5a423dab39 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
wmayer
11a05b71b7 Base: Use nested std::array for Matrix4D class 2025-06-16 10:05:43 +02:00
wmayer
13232cbc7b 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
7998f57048 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
e9ef35c53d 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
Benjamin Nauck
3253f2c2de Base: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:37 +01:00
wmayer
3ac4dc0686 fix cppcoreguidelines-*
* cppcoreguidelines-init-variables
* cppcoreguidelines-c-copy-assignment-signature
* cppcoreguidelines-macro-usage
* cppcoreguidelines-non-private-member-variables-in-classes
* cppcoreguidelines-pro-type-member-init
* cppcoreguidelines-slicing
* cppcoreguidelines-special-member-functions
* cppcoreguidelines-virtual-class-destructor
2023-11-16 01:22:09 +01:00
wmayer
365e7136cd fix bugprone-*
* bugprone-throw-keyword-missing
* bugprone-unhandled-self-assignment
* bugprone-suspicious-string-compare
* bugprone-reserved-identifier
* bugprone-narrowing-conversions
* bugprone-macro-parentheses
* bugprone-implicit-widening-of-multiplication-result
* bugprone-exception-escape
* bugprone-copy-constructor-init
2023-11-16 01:22:09 +01:00
wmayer
a602003747 fix readability-isolate-declarations 2023-11-16 01:22:08 +01:00
wmayer
bd88162b9d fix readability-*:
* readability-const-return-type
* readability-container-data-pointer
* readability-container-size-empty
* readability-delete-null-pointer
* readability-else-after-return
* readability-inconsistent-declaration-parameter-name
* readability-redundant-member-init
* readability-redundant-smartptr-get
* readability-redundant-string-cstr
* readability-use-anyofallof
* readability-static-definition-in-anonymous-namespace
* readability-static-accessed-through-instance
* readability-simplify-boolean-expr
2023-11-16 01:22:08 +01:00
wmayer
a42d6f815f Base: apply clang format 2023-11-13 12:01:26 -05:00
wmayer
985def3416 Base: apply clang format 2023-11-13 12:01:26 -05:00
wmayer
2265198ffe Base: add overloaded method Matrix4D::isUnity() 2023-10-19 19:25:25 +02:00
Jolbas
5d39d7c3e9 Matrix.decompose() fix
Fixes some errors when matrix has zero scale in one or two directions
2023-09-28 15:25:29 -05:00
Jolbas
31637adaa0 Create rotation from any matrix
To help find a matrix components a decompose method is added to Matrix class
2023-09-28 15:25:29 -05:00
wmayer
e5dca19ed6 Base: fix many lint warnings in Matrix class 2023-09-18 01:21:07 +02:00
wmayer
097d5d6fee Base: C++ core guidelines: init variables 2023-08-24 18:48:52 +02:00
wmayer
761905dbc2 Base: modernize C++: use range-based for loop 2023-08-14 14:09:29 +02:00
Jolbas
554a40f91c Fix create Rotation from scaled matrix
Support for creation of Rotation from matrices which is a combination of non uniform scale and a rotation
Fixes according to review
Scale -1 is Uniform, Not NoScaling
Fix hasScale() when negative scale
2023-02-24 20:33:40 -06:00
wmayer
4e42ff7baa Base: modernize C++: replace 'typedef' with 'using' 2022-08-29 11:42:09 +02:00
wmayer
133be410ca Base: improve initialization according to cpp core guidelines 2022-06-04 13:17:27 +02:00
Zheng, Lei
8bec44934b Fix mixed line endings 2022-04-26 12:52:55 -05:00
Chris Hennes
b5c72abee4 Base: PR6497 move return statement to new line 2022-03-29 12:34:34 -05:00
Uwe
8335466b27 [Base] Parameter and Matrix: remove unused includes 2022-03-02 13:28:34 +01:00
wmayer
0208608b9e Base: fix Matrix4D::hasScale
* If all column vectors of the 3x3 sub-matrix are equal the function incorrectly claims that it's uniform scaling.
* Detect also non-uniform scaling and if was applied from the left or right side
* Replace the int with an enum and expose it to Python
* Add several new unit tests
2022-02-15 21:05:11 +01:00
Yann LEROY
82090b6a8c Base: Remove old unused C-style function
Those function was used by a commented code, hence never called.
Since it don't have been change for a long time,
it should be safe to remove them.
2022-02-05 19:03:39 +01:00
wmayer
9d9de3d51b Base: [skip ci] add comment about possible issues with Matrix4D::hasScale() 2022-02-04 20:28:46 +01:00
wmayer
a5f0265a43 Base: support of multiplication of a matrix with a scalar, add functions to check whether it's the unit or null matrix 2022-02-04 14:35:27 +01:00
wmayer
cad0d01883 Base: modernize C++11
* remove redundant void-arg
* use nullptr
* replace deprecated headers
2022-01-25 20:21:30 +01:00
luz paz
01b21e0d06 Base: Fix header uniformity, whitespace, and doxygen
[skip ci]
2020-11-22 18:12:16 +01:00
wmayer
52916175ed start to replace old C-style casts with static_cast or reinterpret_cast, avoid implicit casts 2019-09-16 17:59:18 +02:00
Zheng, Lei
7e3c7a165e Base: fix Matrix4D::hasScale() tol checking 2019-09-10 14:17:06 +02:00
luz.paz
e9caeef557 Fix typos in src/Base 2019-08-17 15:32:49 +02:00
Zheng, Lei
2d9ca92594 Base: misc patches
Convenience macros/function (in Interpreter.h)

* FC_PY_GetObject/Callable(), look for callables in a python object,
  which will be used in future patch to improve performance in various
  python observer/features.

* pyCall(WithKeywords)(), helper function to invoke the callable

Matrix4D:

* hasScale(), check if there is any scale in the transformation. If so,
  further check if the scale is uniform or not. This will be used in
  future patch for Part::TopoShape to decide which type of transform to
  apply.

Placement:

* translate/rotate(), new convenience API

Rotation:

* isSame/multiVec(), new convenience API

Polygon2d:

* Intersect(), GetCenter(), new convenience API.

FlagToggler:

* New class for exception safe flag toggling, similar to StateLocker
  but with template (actually, FlagToggler is added earlier by me).

BitsetLocker:

* New class for exception manipulation of a std::bitset variable.
2019-08-17 14:52:08 +02:00
wmayer
bb81365cb6 move Hat and Dyadic product to Matrix class 2016-12-04 17:05:58 +01:00
Kirill Gavrilov
f023c98eda + fixes: #0002109: Matrix4D - add missing constructor body 2015-05-19 20:10:48 +02:00
wmayer
2241f2ad1c + fixes #0001364: Issue 1256 is not actually fixed 2014-01-24 13:54:57 +01:00
wmayer
34a303e689 0001256: Order of operations for Matrix is nonintuitive, needs documentation 2013-09-26 22:19:59 +02:00
jriegel
00ea24e07e Integrate Werners & Jans double branch
Move from float to double
Further suggestions for float -> double move
Moved Tools2D from float to double
More suggestions for float->double move from Gui subdirectory
Changes to FEM constraint visuals for float->double move
Suggested changes for float -> double move
Suggestions for Part module moving float -> double
2013-09-24 11:00:57 +02:00
wmayer
751eef8d54 Add nullify method to Matrix class 2013-07-23 11:21:31 +02:00
wmayer
e152820fc8 Trimming & cutting from python 2012-08-15 15:47:57 +02:00
Sebastian Hoogen
f6911e4660 Matrix4D::analyse function
it returns a textual description of the transformation
2012-06-13 10:35:28 +02:00
wmayer
6e4f689079 0000623: Matrix and Vector API extension 2012-03-11 16:22:17 +01:00
wmayer
120ca87015 + unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-10 13:44:52 +00:00