Commit Graph

1245 Commits

Author SHA1 Message Date
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
bc26820837 Gui: Placement/DatumCS view provider changes
* Add always zoom invariant and always on top rendering to
  ViewProviderDatumCS

* Add a new utility class AxisOrigin for more efficient axis rendering.
  Also exposed to python.

* Change ViewProviderPlacement to use AxisOrigin for rendering.
  A single instance of AxisOrigin is shared by all
  ViewProviderPlacement. Selection context is used to distinguish among
  different instances.
2019-08-17 15:08:34 +02:00
Zheng, Lei
c8891be856 Gui: add coinRemoveAllChildren to work around Coin3D bug
See bug description:
https://bitbucket.org/Coin3D/coin/pull-requests/119/fix-sochildlist-auditing/diff

Because of path based rendering (SoFCPathAnnotation) in mouse over
highlight, this bug causes crash more frequently here comparing to
upstream.

All C++ calling of SoGroup::removeAllChildren() is replaced by
Gui::coinRemoveAllChildren(), and python code is fixed by monkey
patching SoGroup.removeAllChildren() in FreeCADGuiInit.py.
2019-08-17 14:52:11 +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
0penBrain
4617e5484a Add basic ability that PartDesign doesn't switch to Task panel when activated => Add a 'SwitchToTask' boolean parameter to Mod/PartDesign and set to 'false' to prevent switching 2019-07-13 12:56:09 -03:00
wmayer
6d02fa5409 automatically redirect to tip object in case body display mode is set to Tip and a face was selected to create a new sketch 2019-07-08 11:46:09 +02:00
wmayer
6e44433b8b activate/create 3d view when setting or getting active objects 2019-07-05 18:53:35 +02:00
wmayer
85270f5cd3 Fix a couple of clang compiler warnings:
-Wunused-variable
-Winconsistent-missing-override
-Wdelete-non-virtual-dtor
-Wunused-private-field
-Wformat
2019-06-23 15:19:12 +02:00
Abdullah Tahiri
511bb070b9 PartDesign Gui: Extend ViewProviderDatum with Part::ViewProviderAttachExtension 2019-06-23 01:03:36 +02:00
Abdullah Tahiri
85c37aa6c0 PartDesign Gui: Extend ViewProvider with Part::ViewProviderAttachExtension 2019-06-23 01:03:36 +02:00
Abdullah Tahiri
7602d39dda Pixmap: Make bigger attachment icon 2019-06-23 01:03:35 +02:00
Abdullah Tahiri
2ac5707072 PartDesign: Refactor set/remove tip in the new Gui::ViewProvider mechanism 2019-06-23 01:03:35 +02:00
Abdullah Tahiri
321e9215d4 PartDesign: Extend Datums ViewProvider to overlay attachment status 2019-06-23 01:03:35 +02:00
wmayer
0b8baab4c7 PartDesign: Extend context menu when right-clicking on 3d view in PD workbench 2019-06-21 13:02:56 +02:00
Yorik van Havre
236f890864 Merged translations from crowdin 2019-06-17 20:06:59 -03: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
wmayer
9177b4057c remove dependency of datum element if creation of copy fails 2019-06-15 12:23:47 +02:00
luz.paz
7c1490c046 Misc. typo and whitespace fixes
Found via `codespell`
2019-05-30 19:56:12 +02:00
wmayer
74b3169dba fix PartDesign build failure 2019-05-16 12:46:02 +02:00
Abdullah Tahiri
55a5f652e1 PCH: PartDesign GUI PCH Enable 2019-05-16 12:46:02 +02:00
Yorik van Havre
ed386410bc Merged latest translations from crowdin 2019-05-10 19:19:37 -03:00
Abdullah Tahiri
e82c154d1d PartDesign: PCH GUI 2019-05-02 07:12:51 +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
luz.paz
0238906d38 Misc. typo and whitespace fixes
Found via `codespell`
2019-04-30 10:15:59 -03:00
wmayer
a7919b63de PVS: V703 It is odd that the 'previewFaceSet' field in derived class 'ViewProviderPrimitive' overwrites field in base class 'ViewProviderAddSub' 2019-03-16 12:41:53 +01: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
51811e4bf4 PVS: V688 A local variable possesses the same name as one of the class members, which can result in a confusion 2019-03-13 11:58:43 +01:00
wmayer
32c527c5a6 PVS: V547 Expression is always true/false 2019-03-12 18:33:26 +01:00
Yorik van Havre
dcae6d027e Updated translations 2019-03-06 21:50:08 -03:00
wmayer
13433f4779 fix invalid static_cast 2019-03-06 16:56:26 +01:00
Yorik van Havre
a70a82e19f Revert "Merged crowdin translations" for investigation due to some problems found in the translation files...
This reverts commit 9032c4c587.
2019-03-02 19:17:44 -03:00
Yorik van Havre
9032c4c587 Merged crowdin translations 2019-02-28 21:53:37 -03:00
wmayer
10c745175f support Del shortcut in several PD task dialogs 2019-02-27 13:36:45 +01:00
wmayer
e3d63493c7 fixes 0003061: 'Move object after other object' function causes chaos 2019-02-24 14:04:42 +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
wmayer
2fcb7cb644 fixes 0003805: After 'Create a hole with the selected sketch' the model disappears 2019-02-21 18:49:00 +01:00
wmayer
afc44af3e9 In boolean task panel show labels not internal names, fix adding/removing bodies 2019-02-19 20:49:14 +01:00
wmayer
638845a6f0 fixes 0003845: unwanted rounding for dimensions of subtractive shapes in task dialog 2019-02-19 09:50:12 +01:00
wmayer
b842274386 PVS: V783 Dereferencing of the invalid iterator 'b' might take place. 2019-02-17 22:39:13 +01:00
wmayer
2bb5797568 PVS: V595 The pointer was utilized before it was verified against nullptr 2019-02-17 20:55:52 +01:00
wmayer
f581d5c8cb PVS: V560 A part of conditional expression is always true 2019-02-17 13:56:48 +01:00
wmayer
7da9b674fc issue 0003832: Editing thickness in Part or PartDesign resets join type to always being Arc 2019-02-16 15:56:46 +01:00
wmayer
e9434d5023 in selection dialog also offer planar shape binders 2019-02-15 18:45:45 +01:00
triplus
43b081947f Improved icon themes support 2019-02-13 10:42:46 -02:00
luz.paz
604811596f Crowdin: cont... 2019-02-11 16:22:13 +01:00
luz.paz
112f3de671 Crowdin: Continuing to refine translation strings 2019-02-11 16:22:12 +01:00