Commit Graph

502 Commits

Author SHA1 Message Date
Kacper Donat
322ed2c7bc Gui: Rename StyleParameters::Length to StyleParameters::Numeric
This change gives a better name to the parameter type that is used to
store numeric values. Before it was called length, but it can store
other quantities as well so the name is no longer fitting.
2025-08-12 21:25:41 +02:00
Kacper Donat
cf55183ece Gui: StyleParameters - use Base::Color instead of QColor
If possible we should prefer using our own classess instead of ones
coming from frameworks. This changes Style Parameters to use Base::Color
class instead of QColor. Calculations are still done using QColor but
the data is always exposed as Base::Color.
2025-08-12 21:25:41 +02:00
Chris Hennes
91b3581a78 Merge pull request #22788 from pieterhijma/fix-func-expr-simplify
Core: Fix expression function simplify
2025-08-12 11:07:44 -05:00
Pieter Hijma
0acc2d1ed5 Core: Add test for a prop rename with expression 2025-08-08 17:09:49 +02:00
Frank David Martínez M
1b3851c502 [Core] Add Boolean Functions to expressions (AND, OR, NOT) (#22506)
* [Core] Add Boolean Functions to expressions (AND, OR, BOOL, NOT)

* [Core] Add `if` function to expressions to overcome ternary operator limitations

* [Core] Update expressions grammar to recognize relational operations as arguments

* [Core] The `if` function has been removed as no consensus was reached regarding its convenience or necessity. Its inclusion was considered potentially confusing or redundant.

* [Core] Make boolean cast based on Confusion threshold.
2025-08-05 03:50:13 +00:00
Chris Hennes
26c6aa934d Tests: Add tests for timestamp-based backups 2025-08-04 17:51:15 +02:00
Pieter Hijma
c86907d243 Core: Add tests for expression simplify and eval 2025-08-04 16:51:11 +02:00
Chris Hennes
d54ff81870 Tests: Save/restore Materials user prefs 2025-07-23 19:26:20 -05:00
Chris Hennes
25f1d28468 Tests: Ensure tests use a fixture that inits app 2025-07-23 19:26:14 -05:00
tomate44
4614e6b4f6 Part: Feature Offset2D fix #22563 2025-07-22 20:40:51 -05:00
Benjamin Nauck
7150ae1dc9 Sketcher: Add tests for ensuring accessing works for both old and new api 2025-07-21 18:03:14 +02:00
Chris Hennes
538b6e042c Merge pull request #22227 from kadet1090/refactor-tool-hints
Sketcher: Refactor Tool Hints
2025-07-20 12:05:15 -05:00
Chris Hennes
b97bdb7383 Tests: Add tests for 'Standard' backup policy (#22566)
* Tests: Add tests for 'Standard' backup policy

* [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-07-20 00:34:07 +02:00
Kacper Donat
33ec6e671e Gui: Add standardized HintsTable for InputHints
Input hints in various DrawSketchHandler were implemented independently
using declarative mechanism with searching over lookup table. This
results in a lot of duplicated code, this commit will create generic
mechanisms that can be used to replace them.
2025-07-19 10:05:08 +02:00
Benjamin Nauck
566fe8371a Merge pull request #21995 from chennes/moveBackupPolicy
Extract BackupPolicy class into its own file to facilitate automated testing
2025-07-12 17:58:14 +02:00
FEA-eng
45be617bf3 Part: Enable solid creation by default for Loft and Sweep (#22098)
* Part: Update PartFeatures.cpp

* Part: Update DlgRevolution.ui

* Part: Update TaskLoft.ui

* Part: Update TaskSweep.ui

* Part: Update PartFeatures.cpp

* Update src/Mod/Part/Gui/DlgRevolution.ui

---------

Co-authored-by: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com>
2025-07-07 17:46:19 +02:00
Kacper Donat
a32594faea Gui: Add ThemeTokenManager class to contain theme parameters
This class aims to implement Design Token idea into FreeCAD themes. It
allows themes to use generic variables with generic values so we could
use one qss theme and change the style based on values from preference
packs.
2025-07-07 00:07:31 +02:00
Pieter Hijma
5c9761d676 Core: Fix property rename test 2025-07-02 15:36:56 -05:00
Chris Hennes
6b4b1a1a95 Merge pull request #21975 from pieterhijma/transaction-rename-property
Core: Add redo/undo to property rename
2025-06-30 10:36:26 -05:00
Pieter Hijma
b19fc992fb Core: Add tests for undo/redo property rename 2025-06-16 17:58:33 +02:00
wmayer
74a22df884 Base: Simplify Base::Matrix4D
As discussed in https://forum.freecad.org/viewtopic.php?t=65959 reduce code duplications
2025-06-16 10:05:43 +02:00
Chris Hennes
5388c32f10 Tests: Refactor tests with better names, etc.
The basic tests now run on Windows correctly without needing to manually
copy any files -- the executables are output in the same location as the
necessary DLLs. However, tests that require *.pyd files (all code in the
Mod subdirectory, basically) still do not work on Windows as the test
executables cannot find those files. This is a work in progress.
2025-06-15 17:31:19 -05:00
Chris Hennes
ee571ef6e7 Tests: Add test framework for BackupPolicy 2025-06-15 10:34:09 -05:00
bofdahof
847e2f5c85 Base: Units: refactor
Refactor Units making it constexpr, immutable, with repetition reduced.
Separate data from code.

Constexpr constructed units allow constructing predefined Quantities
from predefined unit types.
2025-06-03 09:31:38 +02:00
Ladislav Michl
f8d2789a43 Base: Units: introduce unit one
Dimensionless quantities have all exponents equal to zero.
Such quantities are simply numbers. The associated unit is
the unit one, symbol 1, although this is rarely explicitly
written.

See chapter 2.3.3 Dimensions of quantities, The International
System of Units, 9th edition.
2025-06-03 09:31:38 +02:00
Ladislav Michl
913c30429c Base: Quantity: use isDimensionless whenever feasible
Quantity is often queried for Unit just to see if it has a dimension.
Ask Quantity directly using isDimensionless() method and modify that
method not to care about Quantity value validity; no user was ever
asking for value validity.
2025-06-03 09:31:38 +02:00
wmayer
e5e251df8f Test: Add further test cases for quantities 2025-06-03 09:31:38 +02:00
wmayer
19bb0a5d52 Test: Add test case for UnitsSchemaMeterDecimal 2025-06-03 08:16:18 +02:00
David Carter
db1b5a8773 Materials: Pass by reference instead of pointers
Refactoring topass by reference instead of using existing pointers.
2025-06-02 11:32:08 -05:00
Pieter Hijma
d025501755 Spreadsheet: Add tests for rename property 2025-05-26 18:11:27 +02:00
Pieter Hijma
75a9e26473 Core: Add tests for renaming dynamic properties 2025-05-26 18:11:27 +02:00
Benjamin Nauck
1678171e6b Base: Add more tests for imperial building special function 2025-05-20 12:34:00 +02:00
Benjamin Nauck
4241d795c0 Base: Skip test for units using GTEST_SKIP() instead of comments 2025-05-20 12:34:00 +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
Chris Hennes
a4aabe05de Sketcher tests: Silence compiler warning with cast 2025-05-15 18:49:08 +02: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
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
FilippoR
ff4740d082 Tests: Add FREECAD_USE_EXTERNAL_GTEST cmake option (#21190)
Add FREECAD_USE_EXTERNAL_GTEST cmake option and fix build with external libraries
2025-05-08 15:41:48 -05:00
Chris Hennes
9b1467cef3 Merge pull request #20540 from 3x380V/cleanup-schemas-management
Simplify UnitsSchemas management
2025-05-05 10:43:27 -05:00
Benjamin Nauck
93ea68a23b Gui: Add tests to automatically verify the axonometric views 2025-05-04 13:21:08 +02:00
Andrea
8cc1565dcb remove unnecessary InitApplication.h inclusion
The InitApplication library was being unnecessarily imported into some C++ files
2025-04-29 07:14:58 -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
Chris Hennes
42cd4d76f2 Start: Refactor f3d to use worker threads 2025-04-21 21:21:52 +02:00
Benjamin Nauck
f932c7e4e0 Use Base::toRadians() instead of manually converting 2025-04-15 07:16:36 +02:00
Ajinkya Dahale
f869bace95 [Sketcher][test] Remove some obsolete TODOs 2025-04-10 09:20:18 +02:00
Ajinkya Dahale
c0d469d404 [Sketcher][test] Add tests for fixes done in #20150 2025-04-10 09:20:18 +02:00
luzpaz
7a12d2f96f Fix various typos (#20651)
* Fix various typos
Found via `codespell -q 3 -L aci,addmin,ake,aline,alle,alledges,alocation,als,ang,anid,anormal,anull,aply,apoints,ba,beginn,behaviour,bloaded,bottome,brushin,bu,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,documentin,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,findn,fle,freez,graphin,groupe,hist,iff,incrementin,indexin,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,itsel,kilometre,leadin,localy,lod,mantatory,matc,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oce,oder,ontop,orgin,orginx,orginy,ot,pard,parm,parms,pres,programm,que,rady,recurrance,renderin,re-use,re-used,re-using,rin,ro,rougly,sectionin,seperator,sergent,serie,shs,sinc,siz,som,stpo,strack,substraction,te,technic,thist,thru,tread,tru,ue,uint,unter,uupper,uptodate,vas,vertexes,vew,wallthickness,whitespaces -S "./.git,*.po,*.ts,*.pdf,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./src/Base/StackWalker.cpp,./build/doc/SourceDoc,./tools/build/WindowsInstaller/lang,./src/Mod/TechDraw/Templates/locale"`

* [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-04-05 22:58:20 -05:00
Andrea
85179089b1 [mod] clean
code clean
2025-03-31 11:01:39 -05: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