Commit Graph

53 Commits

Author SHA1 Message Date
Zheng, Lei
46209e7f77 Gui: fix view object global coordinate space showable checking 2020-09-10 14:30:50 +02:00
wmayer
e5d23469f7 Gui: add function to observe before changing a property 2020-01-13 02:17:39 +01:00
wmayer
a9f820470b fix some const correctness 2019-12-29 17:13:18 +01:00
wmayer
e900384250 declare getMDIView and getMDIViewPage as const 2019-12-29 13:55:39 +01:00
wmayer
b1551934b4 Add parameter to suppress touching a document when a view provider has been modified 2019-08-24 15:54:41 +02:00
luz.paz
0f67e8ddfa Fix typos in src/Gio 2019-08-17 15:32:49 +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
c744157e9a Gui: add support of selection context
The patch implements context-aware selection and rendering in 3D view.

Please check [here](https://git.io/fjiY5) for more details, including
the following 'Render Caching' section.

The patch also includes modification of View3DInventorViewer to support
always-on-top selection rendering using the secondary selection context
and the new coin node SoFCPathAnnotation.

Another small change in SoQtQuarterAdaptor for more responsive frame
rate display. The original implementation reports skewed frame rate
in the presence of long idle period.
2019-08-17 14:52:10 +02:00
Zheng, Lei
f5d92fdae7 ViewProvider(DocumentObject): new APIs for context aware selection
Context aware selection makes it possible to select the same Coin3D node
in different hierarchies (i.e. context) without ambiguity.

New/modified APIs in ViewProvider (the first two are the most crucial
APIs for context aware selection to work):

* getElementPicked(), supercedes getElement(). Given a Coin3D pick
  point, this function returns a dot separated subname reference as a
  path leads to the selected object.

* getDetailPath(), supercedes getDetail(). Given a subname reference,
  this function returns an SoFullPath leads to the Coin3D node of the
  selected object or sub-element (with SoDetail).

* (has)HiddenMarker(), check/return a special text marker for context
  aware override of object visibility.

* partialRender(), render only part of the object based on given
  subname references. It can render, e.g. some faces of a solid, or
  some children of a container. It uses the 'secondary' extension of
  SoSelectionElementAction to select which elements to render or hide.
  The actually rendering functionality will be added in the following
  patch.

* update()/onChanged(), modified to sync Visibility property from
  DocumentObject.

* useNewSelectionModel(), modified to return the default true view
  parameter. This is for test in the early stage of Link development,
  probably not needed anymore.

* getBoundingBox(), a convenience function to obtain the bounding box
  of a sub-object/element regardless of object's visibility. It uses
  getDetailPath() and SoGetBoundingBoxAction to obtain bounding box
  through Coin3D. It will be used in later sub-element box selection
  functionality.

New/modified APIs in ViewProviderDocumentObject:

* getElementPicked()/getDetailPath() provides actual implementation to
  support container like (sub)object selection without ambiguity. It
  relies on DocumentObject::getSubObject() to walk the path.

* reattach(), called when undo deleteion

* forceUpdate()/isUpdateForced(), force update even if object is
  invisible. These are used by Link to force update the visual of a
  linked object regardless of its visibility.

* getLinkedViewProvider(), return the linked view provider with
  hierarchy.

ViewProviderDocumentObjectPy:

* Object attribute is made writtable. Assigning it is equaivalant of
  calling ViewProviderDocumentObject::attach() in Python.
2019-08-17 14:52:10 +02:00
Zheng, Lei
a75c955d32 ViewProvider/ViewProviderExtension: various new APIs
Some of these new APIs are not strictly needed for Link to work, but
good to have.

Summary of the API changes:

* getModeSwitch/getTransformNode() exposes view provider mode switch
  and transformation coin3D node, required by ViewProviderLink to
  override placement and visibility.

* canAddToSceneGraph() inform 3D viewer whether to add the root node to
  scenegraph. Some object only exists as a child of some coordinate
  system. Not adding them can simplify scenegraph and visibility
  management.

* showInTree() inform tree view whether to show the corresponding tree
  item.

* getDefaultMode() to expose the current active mode regardless of the
  view provider's visibility

* (can)DropObjectEx() superseds (can)DropObject() with additional
  support of subname reference, which makes it easy to support linking
  to sub-objects. One of the use case is cross coordinate system
  linking.

* getDropPrefix() is used to tell tree view where the object is dropped
  into. A non empty return means the object is actually dropped into a
  sub-object. For example, Assembly3 container puts all dropped object
  into its child container PartGroup.

* canDragAndDropObject() is used to inform tree view whether the object
  dropped need to be dragged out of its original parent, which usually
  does not make sure for Link type object.

* beforeDelete() will be called by Gui::Document when either the
  object itself is being deleted or when the document is being
  destoried.

* is/setLinkVisibility() allows to show/hide a link to this object.
  This may be used during editing, to prevent showing editing geometry
  in multiple places.

* update() is made a virtual function, it will be overridden by
  ViewProviderDocumentObject in future patch.

* startEditing() now becomes virtual, and return a ViewProvider that
  actually handles the editing. This is for future Link type object to
  forward editing request

* covert(), convenience function to convert between Coin3D and FC matrix

ViewProviderExtension also gains many relavant extension point of the
new API. There is also the new extensionModeSwitchChange() for notifying
mode switch changes

ViewProviderPy exposes several method/attribute for the new API as well.
2019-08-17 14:52:10 +02:00
Zheng, Lei
bce47d23ce Gui: add convenient smart pointer CoinPtr to manager coin node 2019-08-17 14:52:10 +02:00
Abdullah Tahiri
4150488139 Gui::Add mergeoverlay function to ViewProviderExtension 2019-06-23 01:03:36 +02:00
Abdullah Tahiri
b0fdf138b8 Gui: Extend ViewProvider to enable merging of overlays on icon 2019-06-23 01:03:35 +02:00
luz.paz
519bbfe503 Misc. source comment typo and whitespace fixes 2019-05-06 13:42:30 +02:00
plgarcia
792bb8282a Drags and drop with groups 2018-11-29 21:25:28 +01:00
wmayer
f898eafd64 move from deprecated boost.signals to boost.signals2 library 2018-10-30 19:09:03 +01:00
Zheng, Lei
436d04fe3e ViewProviderDocumentObject: forbid recursive call of updateView() 2018-08-08 13:44:36 +02:00
luz.paz
505488c4f9 Misc. typos
Found via `codespell`
2018-04-25 09:41:33 -03:00
Unknown
a8ecffb652 Misc. typo fixes
Various workbenches
2017-12-23 14:30:30 +01:00
wmayer
c1542e2401 issue #0002080: Attempt to remove FEM analysis result (displacement & stress) results in false warning 2017-10-18 19:46:20 +02:00
wmayer
a405b4dae0 issue #0003070: VRML 2 crashes with corner cases 2017-06-11 16:41:52 +02:00
wmayer
72ab17fb48 fix typos 2016-12-19 14:07:35 +01:00
wmayer
07a2182674 remove obsolete class ViewProviderPythonFeaturePy 2016-11-09 12:15:15 +01:00
wmayer
9ac1810ea3 Fix issues:
+ improve formatting
+ remove superfluous semicolons
+ comment unused parameters
+ rename Initialisation to Initialization
+ rename Deinitialisation to Finalization
+ remove spaces
2016-10-08 12:48:34 +02:00
Stefan Tröger
a79b48bbcc Fix rebase errors 2016-10-08 12:48:34 +02:00
Stefan Tröger
ab692a4c08 Extensions: Fix visibility restore issue 2016-10-08 12:48:34 +02:00
Stefan Tröger
261798da2e Extensions: Port ViewProvider of GeoFeatureGroup 2016-10-08 12:48:34 +02:00
Stefan Tröger
0a539538de Extensions: Port ViewProvider of groups 2016-10-08 12:48:34 +02:00
Stefan Tröger
8c002f1709 Extensions: Introduce ViewProviderExtension 2016-10-08 12:48:34 +02:00
wmayer
40c79f18e4 fix msvc problems 2016-09-21 22:14:09 +02:00
wmayer
f19d424d8b fix -Wextra in FreeCADGui 2016-09-21 20:54:52 +02:00
wmayer
9ec06b47c6 prepare view provider for undo/redo 2016-07-23 11:45:38 +02:00
wmayer
f0e00311cd prepare view provider for undo/redo 2016-07-23 11:45:21 +02:00
Stefan Tröger
666a5968cb Override mode works with non-toplevel viewprovider
And adopt the part design body to handle the override mode correctly
2016-04-12 18:12:23 +02:00
Alexander Golubev
dbb5786ffd App/GeoFeatureGroup: derive from DocumentObjectGroup
Refactor GeoFeatureGroup and derive it from DocumentObjectGroup rather
than GeoFeatureObject to unify code of those two classes.
2016-04-12 18:12:17 +02:00
jriegel
884ae139fa Several enhancements
+ PLMXML Reader
+ Some meta information sorting
+ Making ProductRefs invisibly in Tree
2016-04-12 18:12:03 +02:00
wmayer
e6624bf1c3 + add method to get display mask mode from view provider 2016-02-24 21:00:55 +01:00
Mateusz Skowroński
43a4a5938c Fix files encoding. Go from ISO8859-1 to UTF-8. 2015-09-21 19:50:49 -03:00
wmayer
13b8d323b2 + FEM: Improve drag and drop for FEM analysis object 2015-04-23 13:31:14 +02:00
wmayer
bdfaaee833 + fixes #0001869: Clones displayed in wrong view mode 2015-01-12 19:36:04 +01:00
wmayer
cc775f9254 + fix -Wnull-conversion, -Woverloaded-virtual, -Wlogical-not-parentheses, -Wsometimes-uninitialized 2014-08-26 19:14:13 +02:00
wmayer
0467777d1b + remove unneeded semicolons 2014-05-08 17:32:23 +02:00
wmayer
38d55b540e + Start drag and drop of view providers 2014-03-11 17:36:17 +01:00
tanderson
3b8176535b implemented 2014-01-16 10:27:21 -02:00
wmayer
1333cb8734 + Get exact point on data model when picking in 3d view 2013-11-21 12:50:49 +01:00
jriegel
d739a2e41b Add all base system changes from the Assembly branch 2013-02-10 20:02:33 +01:00
wmayer
d2ac422f68 Fix memory leak in sketcher view provider 2012-11-14 15:04:14 +01:00
logari81
e7ca7631fe Sketcher: implement box selection (based on mrlukeparry's work) 2012-09-04 14:14:03 +02:00
wmayer
e95de7090d + add method to get SoDetail from element name
+ fix broken selection mechanism

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5260 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-12-10 21:11:20 +00:00
wmayer
6a9dff8129 + do some code clean up
+ adjust type id according to inheritance of view providers

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5111 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-11-10 16:40:14 +00:00