Commit Graph

96 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
Markus Reitböck
5b6a0b1852 PartDesign: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
 should be considered an optimization, not a requirement. In particular, do not explicitly include a
 precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
 generated precompile header on the compiler command line instead. This is more portable across
 the major compilers and is likely to be easier to maintain. It will also avoid warnings being
 generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-23 22:39:36 +02:00
theo-vt
13e7952ccc PartDesign: Fix hole centered on point edge case (#21257)
* Light refactor of getTopoShape function

* Fix hole edge case

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Refactor simplifyCompound()

* Use Base::Flags<GetShapeOption>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Shorten enum name and move it from class scope to namespace scope

* [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>
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-05-29 22:37:54 +02:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 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
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
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
bofdahof
965af2bf9a PartDesign: apply std::ranges 2025-03-16 17:17:15 -05:00
Joao Matos
9bcdd2d44c Rename DocumentCreateFlags to DocumentInitFlags. 2025-03-07 20:54:16 +00:00
Joao Matos
1c2ac570f8 Convert DocumentCreateFlags instances to use designated initializer list. 2025-03-07 20:42:51 +00:00
Chris Hennes
cb93a4ae18 Merge branch 'main' of https://github.com/FreeCAD/FreeCAD into bgbsww-toponamingAddFeatureRefine 2025-02-11 20:58:58 -06:00
tritao
123569823e App: Provide temporary document creation flag to Python App.loadDocument. 2025-02-03 18:01:18 +01:00
Benjamin Nauck
dd6aa9f3c7 Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's
Regex based changes, manually verified
2025-01-27 16:08:18 +01:00
Chris Hennes
d621f59a88 Merge branch 'main' into bgbsww-toponamingAddFeatureRefine 2025-01-24 09:33:57 -06:00
PaddleStroke
c5fbbb3830 SubShapeBinder: Add support for point. 2024-12-13 18:04:10 +01:00
Alexey Chernov
66e1c0154d Require read-only and output attributes on updated properties
Require the property to be both read-only and output for it to be
updated back from support to binder when calculated with expression in
support.
2024-12-08 15:12:38 -05:00
Alexey Chernov
4db7cd52e6 Use lambda to prevent code duplication 2024-12-08 15:12:38 -05:00
Alexey Chernov
2501296c95 Apply result of copy on change properties
Copy on change properties propagated to SubShapeBinder can be changed
there and then updated in the base body (support). On the other hand,
they might be used in calculation of some other properties in the base
body which could also be copy on change and propagated to the same
SubShapeBinder. It looks natural that these latter properties should be
updated with the calculation results as well.

Example:
Body has copy on change properties A = 200 mm and B = 3 * A = 600 mm.
SubShapeBinder with support of Body has A changed to 300 mm and expects
B = 3 * 300 mm = 900 mm. Without this change B is not updated and equals
to 600 mm in SubShapeBinder as well.
2024-12-08 15:12:38 -05:00
PaddleStroke
3c1358da10 Core: Rename 'OriginFeature' file to 'Datums' 2024-11-26 15:36:48 +01:00
wmayer
98fec525b0 PD: move refine model parameter to separate function 2024-11-22 11:59:49 +01:00
wmayer
14cd061809 Part: Use Base::toRadians to convert degree to radian 2024-10-22 22:37:01 -05:00
bgbsww
ae46ea5e7b Toponaming: Refactor refine to its own FeatureRefine class 2024-09-14 23:24:43 -04:00
bgbsww
2a541c9536 Toponaming: Remove remaining FC_USE_TNP_FIX defines 2024-08-31 13:21:10 -05:00
bgbsww
ecf7e51ab3 Toponaming: Remove all FC_USE_TNP_FIX protected old code 2024-08-26 11:12:48 -05:00
Max Wilfinger
e490531510 Activate Part/Part Design check and refine preferences by default (#14406)
* Activate Part/Part Design check and refine preferences by default

* added bool in .ui

* Update tests

* Fix Sketcher tests
2024-07-01 10:50:42 -05:00
Zheng, Lei
b7bbc2ed11 Toponaming: Missing code for shapebinder 2024-05-23 09:47:25 -04:00
bgbsww
febe5c3d9e Toponaming: fix shapebinder selection error 2024-05-21 21:41:26 -04:00
wmayer
7d738f161a PD: Fix ShapeBinder::execute() if Support is empty
This fixes the reported regression: https://forum.freecad.org/viewtopic.php?t=87229
2024-05-10 15:06:22 +02:00
wmayer
35b70acb33 PD: Fix linter warnings 2024-05-10 15:06:22 +02:00
bgbsww
3d1f6199c4 TopoNaming/PartDesign: Implement shapebinders 2024-04-14 17:13:14 -05:00
André Caldas
560898907b Avoids using getNameInDocument() to test if DocumentObject is attached to a Document.
This patch substitutes by isAttachedToDocument() (almost) everywhere where
getNameInDocument() is used for this purpose.

The very few places not touched by this patch demand a (just a little) less trivial change.
When we change the returning type of getNameInDocument() to std::string,
those places will be easily found, because they shall generate a compiler error
(converting std::string to bool).

Rationale:
The fact that getNameInDocument() return nullptr to indicate
that the object is not attached to a document is responsible for lots of bugs
where the developer does not check for "nullptr".

The idea is to eliminate all those uses of getNameInDocument() and, in the near future,
make getNameInDocument() return always a valid std::string.
2023-12-11 17:37:58 +01:00
luzpaz
faef0c6f27 Fix various typos 2023-11-30 14:58:06 +01:00
Florian Foinant-Willig
6adc675a12 PartDesign: modernize type checking 2023-10-23 18:08:16 +02:00
wmayer
d150fa7164 modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
2023-08-08 21:10:16 +02:00
wmayer
68d22d864b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
Pesc0
4a8d3853ba [Toponaming] create ElementMap class (#9175)
* Copypaste ElementMap
* Add MappedNameRef
* Fix missing include
* Copypaste `findTagInElementName`
* fix error introduced _somewhere_
* refactor toponaming constants
* Move `findTagInElementName` in `MappedName`
* reintroduce workaround to compile ElementMap
* Added missing functions copied from complexgeodata
* fix last compile errors, reorder and format files
* remove recursive refs to ComplexGeoData
* Add more comments
* fixed comments and added tests
* added FIXME, make functions private, misc fixes
* Move static functions from complexGeoData to PostfixStringReferences. Rename to ElementNamingUtils
* Fix broken includes due to previous change
* Revert constants from string to const char*
* added childmap tests and made hasher public
* Make functions private
* Added remaining tests
* removed bool return from `erase` functions
* fix missing appexport

Co-authored-by: John Dupuy <jdupuy98@gmail.com>
2023-06-15 09:05:24 -05:00
wmayer
c98545b6ca PD: [skip ci] disable undo/redo for the tmp. document created by the SubShapeBinder 2022-10-24 16:50:50 +02:00
0penBrain
4bfc6a082a PartDesign: improve offset handling of SubShapeBinder 2022-09-11 21:17:22 +02:00
berniev
915369d8a2 Mod: Redundant_string_initialization 2022-08-08 16:52:42 +02:00
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
b796a0d376 Mod: use empty 2022-08-06 19:30:13 +02:00
berniev
2d4c5a4cfb Mod: use emplace_back 2022-08-05 10:36:16 +02:00
wmayer
88accdb421 PD: [skip ci] Fix several clazy issues:
* Maybe you meant to call base method instead [-Wclazy-skipped-base-method]
* Missing reference in range-for with non trivial type [-Wclazy-range-loop-reference]
* Mixing iterators with const_iterators [-Wclazy-strict-iterators]
* Unused QByteArray [-Wclazy-unused-non-trivial-variable]
* C++11 range-loop might detach Qt container (QList) [-Wclazy-range-loop-detach]
2022-07-25 13:40:19 +02:00
wmayer
5a432fe9ac PD: allow to clear the shape when nullifying the Support property 2022-06-12 14:01:19 +02:00
Uwe
c27e016521 [PD] shape binder: code style improvements
all done by MSVC
2022-03-27 21:48:09 +02:00
Uwe
66e4c37a25 fix some occurrences where size() is misused as Boolean
- as suggested by @wwmayer: 4d51d1d0b1 (r69648152)
2022-03-27 21:38:15 +02:00
wmayer
3608ee7f51 PD: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
wmayer
55f8d68b4e PD: Fix coverity issue:
* CID 350645: Uncaught exception
2022-03-13 17:24:07 +01:00
mwganson
3e18c76d4f PartDesign::SubShapeBinder add 2D offsetting 2022-03-12 23:30:09 +01:00
Zheng, Lei
b47e6723dc PD: add SubShapeBinder 'Refine' property
Respect setting in BaseApp/Preferences/Mod/PartDesign/RefineModel
2022-03-12 02:45:13 +01:00