Commit Graph

60 Commits

Author SHA1 Message Date
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
Ladislav Michl
47c1565edf Base: remove explicit namespace-name qualifier from *PyImp.cpp
Explicit Base namespace-name is used randomly across PyImp sources.
Remove it.
2025-04-27 00:05:32 +02:00
Ladislav Michl
24d55dc616 Base: cleanup includes in *PyImp.cpp
Sort includes and implicitely add missing ones. While there
consistently explain where generated files some from.
2025-04-27 00:05:32 +02:00
Ladislav Michl
986a3b4f7a Base, Gui: remove lefovers from xml -> pyi conversion 2025-04-25 11:57:24 +02:00
Jacob Oursland
5b81cd741a python: apply const method annotations to impls. 2025-04-16 20:32:04 -07:00
Benjamin Nauck
d9af862627 Base: Add #include <limits> where used 2025-03-31 23:50:30 +02:00
Benjamin Nauck
ae686942a7 Base: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:37 +01:00
tritao
10513144d9 Base: Standardize on Py::Long type for Python bindings. 2025-02-08 13:14:22 +00:00
Chris Hennes
d8d75ca896 Base: Fix compiler warning 2024-06-10 11:23:40 -05:00
Ladislav Michl
95b37fa806 Base: Do not use else before return 2024-01-21 16:14:12 +01:00
wmayer
7c00932fa0 fix readability-isolate-declarations 2023-11-16 01:22:08 +01:00
wmayer
5c306f6e2a fix readability-*:
* readability-uppercase-literal-suffix
* readability-named-parameter
2023-11-16 01:22:08 +01:00
wmayer
f539138dd9 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
e85c383bff Base: apply clang format 2023-11-13 12:01:26 -05:00
wmayer
2e13a6a5a1 Base: add overloaded method Matrix4D::isUnity() 2023-10-19 19:25:25 +02:00
Jolbas
2d8c280528 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
abbf544495 Base: use NoArgs in MatrixPy 2023-09-27 17:48:53 +02:00
wmayer
4f6ab508d7 Base: fix incorrect method names of Matrix class about diagonal and trace 2023-09-18 01:21:07 +02:00
wmayer
010dca8303 Base: C++ core guidelines: init variables 2023-08-24 18:48:52 +02:00
marioalexis
3d3b5b76f5 Base: Fix warnings -Wredundant-move 2023-07-24 14:39:21 +00:00
marioalexis
98cb5d50af Base: Fix undefined behaviour in row/col functions and code clean up 2022-05-31 11:48:04 +02:00
wmayer
b39c6f62b4 Base: replace several reinterpret_cast 2022-05-11 20:01:40 +02:00
wmayer
9160f06e1c Base: rename BaseExceptionFreeCADError to PyExc_FC_GeneralError 2022-03-17 14:45:48 +01:00
wmayer
d69defaa3c Py: replace BaseExceptionFreeCADError with more suitable exception types 2022-03-17 13:54:23 +01:00
Uwe
7bb7efc55f [Base] Parameter and Matrix: remove unused includes 2022-03-02 13:28:34 +01:00
wmayer
a5e561b31d 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
0penBrain
47e7257cd3 Base: introduce uniform scaling of matrix 2022-02-08 17:18:54 +01:00
0penBrain
538f4dd14b Base: fix move+scale Python error cleaning after parsing args 2022-02-08 17:18:54 +01:00
wmayer
eab9afbbad 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
0penBrain
f986ab46fd Base: fix bug in matrix multiplication (Python API) 2022-02-04 03:50:44 +01:00
wmayer
12eb5dafb1 Base: implement some convenience methods to get/set rows/columns of a matrix 2022-01-27 00:24:44 +01:00
wmayer
af16ab02a0 Base: remove some more deprecated Py2 code
and remove deprecated void from function signature and replace 0 or NULL with nullptr
2021-04-26 10:29:48 +02:00
luz paz
142c2c2c4d Base: remove Py2 code 2021-04-26 09:23:58 +02:00
luz paz
d5f6c096b8 Base: Fix header uniformity, whitespace, and doxygen
[skip ci]
2020-11-22 18:12:16 +01:00
luz.paz
d36c3ebe57 Trivial code formatting for some {.cpp,.h} files 2020-04-06 12:55:27 +02:00
Zheng, Lei
12000cd490 Base: fix __pow__ operator in MatrixPy/PlacementPy/RotationPy 2019-10-07 17:24:30 +02:00
Zheng, Lei
83284a3cdd Base: add Python number protocol support to Placement/Rotation 2019-09-28 15:32:00 +02:00
Zheng, Lei
783947ecd4 Base: improve base python object number protocol 2019-09-28 15:30:23 +02:00
wmayer
e228f23b27 fix -Wreturn-std-move 2019-09-07 14:45:03 +02:00
Zheng, Lei
3fcbf71fb5 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
ba14668e1a add method multVec to MatrixPy class for better consistency 2019-01-22 15:57:10 +01:00
wmayer
83f61b4372 implement true divide handler of the number protocol for Quantity 2018-10-27 15:27:27 +02:00
wmayer
25fb77a5a0 fixes #0002419: Matrix rotation and Units compatibility 2017-10-25 13:50:06 +02:00
looooo
94c68d72c3 py3: base: repair compile-fail 2017-05-21 12:35:41 +02:00
Yorik van Havre
2becb8a0e8 py3: Base: files I-R ported to python3
PyObjectBase.cpp and PyObjectBase.h not included
issue 0000995
2017-05-18 16:00:05 +02:00
wmayer
f408f3180b fix -Wextra in FreeCADBase 2016-09-21 15:02:02 +02:00
wmayer
36ac2e7032 Fix element A41 in 4x4 Matrix class 2015-12-10 17:35:54 +01:00
Sebastian Hoogen
5e51a6cdf7 fixes #0001422: Subclass Exception
inherit Base.FreeCADError form RuntimeError
inherit Part.OCCError from Base.FreeCADError
inherit OCCDomainError from Part.OCCError
inherit OCCRangeError from Part.OCCError
inherit OCCConstructionError from OCCDomainError
inherit OCCDimensionError from OCCDomainError
Added PY_CATCH_OCC macro
replace PyExc_Exception
use FreeCADError in makeWireString
catch exception in BSplineCurve.increasedegree
2014-09-17 11:15:56 +02:00
wmayer
efdbe4659a + fixes #0001418: Base::Matrix4d can't invert rotoinversion 2014-02-17 16:42:28 +01:00
wmayer
89b5d7e6f1 + extend number protocol 2014-02-14 13:53:47 +01:00