Syres916
67d0345870
Base: fix default unit schema
...
Fix the transcription error which occured while moving into
single structure. Default schema now uses milimeters again.
Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
2025-05-14 10:25:47 +02:00
Ladislav Michl
e577bebe56
Base: fix Python interface for Unit schema selection
...
Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
2025-05-14 10:20:49 +02:00
Ladislav Michl
2e35afd6e0
Base: sort returned Unit schema description
...
Return schemas name and description vectors sorted by number, so
index can be used later to select particular schema.
Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
2025-05-14 10:20:49 +02:00
Chris Hennes
952485dcbb
Merge pull request #19907 from benj5378/getAttribute
...
Base: make getAttribute template
2025-05-12 10:39:55 -05:00
Benjamin Bræstrup Sayoc
2b1aec0041
Base: make getAttribute template
2025-05-09 15:54:57 +02:00
bofdahof
ba2c2ca5ad
Console: rename PascalCase named methods to camelCase
2025-05-06 17:50:21 +02:00
bofdahof
1dbc0638c3
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
9683cf1e4f
Base: rename Exception's PascalCase methods to camelCase
2025-05-05 23:50:01 +02:00
bofdahof
bf4ace0957
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
4b03b614eb
Base: use nullptr instead of 0 in Base.
2025-05-05 12:12:15 -05:00
bofdahof
353acbb27b
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
d23c204537
Base: refactor QuantityPy class
2025-04-27 00:45:47 +02:00
bofdahof
4480b8d8cb
Base: cleanup Quantity class
2025-04-27 00:42:47 +02:00
Ladislav Michl
8ba8c04b20
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
3769dfd338
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
99f86bd40a
Base, Gui: remove lefovers from xml -> pyi conversion
2025-04-25 11:57:24 +02:00
Kacper Donat
81b675733d
CMake: Rebuild .cpp/.h files from .pyi on build
2025-04-24 16:40:24 -05:00
Pieter Hijma
519b78d775
[Doc] Improve documentation PropertyContainer
2025-04-22 13:42:50 +02:00
Chris Hennes
f1ef2159ee
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
ef0ca1cff3
Core: Part::PartFeature should be Part::Feature
2025-04-21 10:51:15 -05:00
bofdahof
09d08593ed
Remove unused code: verbosity
2025-04-17 08:38:38 +02:00
Jacob Oursland
5c251e73ac
python: apply const method annotations to impls.
2025-04-16 20:32:04 -07:00
Benjamin Nauck
f22f3705db
Use Base::toDegrees() instead of manually converting
2025-04-15 07:16:39 +02:00
Benjamin Nauck
21fbf8e539
Use Base::toRadians() instead of manually converting
2025-04-15 07:16:36 +02:00
Benjamin Nauck
282662e735
Base: make our fmod require floating point values
2025-04-14 08:00:57 +02:00
Benjamin Nauck
494434fc5f
Base: Make degrees and radians convertions safer and faster
2025-04-14 08:00:57 +02:00
Benjamin Nauck
f12a63af87
Base: Make sgn branchless
2025-04-14 08:00:57 +02:00
Benjamin Nauck
ac0e188141
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
3fa260f869
Fix various typos
...
Found via codespell
2025-04-13 14:06:26 -05:00
Kacper Donat
77e40b9747
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
ce82b109d5
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
56f1b666f4
Base: Quantity: indent lexer and parser input files
2025-04-08 11:09:36 +02:00
Chris Hennes
3d9df65bec
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
7e2cc1d679
BASE: remove FileTemplate class
...
Removed unnecessary and old filetemplate class
2025-04-07 11:26:07 -05:00
Kacper Donat
9d97d1c895
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
718773bc9c
Base: Clean up Python includes in PyObjectBase.h.
2025-04-05 12:14:32 +01:00
Benjamin Nauck
cb51f3fd2c
Base: Add #include <limits> where used
2025-03-31 23:50:30 +02:00
Kevin Martin
eb3b0b9d87
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
95fbd95950
Merge pull request #20496 from hyarion/refactor/cppify-constants
2025-03-29 18:43:40 -05:00
Kacper Donat
d7adbe5f3d
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
3253f2c2de
Base: Use std::numeric_limits and std::numbers instead of defines
2025-03-29 13:32:37 +01:00
mosfet80
d5004148b0
Remove old GCC<=8 ( #20508 )
...
GCC version is always greater than 8
2025-03-29 12:21:36 +01:00
marioalexis
805c27ca7b
Base: Improve schema translation for electrical units
2025-03-28 07:43:15 +01:00
marioalexis
1c19608799
Base: Add volume charge density unit
2025-03-27 21:13:21 +01:00
Chris Hennes
ae59cc6814
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
26154f3846
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
3c43891b61
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
5941c7e0ba
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
2dbc6305d6
Replace std::endl with '\n'
2025-03-21 23:30:41 -05:00
bofdahof
1857b0128e
Exception.cpp
2025-03-21 22:39:41 -05:00