Commit Graph

112 Commits

Author SHA1 Message Date
Saksham Malhotra
b7735044c4 PartDesign: move AllowCompound to Base property group (#26180) 2025-12-15 21:45:29 -06:00
pre-commit-ci[bot]
25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
marioalexis
406c3ba42c PartDesign: Use AllowCompound user parameter along the workbench - fixes #23596 2025-09-26 19:50:21 -05: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
marioalexis
f176172faa PartDesign: Remove use of user parameters from Body constructor 2025-08-20 15:08:47 +02:00
Max Wilfinger
84afc15c91 PartDesign: Enable compounds for PD bodies 2025-08-18 01:09:07 +02:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +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
Benjamin Nauck
a1c5767643 Mod: Use new addObject<T>(...) using regex 2025-02-10 18:35:38 +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
PaddleStroke
48dbdacdbd Part: add datum objects and commands to create them. 2024-12-13 18:04:10 +01:00
David Carter
0804d80ebf 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
mwganson
dfafbfb040 [PartDesign AllowCompound] recompute all features when AllowCompound property is changed either from true to false or from false to true 2024-10-07 08:56:07 -05:00
Zheng, Lei
bcea524177 Toponaming: Missing getSubObject code in PartDesign::Body and SketchObject::getSubObject 2024-07-15 11:59:15 -04:00
pre-commit-ci[bot]
54920e6611 Review cleanups 2024-06-28 11:57:43 -05:00
bgbsww
a674729dd3 Toponaming: Cleanups 2024-06-28 11:57:43 -05:00
Zheng, Lei
7a4bc95d47 Toponaming: Transfer in missing Code for BaseFeatures and Sketches 2024-06-28 11:57:43 -05:00
Chris Hennes
64fbafe30e Merge pull request #12589 from NomAnor/pd-trans-body
Add a new mode to PD patterns that will transform the base feature's shape instead of the tool shapes
2024-06-03 10:46:33 -05:00
André Althaus
0b5e993b90 Fix solid feature detection for "Transform Body" mode
Because the Origins property is empty in "Transform Body" mode, the
features are detected as not solid.
This messes with the feature order on insertions and moves.

This is fixed by calling the isMultitransformChild() method of the
Transformed features instead of checking the Origins property in the
Body code.
2024-05-23 12:23:32 +02:00
Pieter Hijma
ec841ed6d4 Core: Add VarSets to Groups
If a Group is selected, add the VarSet to the group.
2024-05-21 09:59:49 +02:00
Kacper Donat
f8c47b55cb 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
Florian Foinant-Willig
6adc675a12 PartDesign: modernize type checking 2023-10-23 18:08:16 +02:00
wmayer
9a1f8a11d6 PD: modernize C++: use range-based for loop 2023-08-16 21:54:56 -05:00
Chris Hennes
1995d84edd PD: Add translation to error messages 2023-04-28 11:32:56 -05:00
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
Uwe
07ddfc88de [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
d492ac3083 PD: fixes #6451: Face color of PartDesign Body not exported to STEP 2022-05-24 16:42:27 +02:00
wmayer
3608ee7f51 PD: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
Uwe
c7e48869b6 [PD] Body and utils: remove unused includes 2022-02-20 21:23:05 +01:00
luz paz
56ce278abf Fix typos
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,apoints,ba,beginn,behaviour,bloaded,bottome,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,ontop,orgin,orginx,orginy,ot,pard,parms,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./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,./build/doc/SourceDocu`
2021-06-17 08:02:57 +02:00
David Osterberg
59ec3cb141 PartDesign: New features AdditiveHelix and SubtractiveHelix
These features, based on the code for the Pipe class, allow the user
to simply create a helical sweep within PartDesign workbench.

Sample application is threads, springs, coils, augers, etc.

Also, remove needless requirement for positive cone angle on helixes.

Thanks to @bitacovir for helping with the icons
Thanks to @chennes for review
Thanks to @vosk for review
Thanks to @wwmayer for review

Enforce that links stay within scope for ProfileBased features
This also ensures that the Body itself is not used for creating features within
the body, causing a "Graph not a DAG" error.
2021-02-04 13:01:12 +01:00
wmayer
4ec45b545e boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
Zheng, Lei
8952306088 PartDesign: fix Body getSubObject() 2019-10-16 10:55:53 +02:00
Zheng, Lei
35c5e5a8a9 PartDesign: do not touch body on child change 2019-08-30 13:31:19 +02:00
luz.paz
039d6eac01 Fix typos in various src/Mod directories 2019-08-17 15:32:49 +02:00
Zheng, Lei
11a93a0578 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
Zheng, Lei
ff1d1cd341 App: add New APIs for future Link function
DocumentObject:

* getSubObject(): the most important API for Link to work with
  hierarchies. The function is a inspired from and replaces the
  getPySubObjects(). It returns a child object following a dot separated
  subname reference, and can optionally return accumulated
  transformation, and/or a python object of the refered
  sub-object/element. The default implementation here is to look for
  link type property, and search for the referenced object. This patch also
  include other specialized implementation of this API, such as
  (GeoFeature)GroupExtension (through extensionGetSubObject()),
  PartDesign::Body, and so on. A link type object is expected to
  call the linked object's getSubObject() for resolving.

* getSubObjectList(): helper function to return a list of object
  referenced in the given subname.

* getSubObjects(): return a list of subname references of all children
  objects. The purpose of this function is similar to
  ViewProvider::claimChildren().  Container type object is expected to
  implement this function.  The reason it returns subname references
  instead of just object is to allow the container to skip hierarchies.
  For example, the Assembly3 container uses this to skip the constraint
  and element group.

* getLinkedObject(), obtain the linked object, and optionally with the
  accumulated transformation. It is expected to return a linked object
  or the object itself if it is not a link. In case there are multiple
  levels of linking involved, this function allows the caller to retrieve
  the linked object recursively.

* hasChildElement(), set/isElementVisible(), controls the children
  visibility for a group type object. Because the child object may be
  claimed by other objects, it is essential to have independent control
  of children visibilities. These APIs are designed to abstract how
  group manages the child visibility. For performance reason, these
  function are meant to control only the immediate child object.

* resolve(), helper function to parse subname reference and resolve the
  final object, and optionally the immediate parent of the final object,
  the final object reference name (for calling `set/isElementVisible()`),
  and the subname reference if there is one.

* touch(), add optional argument 'noRecompute' for better backward
  compatibility with the NoRecompute flag. By default, touch() causes
  recompute unless noRecompute is true

* signalChanged/signalBeforeChange, two new signal for tracking changes
  of a specific object.

* getViewProviderNameOverride(), return a string of the view provider
  type of this object. This allows Python class to override the view
  provider of an object. This feature will be used by ViewProviderLink
  which is designed to work with any object that has LinkBaseExtension.

* canLinkProperties(), will be used by Gui::PropertyView to display
  linked object properties together with the object's own properties.

* redirectSubname(), will be used by Gui::Tree to allow an object to
  redirect selection to some other object when (pre)selected in the tree
  view.

* Visibility, new property serve as the same purpose as view provider
  property of the same name. It is added here so that App namespace
  code can check for visibility without Gui module. This is useful,
  for example, when constructing a compound shape of a container that
  respects the children visibility.

* (has)hasHiddenMarker(), return or check for a special sub-element
  name used as marker for overriding sub-object visibility. Will be
  used by Gui::ViewProvider, it is put here for the same reason as
  adding Visibility property.

* getID(), return object internal identifier. Each object is now
  assigned an integer identifier that is unique within its containing
  document.

Document:

* ShowHidden, new property to tell tree view whether to show hidden
  object items.

* signalTouchedObject, new signal triggered when manually touch an
  object when calling its touch() function

* getObjectByID(), get object by its identifier

* addObject() is modified to allow overriding view provider

* has/getLinksTo(), helper function to obtain links to a given object.

Application:

* checkLinkDepth(), helper function to check recursive depth for link
  traversal. The depth is checked against the total object count of
  all opened documents. The count (_objCount) is internally updated
  whenever object is added or removed.

* has/getLinksTo(), same as Document::has/getLinksTo() but return links
  from all opened documents.

GroupExtension/OriginGroupExtension/DatumFeature/DatumCS/Part::Feature:
implement sepcialized getSubObject/getSubObjects().
2019-08-17 14:52:08 +02:00
wmayer
7acdb56d92 Replace Base::Exception with appropriate subclass 2018-11-14 19:28:00 +01:00
wmayer
2fb62cf0a1 improve whitespaces 2018-09-22 13:40:28 +02:00
wmayer
5c40496cf3 fixes #0003514: Program crashes when user try to add (by mistake) the origin to a group 2018-09-12 19:01:25 +02:00
wmayer
70399e6c9c fixes #0003302: PDN cloned object have duplicated 'Unnamed' ghost on every file reopen 2018-01-30 19:26:06 +01:00
wmayer
4d36757636 improve whitespaces 2018-01-22 20:06:12 +01:00
Abdullah Tahiri
01e6cde7aa PartDesign: Fix bug of mirror transformation of multiple features
fixes #3317

This code ensures that an individual transformation or a multi-transformation have a proper
base feature and next feature.
2018-01-22 19:56:58 +01:00
wmayer
7d4eafbab0 if an Undo/Redo is performed then do nothing inside the body feature 2017-09-21 19:00:26 +02:00
Stefan Tröger
de31528dda 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
Stefan Tröger
972b89d0a0 Make PartDesign::Boolean work with new Link structure
This is the first feature that used GeoFeatureGroupExtension and required links to the groups inside as well as to things on the same level. Hence a few modifications to link scopes have been nesseccary.
2017-09-09 16:55:55 +02:00
Stefan Tröger
bfb95e3d12 Partially fix PartDesign move test 2017-06-19 15:37:09 +02:00
Stefan Tröger
f9200f4502 Extend python interface for groups and fix test cases 2017-06-19 15:37:09 +02:00