Commit Graph

94 Commits

Author SHA1 Message Date
theo-vt
1a0a68ae69 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
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
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
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
216a76e971 PartDesign: apply std::ranges 2025-03-16 17:17:15 -05:00
Joao Matos
6dd5246fa1 Rename DocumentCreateFlags to DocumentInitFlags. 2025-03-07 20:54:16 +00:00
Joao Matos
81a5b78b36 Convert DocumentCreateFlags instances to use designated initializer list. 2025-03-07 20:42:51 +00:00
Chris Hennes
150445b058 Merge branch 'main' of https://github.com/FreeCAD/FreeCAD into bgbsww-toponamingAddFeatureRefine 2025-02-11 20:58:58 -06:00
tritao
ff8e99f385 App: Provide temporary document creation flag to Python App.loadDocument. 2025-02-03 18:01:18 +01:00
Benjamin Nauck
6f535f19fb 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
895d70b7f8 Merge branch 'main' into bgbsww-toponamingAddFeatureRefine 2025-01-24 09:33:57 -06:00
PaddleStroke
87838ca93b SubShapeBinder: Add support for point. 2024-12-13 18:04:10 +01:00
Alexey Chernov
be7a16fc5b 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
b66d413deb Use lambda to prevent code duplication 2024-12-08 15:12:38 -05:00
Alexey Chernov
d35d3a025b 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
8f43f3cc8b Core: Rename 'OriginFeature' file to 'Datums' 2024-11-26 15:36:48 +01:00
wmayer
4c5e3979ce PD: move refine model parameter to separate function 2024-11-22 11:59:49 +01:00
wmayer
6acfe3475b Part: Use Base::toRadians to convert degree to radian 2024-10-22 22:37:01 -05:00
bgbsww
2a19d8f6fb Toponaming: Refactor refine to its own FeatureRefine class 2024-09-14 23:24:43 -04:00
bgbsww
608c80b5a3 Toponaming: Remove remaining FC_USE_TNP_FIX defines 2024-08-31 13:21:10 -05:00
bgbsww
e4a509cc77 Toponaming: Remove all FC_USE_TNP_FIX protected old code 2024-08-26 11:12:48 -05:00
Max Wilfinger
86b1c2e863 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
3c112b466d Toponaming: Missing code for shapebinder 2024-05-23 09:47:25 -04:00
bgbsww
db85748e7d Toponaming: fix shapebinder selection error 2024-05-21 21:41:26 -04:00
wmayer
c2e3d61059 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
f3637096e3 PD: Fix linter warnings 2024-05-10 15:06:22 +02:00
bgbsww
bd406dbcfd TopoNaming/PartDesign: Implement shapebinders 2024-04-14 17:13:14 -05:00
André Caldas
89dbab9b0e 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
5c21351608 Fix various typos 2023-11-30 14:58:06 +01:00
Florian Foinant-Willig
24934d7843 PartDesign: modernize type checking 2023-10-23 18:08:16 +02:00
wmayer
948cbfccd9 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
52e1c7c33b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
Pesc0
c65f049d20 [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
316ce9f13b PD: [skip ci] disable undo/redo for the tmp. document created by the SubShapeBinder 2022-10-24 16:50:50 +02:00
0penBrain
611b86e4a9 PartDesign: improve offset handling of SubShapeBinder 2022-09-11 21:17:22 +02:00
berniev
5fa05ab83d Mod: Redundant_string_initialization 2022-08-08 16:52:42 +02:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
53ba98d636 Mod: use empty 2022-08-06 19:30:13 +02:00
berniev
47ac049e14 Mod: use emplace_back 2022-08-05 10:36:16 +02:00
wmayer
a93082bc06 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
3e6d0e775f PD: allow to clear the shape when nullifying the Support property 2022-06-12 14:01:19 +02:00
Uwe
153fa35bdb [PD] shape binder: code style improvements
all done by MSVC
2022-03-27 21:48:09 +02:00
Uwe
8a8fe98454 fix some occurrences where size() is misused as Boolean
- as suggested by @wwmayer: 70714eedc9 (r69648152)
2022-03-27 21:38:15 +02:00
wmayer
d1d4b996e7 PD: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
wmayer
09259451d2 PD: Fix coverity issue:
* CID 350645: Uncaught exception
2022-03-13 17:24:07 +01:00
mwganson
eaf36231eb PartDesign::SubShapeBinder add 2D offsetting 2022-03-12 23:30:09 +01:00
Zheng, Lei
2a28ad5cef PD: add SubShapeBinder 'Refine' property
Respect setting in BaseApp/Preferences/Mod/PartDesign/RefineModel
2022-03-12 02:45:13 +01:00
Zheng, Lei
8d6b06bc86 PD: fix SubShapeBinder 'Fuse' function 2022-03-12 02:45:13 +01:00
Uwe
19bdfc16b8 [PD] more work to remove unused includes 2022-02-21 02:18:17 +01:00