Here is a summary of the changes:
* SoFCUnifiedSelection is changed to deliver selection action to coin path instead of view provider root node, in order to distinguish shared coin nodes. Two api is added to ViewProvider, getDetailPath, getElementPicked to return node path formation.
* SoFCSelectionRoot is added to store selection context for other node to render selection. View provider can use SoFCSelectionRoot to replace a linked children's viewprovider root node, and share other geometry nodes under it. Other geometry nodes, SoBrepPointSet, SoBrepEdgeSet, SoBrepFaceSet, and the following SoFCSelection node is modified to query and store the selection information inside SoFCSelectionRoot. Multiple SoFCSelectionRoot can appear along the path for multi-level linking. The sequence of traversed instances of SoFCSelectionRoot is used as key to store and retrieve selection context. The context is always stored in the first encountered SoFCSelectionRoot.
* SoFCSelection is changed to be unified under SoFCUnifiselection. SoFCSelection no longer handles mouse event, but is only responsible for rendering the highlight. This change is necessary for selection disambiguation of shared nodes that uses SoFCSelection, such as Origin inside App::Part.
* ViewProviderDocumentObject api addition: getLinkedView() and getLinks() is added to allow tree view handle links.
* ViewProviderExtension: extensionGetLinks() to return all links that links to itself.
* ViewProviderLink: dynamically installs an extension called Observer to linked view provider to observe various changes. The observer holds a reference to LinkInfo which holds the replaced root node and shared coin tree. The tree gets rebuild once the linked view provider changes. Each linked object will have maximum three type of cloned coin representation, 1) with overriden placement (i.e. the cloned tree removes the original SoTransform node) and with override visibility (i.e replaced pcModeSwitch), 2) with original placement but with overridden visibility. 3) with original placement and visibility, this is for child object under App::Part. ViewProviderLink will retrieve the cloned coin tree and insert it into its own tree. It also implements the above getElementPicked and getDetailPath to disambiguate the shared nodes.
* ViewProviderLink does not require a specific DocumentObject counter part. It has a configurable list of property names and types. Any document object having those properties can use ViewProviderLink. App::LinkExtension is an example that holds those properties, and it also implements the following methods for sub object retrieval.
* DocumentObject api addition: change getPySubObjects() to accept a Base::Matrix4D to support transformation aggregation. getLinkedObject() is added to return final linked object with aggregated transformation matrix.
* Both App::Link and Part::Link uses App::LinkExtension to do the work. Part:Link::execute will also use getLinkedObject() to retrieve the final linked object and shallow copy its Shape object, so that it can be used inside other Part objects.
* Gui::Application add's convenient function getLinkedVewOfType to query a specific type of the linked object. This is used in PartGui, see below.
* PartGui: various view provider inside now use the above getLinkedViewOfType to transparently and safely access the child if it is (or is linked to) a view provider of type ViewProviderPart. This is essential for Part::Link to work.
Other modification are not essential for realization of Link.
Last edited by realthunder
on Sat May 06, 2017 9:27 am, edited 2 times in total.
Try Assembly3 (latest version 0.11
) along with my custom build of FreeCAD at here
And if you'd like to show your support, you can donate through patreon
, or paypal