Commit Graph

75 Commits

Author SHA1 Message Date
Markus Reitböck
88c6f176bb 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
wwmayer
a161932408 PD: Fix creation of pad from base feature
In versions prior to 1.0 there was never the requirement that the shape of a FeatureBase must contain a solid. This has changed with ea0a7b0679 for no obvious reason. This requirement should be dropped again.

In versions prior to 1.0 the method Feature::getBaseShape() was used within the Pad feature to check if the base feature has a solid. This method throws an exception if the shape doesn't have a solid.
Since version 1.0 the new method Feature::getBaseTopoShape() is used. As parameter a boolean is passed to either throw an exception or silently return a null shape. The implementation of this function is inconsistent:
If the parameter is false it throws an exception if the base feature's shape has no solid but if the parameter is true it doesn't check if the shape has a solid and returns it as is.

This leads to incorrect behaviour in the calling instance where the shape of the base feature is tried to be fused with the padded shape. This operation will fail if the shape of the base feature has no solid.

This fixes https://github.com/FreeCAD/FreeCAD/issues/23348
2025-08-29 16:28:38 +02:00
Kacper Donat
c4b741f488 PartDesign: Add transparent previews 2025-08-07 00:37:21 +02:00
Ladislav Michl
9683cf1e4f Base: rename Exception's PascalCase methods to camelCase 2025-05-05 23:50:01 +02:00
Florian Foinant-Willig
09ba446acd PartDesign: Fix #20205 where Placement changes at Suppression 2025-04-16 20:39:58 +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
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
ea7e17ba00 Merge pull request #18126 from Ondsel-Development/core_LCS2
Core datums : Card2 : Core implementation
2024-12-06 12:12:04 -05:00
Florian Foinant-Willig
115667f73a PartDesign: decouple refine and other geometric computation (#17008) 2024-12-02 10:57:30 -06:00
PaddleStroke
a558475d8a Rename 'OriginFeature' to 'DatumElement' 2024-11-26 15:36:48 +01: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
David Carter
e4bf988db2 Materials: Child ignoring parent material
Inherit the material from the parent object when creating a new object,
such as during a boolean operation, or when extruding a sketch.

fixes #15503
2024-10-21 18:20:20 +02: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
bgbsww
cfb4514df7 Toponaming: Update tests, implement missing subtractive operation tests,
fix helix and revolution
2024-07-30 09:12:58 -05:00
bgbsww
678f35fda2 Toponaming: Cleanup 2024-07-21 17:40:42 -04:00
bgbsww
ae6f7f25e8 Toponaming: Missing suppress property and code 2024-07-15 09:38:13 -05:00
Florian Foinant-Willig
cded7480bf PartDesign: hide Suppressed property with FC_USE_TNP_FIX flag 2024-05-20 11:32:34 -05:00
Kacper Donat
302706be38 Gui: Add ability to disable single-solid rule by default 2024-05-20 12:25:36 -04:00
Kacper Donat
e4ed0d883f PartDesign: Introduce ability to disable single-solid rule
This adds "SingleSolidRuleMode" enum that controls if PartDesign will
enforce singular solid. By default the single-solid is enforced so
nothing changes for the user, it must be explicitly disabled by setting
new Allow Compound boolean property on a given body.

Default for this value is controled using user parameter under
Mod/PartDesign/AllowCompoundDefault
2024-05-20 12:25:36 -04:00
Kacper Donat
d0a35c8c03 PartDesign: Refactor single-solid rule enforcement
This refactors a single solid rule checking code from using the solid
count directly to using well abstracted `isSingleSolidRuleSatisfied`
method. This makes code easier to read and is the basis for next step
which is allowing users to disable this checks.
2024-05-20 12:25:36 -04:00
bgbsww
86abf074c0 Toponaming: bring in missing code fragments in PartDesign 2024-05-13 08:45:26 -05:00
bgbsww
7961e82c66 Toponaming/Part: Fix all getBaseTopoShape calls. Tests and missing code. 2024-04-26 21:15:11 -05:00
bgbsww
239c3e6f78 Toponaming/Part: Fix review items 2024-04-10 12:14:01 -04:00
bgbsww
942ebd58f0 Toponaming/Part: Add deprecation comments, clean up code 2024-04-09 21:17:08 -04:00
Zheng, Lei
231a638fc7 TopoShape/Part: Bring in PartDesign dependencies 2024-04-09 21:17:08 -04:00
Florian Foinant-Willig
b5abde373d PD: Use SuppressibleExtension 2024-02-29 18:24:27 +01:00
wmayer
64a91968a3 MSVC: fix compiler warnings 2024-02-25 00:12:34 +01:00
Florian Foinant-Willig
f9cebebd6b PD: handle null pointer in Feature::getBaseShape (#12385) 2024-02-13 17:41:25 -03:00
Florian Foinant-Willig
056b90cce3 Set Suppressed false if no shape 2024-02-12 17:55:51 +01:00
Florian Foinant-Willig
f4763109c3 [PD] Add a Suppressed property to disable a feature 2024-02-12 17:55:51 +01:00
Florian Foinant-Willig
24934d7843 PartDesign: modernize type checking 2023-10-23 18:08:16 +02:00
wmayer
c8abd4a6d4 Part: modernize C++: return braced init list 2023-08-19 11:35:41 +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
luzpaz
01e8bbc2bf Fix various typos and whitespace 2023-03-10 14:40:46 +01:00
Zheng, Lei
99c9d9b468 PartDesign: do not include transform for sub-object in Feature 2023-03-10 02:06:24 +01:00
luz paz
d265c9ff63 PD: remove trailing whitespace 2022-11-10 10:32:04 +01:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
Uwe
ac6235c577 [PD] App: remove superfluous nullptr checks
- also Body: get rid of some nasty single-letter variables
2022-07-17 18:07:00 +02:00
wmayer
d1d4b996e7 PD: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
Uwe
f498cd1d32 [PD] App: remove unused includes 2022-02-20 20:41:46 +01:00
Zheng, Lei
2fee0c3b0c PartDesign: fix DressUp base shape checking 2020-02-23 11:04:54 +01:00
wmayer
b1dd1e61a7 force strict ISO C++ (-Wpedantic)
for Fem, Import, PartDesign, Robot, Sketcher, TechDraw
2019-09-18 14:18:07 +02:00
Zheng, Lei
cd2b7e297c PartDesign changes
* Mostly for supporting in-place editing

* Add new SubShapeBinder that support cross coordinate system,
  external, and sub-object binding
2019-08-17 15:15:47 +02:00
wmayer
00de5bb7ad Replace Base::Exception with appropriate subclass 2018-11-14 19:28:00 +01:00
wandererfan
0d3008e4eb Fix #3401 warning on multiple solid
- PartDesign only uses the first result shape
  of an operation and discards the rest without
  warning.

- this also fixes #1707
2018-07-13 10:23:42 -03:00
wmayer
210a48cbf3 fixes #0003159: ShapeBinder is part of solid 2017-11-09 23:21:06 +01:00
Stefan Tröger
6ae8b6482e PartDesign: Make Base Feature compatible with GeoFeatureGroup. fixes #0003080
The Original BaseFeature implementation had some serious issues with scoped links. It failed completely for e.g. sketches on the BaseFeature as it made a local link to refere to a out of body object. The only solution to make this work correctly is to add a proxy object into the body which is alloed to exactly that, to link outside oof the body. Something like shapebinder.
2017-09-21 11:40:14 +02:00