Commit Graph

463 Commits

Author SHA1 Message Date
Zheng, Lei
72bd2bc9b2 PartDesign: add 'VisibleFeature' attribute to BodyPy 2019-08-30 13:34:41 +02:00
Zheng, Lei
35c5e5a8a9 PartDesign: do not touch body on child change 2019-08-30 13:31:19 +02:00
wmayer
4c648caaa8 Fix clang compiler warnings:
+ fix -Winconsistent-missing-override
2019-08-17 19:52:49 +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
4b89ed3415 make UpToLast option for pad working again 2019-06-17 16:14:13 +02:00
wmayer
972ec50f28 fixes #0003979: Pocket with mode 'up to face' doesn't work correctly 2019-06-15 23:54:10 +02:00
wmayer
5ea062f669 use ShapeBinder to create a copy from Origin feature 2019-06-15 15:43:29 +02:00
wmayer
18183bc79b extend ShapeBinder to also handle Origin features 2019-06-15 15:07:52 +02:00
luz.paz
7c1490c046 Misc. typo and whitespace fixes
Found via `codespell`
2019-05-30 19:56:12 +02:00
Abdullah Tahiri
a415ad72e1 PartDesign: 3rdParty to PCH 2019-05-02 07:12:27 +02:00
Abdullah Tahiri
e80af8b4f2 PCH for Sketcher/PartDesign 2019-05-01 09:05:55 +02:00
wmayer
87bf7094a5 PVS: V601 The bool type is implicitly cast to the double type
PVS: V668 There is no sense in testing pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error
2019-03-13 14:09:10 +01:00
wmayer
13433f4779 fix invalid static_cast 2019-03-06 16:56:26 +01:00
wmayer
564d41d835 fixes 0003524: The PartDesign hole feature should respect the Reverse property and provide a checkbox in the panel 2019-02-22 21:10:05 +01:00
DeepSOIC
6a4422a9b6 PartDesign: Shapebinder: fix placement
reported by koluna:
https://forum.freecadweb.org/viewtopic.php?f=20&t=33794
2019-02-04 22:19:23 -02:00
DeepSOIC
03d7b83adb PartDesign: Shapebinder: use compound instead of fusion 2019-02-04 22:19:23 -02:00
wmayer
563d020b67 improve error messages for Pocket, Hole and Groove feature 2018-12-31 18:30:13 +01:00
Abdullah Tahiri
ffd980b27e PartDesign: Up to face inclined plane limitation
================================================

fixes #3177

I fixed it by tricking the function, see:
https://forum.freecadweb.org/viewtopic.php?f=8&t=24238&start=30#p274454
2018-12-24 11:01:59 -02:00
wmayer
fa658f2f3b prepare for OCCT 7.3.1 2018-12-14 15:51:10 +01:00
wmayer
7acdb56d92 Replace Base::Exception with appropriate subclass 2018-11-14 19:28:00 +01:00
wmayer
f898eafd64 move from deprecated boost.signals to boost.signals2 library 2018-10-30 19:09:03 +01:00
wandererfan
2b84be64cc Fix spurious error message
-  in FeatureGroove, the check for multiple
   solids in result was checking the wrong
   variable.
2018-10-29 10:29:23 -03:00
wmayer
8e084199d9 improve trace support of Shape binder 2018-10-07 22:11:53 +02:00
wmayer
830caf34c0 fixes 0003547: Linear pattern, mirrored and polar pattern feature not working on a hole just on pocket 2018-09-27 13:30:30 +02:00
wmayer
19cd040415 in linear pattern handle selected edge of a 2d part object 2018-09-27 11:04:30 +02:00
wmayer
2fb62cf0a1 improve whitespaces 2018-09-22 13:40:28 +02:00
wmayer
b5811a42b4 fixes #0003582: ShapeBinder did not show correctly 2018-09-22 00:55:46 +02:00
wmayer
4b90bed74e fix -Winconsistent-missing-override 2018-09-17 14:18:36 +02:00
DeepSOIC
38df1ae742 Part, PartDesign, Attacher: fix a few problems with infinite shapes
To throw an error instead of returning a semi-infinite result that kills rendering.
fixes #3439
2018-09-13 13:12:55 +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
DeepSOIC
4ca046a729 PartDesign: Refine property for Boolean #3488 2018-09-11 07:16:58 +02:00
DeepSOIC
46621a85d4 PartDesign: Refine property for primitives #3488 2018-09-11 07:16:49 +02:00
luz.paz
8740a3a568 Whitespace formatting 2018-08-26 17:30:44 +02:00
luz.paz
55e93745fa Misc. typo fixes
Found via `codespell`
2018-08-26 17:30:44 +02:00
wmayer
fe2660b468 issue #0003177: Part Design Pad should allow besides 'Up to face' something like 'Up to plane' as well 2018-08-26 13:22:35 +02:00
wmayer
3f0dca6387 avoid that Datum plane is always touched when automatically resizing it from within its own view provider 2018-08-25 11:09:15 +02:00
wmayer
cdc507d9bb CMP0050: make PartDesign module aware of cmake policy 2018-08-20 17:19:04 +02:00
Markus Lampert
0b40519f3f Changed all catch types to references for polymorphic exceptions. 2018-08-08 15:45:30 +02:00
wmayer
1f4ab25d9a add option to resize datum planes manually 2018-07-30 22:31:24 +02:00
Eivind Kvedalen
c2ada8eacd Fix for issue #3541: Normalize xDir vector for Hole feature to correct hole diameter. 2018-07-29 01:03:17 +02:00
wandererfan
7e781bcfd0 Revise multiple solids message 2018-07-13 10:23:42 -03:00
wandererfan
883a726d52 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
833c2c601e add missing newlines 2018-06-09 11:47:12 +02:00
wmayer
2fcc354461 fix several warnings:
-Winconsistent-missing-override
-Wsign-compare
-Wmaybe-uninitialized
-Wmissing-braces
2018-04-29 13:28:36 +02:00
wmayer
ae9305f498 fix warning -Winconsistent-missing-override 2018-04-29 11:50:04 +02:00
luz.paz
505488c4f9 Misc. typos
Found via `codespell`
2018-04-25 09:41:33 -03:00
DeepSOIC
8a7525f620 PartDesign: fix #2758 Datum Point persistence, again 2018-04-14 15:48:56 +02:00
DeepSOIC
d2ee3d2ac0 PartDesign: fix #0002758 Datum point moves to (0,0,0) when reopening the file
OCC has a peculiarity, that when saving single vertexes, it burns in placement into vertex coordinates. In loaded shape, Placement is zero. This caused datum point placement reset to zero, and its shape had nonzero  coordinates.

This fix keeps placement property from resetting, and reconstructs a new vertex upon load.
2018-04-04 17:43:15 +02:00