Commit Graph

1476 Commits

Author SHA1 Message Date
Andrea
f8b327fffc Removed empty functions
Removed empty functions
2025-05-19 18:25:17 +02:00
Ladislav Michl
76ce8ccfd5 Base: fix conversion to kilometers in Standart unit schema
Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
2025-05-19 12:15:51 +02:00
Ladislav Michl
c0963a9277 Base: align unit format to Quantity parser expectations
Quantity parser is unable to deal with exponents written in
supersript, so change it back to ^n.

The micro prefix is expected to be U+00B5, not U+03BC, so change
it back as well. Note, that \x escape sequence reads till the
whitespace or the end of string, thus microFarad becomes
  "\xC2\xB5""F

Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
2025-05-19 12:15:51 +02:00
Ladislav Michl
d80e5d0a8a Base: fix QuantityPy::getValueAs
Fixes: 77f4515963 ("Base: refactor QuantityPy class")
2025-05-19 12:15:51 +02:00
bofdahof
285a930d70 Base: restore output format of imperial fraction units
Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
2025-05-19 12:15:51 +02:00
Kohei Takahashi
b54898f05f Base: Fixed segfault on destructing cached string (#20563)
* Base: Fixed segfault on destructing cached string

Xerces default memory manager is deleted before destructing static local
variable and segfault.

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-05-15 17:23:03 +00:00
Luz Paz
5d052cc043 Fix various typos
Missed by the codespell CI not being functional for a period of time.
2025-05-15 10:59:48 -05:00
Ladislav Michl
beccce4d3c Base: revert to using ASCII chararacters for imperial lengths
The new unit schema management is using U+2032 and U+2033 characters
for feet and inches while parser is expecting only ' and ", while
U+2032 and U+2033 are used for arcminute and arcsecond.

While this is not an ideal solution and parser should deal with both,
revert back to ASCII for now.

Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
2025-05-14 11:39:09 +02:00
Syres916
a075bf8c34 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
1d62b8372b Base: fix Python interface for Unit schema selection
Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
2025-05-14 10:20:49 +02:00
Ladislav Michl
9c6cdcaa01 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
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