Chris Hennes
f5806841b6
Merge pull request #19907 from benj5378/getAttribute
...
Base: make getAttribute template
2025-05-12 10:39:55 -05:00
Benjamin Bræstrup Sayoc
492b8312b3
Base: make getAttribute template
2025-05-09 15:54:57 +02:00
bofdahof
998f4e4d45
Console: rename PascalCase named methods to camelCase
2025-05-06 17:50:21 +02:00
bofdahof
d4ecf95ca5
Console: misc refactors
...
- use C++20 contains where appropriate
- add nolint redundant qualifier
- remove old todo
- remove redundant enum name
- add const
- remove redundant classname
- remove redundant inline
- remove redundant namespace
2025-05-06 17:50:21 +02:00
Ladislav Michl
c293d74566
Base: rename Exception's PascalCase methods to camelCase
2025-05-05 23:50:01 +02:00
bofdahof
838178bb1c
Base: simplify Exception
...
Remove repetition. Add functions to replace macros, but keep macros
in use for now as some compilers have broken std::source_location
support.
2025-05-05 23:50:01 +02:00
Jacob Oursland
8f57c46f3a
Base: use nullptr instead of 0 in Base.
2025-05-05 12:12:15 -05:00
bofdahof
1155f0d752
Base: simplify UnitsSchemas management
...
Fixes: Maintaining schemas is difficult and error-prone
- Facilitate easy schemas add, remove, change, etc.
- Remove 14 files containing approx 2,190 lines of if/else code and data
- Place data in one file (UnitsSchemasData.h) using a normalized structure (including special functions)
- Isolate and simplify data operations (code)
- Remove schemas enum to keep data independent of code
- Separate responsibilities: Specifications, data, schemas, schema
- Add schema data 'isDefault'
- Add schema data name
- Prefer algorithms to raw loops
- Add schemas unit tests
- Tweak quantity unit tests
2025-04-27 00:45:54 +02:00
bofdahof
77f4515963
Base: refactor QuantityPy class
2025-04-27 00:45:47 +02:00
bofdahof
7c5ce9d256
Base: cleanup Quantity class
2025-04-27 00:42:47 +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
Kacper Donat
2a5114f2d3
CMake: Rebuild .cpp/.h files from .pyi on build
2025-04-24 16:40:24 -05:00
Pieter Hijma
108dafb89d
[Doc] Improve documentation PropertyContainer
2025-04-22 13:42:50 +02:00
Chris Hennes
318e0a6c45
Merge pull request #20835 from oursland/python-binding-generator-const
...
python: Make const methods declared const in C++.
2025-04-21 10:58:21 -05:00
Florian Foinant-Willig
065a8a2226
Core: Part::PartFeature should be Part::Feature
2025-04-21 10:51:15 -05:00
bofdahof
3e24dc6d8c
Remove unused code: verbosity
2025-04-17 08:38:38 +02:00
Jacob Oursland
5b81cd741a
python: apply const method annotations to impls.
2025-04-16 20:32:04 -07:00
Benjamin Nauck
22120fa597
Use Base::toDegrees() instead of manually converting
2025-04-15 07:16:39 +02:00
Benjamin Nauck
f932c7e4e0
Use Base::toRadians() instead of manually converting
2025-04-15 07:16:36 +02:00
Benjamin Nauck
cc40e522de
Base: make our fmod require floating point values
2025-04-14 08:00:57 +02:00
Benjamin Nauck
1370c2101f
Base: Make degrees and radians convertions safer and faster
2025-04-14 08:00:57 +02:00
Benjamin Nauck
16a7bf420c
Base: Make sgn branchless
2025-04-14 08:00:57 +02:00
Benjamin Nauck
12fa564894
Base: Require clamp to take arithmetic values
...
use std::clamp internally, function should probably be removed
2025-04-14 08:00:48 +02:00
Luz Paz
dd16b8053e
Fix various typos
...
Found via codespell
2025-04-13 14:06:26 -05:00
Kacper Donat
b300c80b90
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
Ladislav Michl
ed00a6673c
Base: Quantity: rename lexer and parser files
...
Rename files according 7d233dc ("Gui: Rename generated lexer files
to match core naming pattern"). Note that C space errors (space
before tabs, spaces on blank lines, etc.) still need to be fixed
manually after regenerating lexer file.
2025-04-08 11:09:36 +02:00
Ladislav Michl
f7c8ce50bc
Base: Quantity: indent lexer and parser input files
2025-04-08 11:09:36 +02:00
Chris Hennes
de13e777f4
Merge pull request #20643 from tritao/python-gen-include-pycxx
...
Tools: Add PyCXX includes to generated Python binding files.
2025-04-07 11:27:17 -05:00
Andrea
cdff0da672
BASE: remove FileTemplate class
...
Removed unnecessary and old filetemplate class
2025-04-07 11:26:07 -05:00
Kacper Donat
35a9673a75
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
tritao
ccbae8b847
Base: Clean up Python includes in PyObjectBase.h.
2025-04-05 12:14:32 +01:00
Benjamin Nauck
d9af862627
Base: Add #include <limits> where used
2025-03-31 23:50:30 +02:00
Kevin Martin
7441ae36d3
Base: UniqueNameManager support for very long numbers in name ( #19943 )
...
* Add unit tests for large digit count in unique names
* Updated to use arbitrary-precision unsigneds
Passes the new unit tests, all diagnostics, and resolves Issue 19881
* Place UnlimitedUnsigned at top level and add unit tests
* [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-03-31 10:45:58 -05:00
Chris Hennes
e7156aa326
Merge pull request #20496 from hyarion/refactor/cppify-constants
2025-03-29 18:43:40 -05:00
Kacper Donat
f5199145a4
Merge pull request #20379 from chennes/baseEliminatePy_GetPath
...
Replace it with a piece of code that replicates the functionality. Also eliminate the round-trip through char * that this function was using (the final variable is stored as a std::string anyway).
2025-03-29 18:13:08 +01:00
Benjamin Nauck
ae686942a7
Base: Use std::numeric_limits and std::numbers instead of defines
2025-03-29 13:32:37 +01:00
mosfet80
96e8a9e83c
Remove old GCC<=8 ( #20508 )
...
GCC version is always greater than 8
2025-03-29 12:21:36 +01:00
marioalexis
8c6e77ee97
Base: Improve schema translation for electrical units
2025-03-28 07:43:15 +01:00
marioalexis
406a834a6d
Base: Add volume charge density unit
2025-03-27 21:13:21 +01:00
Chris Hennes
67982f3963
Base: Add Console::DestructorError as noexcept
...
Create a new console output that eats exceptions so it is safe to use in a destructor.
2025-03-25 09:45:25 +01:00
Chris Hennes
af8a86f6bf
Base: Eliminate use of deprecated PyWeakref_GetObject
...
Co-authored-by: João Matos <joao@tritao.eu >
2025-03-23 22:43:03 +01:00
Chris Hennes
ebc0dc165d
Base: Initialize tp_versions_used in PyTypeObject (3.13)
...
This field is undocumented, but exists in the source code for 3.13
(see https://github.com/python/cpython/blob/3.13/Include/cpython/object.h#L232 )
and gives a compiler warning if left uninitialized.
2025-03-23 22:42:08 +01:00
Chris Hennes
f0fc6ccde1
Base: Remove deprecated Py_GetPath call
...
Replace it with a piece of code that replicates the functionality. Also eliminate the round-trip through char * that this function was using (the final variable is stored as a std::string anyway).
2025-03-22 18:59:05 -05:00
bofdahof
4ceecd0857
Replace std::endl with '\n'
2025-03-21 23:30:41 -05:00
bofdahof
e4ebaba805
Exception.cpp
2025-03-21 22:39:41 -05:00
Florian Foinant-Willig
7bf1b5d787
Fix FreeCAD#19588
2025-03-20 20:14:50 +01:00
tritao
8d36987f16
Base: Remove XML binding files.
2025-03-19 20:04:19 -05:00
Chris Hennes
64d658e38a
FreeCAD: Compiler warning fixes
2025-03-19 10:13:34 +01:00