Commit Graph

2273 Commits

Author SHA1 Message Date
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
2b6e73c29d Everywhere: clean up getAttribute conversions 2025-05-09 15:54:57 +02:00
Benjamin Bræstrup Sayoc
2b1aec0041 Base: make getAttribute template 2025-05-09 15:54:57 +02:00
Pieter Hijma
ca6fe75f43 Doc: Fix small doc warnings in ExtensionContainer 2025-05-08 17:52:33 -05:00
Pieter Hijma
fe4c79a046 Doc: Improve App::Extension documentation 2025-05-08 17:52:33 -05:00
Pieter Hijma
3ddcc10f12 Doc: Improve App::ExtensionContainer documentation 2025-05-08 08:28:51 -05:00
Chris Hennes
d691d5261e Merge pull request #21184 from pieterhijma/doc-object-identifier
Doc: Improve App::ObjectIdentifier documentation
2025-05-07 16:22:49 -05:00
Pieter Hijma
4c21636359 Doc: Fix warnings App::Property
PR #21155 introduced some warnings that are fixed in this PR.
2025-05-07 15:15:08 +02:00
Pieter Hijma
9cbea91d60 Doc: Improve App::ObjectIdentifier docs 2025-05-07 13:34:25 +02:00
Pieter Hijma
f438c0ed04 Doc: Move doc comments ObjectIdentifier
Move the doc comments from the cpp file to the header file.
2025-05-07 10:26:28 +02:00
PaddleStroke
90190f8d13 Core: restoreContent not restoring expressions (#21152) 2025-05-06 12:02:35 -05:00
Pieter Hijma
39dcd21233 Doc: Improve App::Property documentation 2025-05-06 12:00:52 -05:00
bofdahof
ba2c2ca5ad Console: rename PascalCase named methods to camelCase 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
Chris Hennes
f55063855a Merge pull request #20540 from 3x380V/cleanup-schemas-management
Simplify UnitsSchemas management
2025-05-05 10:43:27 -05:00
Benjamin Nauck
ecc2571d12 App: use contains() instead of count() 2025-05-03 22:22:10 +02:00
Benjamin Nauck
ea6ea1ee9c App: Use contains instead of std::find 2025-05-03 22:22:10 +02:00
Benjamin Nauck
02d095f6e2 App: use contains() instead of count() where possible 2025-05-03 22:19:51 +02:00
Pieter Hijma
ecb61310c1 Doc: Improve PropertyContainer documentation 2025-04-29 22:50:14 -05:00
João Neves
05f0c606d5 Core: Fixed a bug where an empty document disappears (#20554)
* Core: Fixed a bug where an empty document disappears

Created a flag named autoCreated to distinguish an autoCreated
document created in the startup from a manually document.
Implemented a setter and a getter for this new flag.
Added a codition that verifies if a document is autoCreated
when opening another document to close it in the correct case.
Implemented unit tests for theses cases. Fixes #19868.

Signed-off-by: João Neves <joao.antonio.neves@tecnico.ulisboa.pt>

* Tests: Fix failing auto-created document tests

Signed-off-by: João Neves <joao.antonio.neves@tecnico.ulisboa.pt>

* Tests: moved created tests to the existing Document test framework.

Signed-off-by: João Neves <joao.antonio.neves@tecnico.ulisboa.pt>

---------

Signed-off-by: João Neves <joao.antonio.neves@tecnico.ulisboa.pt>
2025-04-28 10:46:52 -05:00
Luz Paz
ac9b65aa65 Misc: Fix various typos
Found via codespell
2025-04-27 19:32:19 -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
Kacper Donat
ad3420e126 App: Use freecad_cast whenever possible 2025-04-26 14:23:25 +02:00
Kacper Donat
ccb42d0a0f App: Fix inheritance information for PropertyEnumeration
For some reason PropertyEnumeration in our type information system was
said to be inherited from App::PropertyInteger, wich is not the case.
This commit fixes that mistake.
2025-04-25 11:12:11 +02:00
Florian Foinant-Willig
73708391fb Add locked keyword to Document::addProperty 2025-04-24 16:03:34 +02:00
Monty Montgomery
eb58ba5657 Fix to sanity checking of ElementMap::restore()
An operator precedence error in new sanity checking code within
ElementMap::restore() causes <X>.Shape.Map.txt files with more than
2 element maps to be rejected as invalid.  This silently corrupts
projects upon loading, potentially unrecoverably.

The preexisting code comment is still appropriate if ironic.
2025-04-23 17:19:32 -05:00
Florian Foinant-Willig
d6958ea1e6 Add locked keyword argument to DocumentObject::addProperty 2025-04-22 23:52:17 +02:00
Pieter Hijma
05364b9eb4 [Doc] Process comments from review
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2025-04-22 13:42:50 +02:00
Pieter Hijma
519b78d775 [Doc] Improve documentation PropertyContainer 2025-04-22 13:42:50 +02:00
Pieter Hijma
8956c56235 [Doc] Add documentation top-level namespace App 2025-04-22 13:42:50 +02:00
FilippoR
e165d808f7 App: cmake: add missing Coin_INCLUDE_DIR after #20487 (#20863) 2025-04-21 15:01:03 -03: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
Jackson Oursland
8d679b70f0 App: Use the legacy macOS version functionality for About FreeCAD dialog (#20858) 2025-04-18 06:41:18 +02: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
Alex Tran
353085d7e3 App: Running FreeCAD in verbose mode information to reflect Gui -> Help -> About Dialog info (#20487) 2025-04-16 08:29:07 +02: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
Bas Ruigrok
7b46ac4cd6 Use longest edge in face for horizontal/vertical alignment (#20374)
* App: Add second direction to getCameraAlignmentDirection()

* Part: Find longest face edge for horizontal/vertical alignment

* Gui: Use longest face edge for horizontal/vertical alignment

* App: Improve horizontal/vertical alignment for Datums and LCS
2025-04-14 11:20:49 -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
3f025585dc App: Expression: 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:10:50 +02:00
PaddleStroke
2f479e3c95 PartDesign: Fix use of App::Planes to create sketches (#20453) 2025-04-07 17:34:13 +02: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
bofdahof
ccaabc46eb App: remove redundant qualifier from Application class 2025-04-07 11:09:04 +02:00
bofdahof
80a382e126 App: constify variables in Application class 2025-04-07 11:09:04 +02:00
Chris Hennes
4e132ec936 App: Change element name warning to log 2025-04-01 23:57:13 +02:00
Benjamin Nauck
7b7e256e4f App: Add #include <limits> where used 2025-03-31 23:50:19 +02:00
Chris Hennes
95fbd95950 Merge pull request #20496 from hyarion/refactor/cppify-constants 2025-03-29 18:43:40 -05:00
Pieter Hijma
c740b7a027 [Doc] Make naming groups consistent in App
The identifier for groups/topics such as "Document" that have a class
with the samen name are suffixed with "Group", so the identifier becomes
"DocumentGroup".  For groups/topics with no ambiguity the identifier
matches the topic name closely, for example "ExpressionFramework" for
topic "Expression Framework".
2025-03-29 15:11:01 -05:00
Pieter Hijma
8ea31acbd2 [Doc] Add links between topics and relevant items
The documentation has topics, for example topic App which contains
namespace App or topic Document that contains class Document.  This
commit makes sure that the topic has a link to the relevant class or
namespace, whereas the relevant class or namespace refers back to the
topic for a more high-level overview.
2025-03-29 15:11:01 -05:00