Commit Graph

36 Commits

Author SHA1 Message Date
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
e85c383bff Base: apply clang format 2023-11-13 12:01:26 -05:00
mosfet80
d453672ab8 [BASE] Removed dead code (#10330) 2023-08-28 10:41:20 -05:00
Chris Hennes
3b79fd58b7 Base: Wrap PyArg_ParseTupleAndKeywords 2023-08-25 14:52:30 -05:00
wmayer
010dca8303 Base: C++ core guidelines: init variables 2023-08-24 18:48:52 +02:00
wmayer
da63fbaacf Base: catch exception raised by Rotation::setValue 2023-03-01 18:43:15 +01:00
wmayer
bb566c7777 Base: add overloaded method isIdentity() to Rotation and Placement that accepts a tolerance 2023-01-03 10:54:47 +01:00
wmayer
91ea39a5c0 Base: extend Placement/Rotation API
* Add Placement::isSame() and expose to Python
* Add Placement::multRight/Placement::multLeft
* Fix PlacementPy::rotate
* Add Rotation::multRight/Rotation::multLeft
* Add a test feature FeatureTestPlacement for uni tests
* Add unit tests
2022-08-09 11:54:05 +02:00
wmayer
6067b18774 Base: [skip ci] improve whitespaces 2022-08-09 08:25:59 +02:00
Markus Fröschle
4b538a38ab Fix Placement.rotate() to match documentation
Documentation for Placement.rotate() claims this function would be
compatible to TopoShape.rotate() which isn't exactly correct as the
generated placements differ because of backwards multiplication.

This commit adds a "comp" (as in "compatible") keyword argument that -
when "True" (default is False) - produces a Placement that is interchangable with the one
that is generated from TopoShape.rotate().
2022-08-09 07:22:46 +02:00
wmayer
201f4c9a5a Core: replace PyObject_IsTrue with Base::asBoolean 2022-07-16 14:04:05 +02:00
marioalexis
89803987a1 Base: Use PyObject_IsTrue in combination with conditional ternary operator 2022-06-22 19:50:03 -04:00
wmayer
b39c6f62b4 Base: replace several reinterpret_cast 2022-05-11 20:01:40 +02:00
wmayer
882e34f2ce Base: modernize C++11
* use nullptr
2022-03-23 16:57:25 +01:00
wmayer
d69defaa3c Py: replace BaseExceptionFreeCADError with more suitable exception types 2022-03-17 13:54:23 +01:00
wmayer
e4435cdcba Base/App: fix warnings from code analysers:
* convert old-style-casts to explicit C++ casts where possible
* make some implicit conversions explicit
2022-03-06 23:49:30 +01:00
Uwe
9a42b61fcb [Base] Py and Placement: remove unused includes 2022-03-01 12:13:58 +01:00
wmayer
4d87039635 Base: modernize C++11
* remove redundant void-arg
* use nullptr
* replace deprecated headers
2022-01-25 20:21:30 +01: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
wmayer
e0bb5701f6 expose Placement.slerp to Python 2019-10-12 23:58:54 +02:00
DeepSOIC
3da76af1f9 Base: Placement: change argument order of slerp() in Py
to be consistend with that of C++ one, and of RotationPy
2019-10-12 20:35:20 +02:00
DeepSOIC
23e708323c Base: Placement: expose ScLERP to python 2019-10-12 15:39:39 +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
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
138ddcbeed add method Placement::isIdentity 2018-09-05 21:19:16 +02:00
wmayer
0d7831e196 move Placement.isNull to Placement.isIdentity
add isNull for backward compatibility
2017-12-13 19:13:18 +01:00
wmayer
25bf33077e rename Placement.isNull to Placement.isIdentity
implement Rotation.isNull and Rotation.isIdentity
2017-12-13 17:00:38 +01:00
wmayer
6a66073928 + implement rich compare protocol of Python interface for Placement & Rotation 2016-05-18 11:26:27 +02: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
Yorik van Havre
9656a989b2 Added 0000650 - Placement.isNull() function 2012-03-28 10:39:10 -03: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