Files
create/src/Gui/ViewProviderPy.xml
Zheng, Lei 899fb722ea 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

184 lines
6.8 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
<PythonExport
Father="ExtensionContainerPy"
Name="ViewProviderPy"
Twin="ViewProvider"
TwinPointer="ViewProvider"
Include="Gui/ViewProvider.h"
Namespace="Gui"
FatherInclude="App/ExtensionContainerPy.h"
FatherNamespace="App">
<Documentation>
<Author Licence="LGPL" Name="Werner Mayer" EMail="wmayer@users.sourceforge.net" />
<UserDocu>This is the ViewProvider base class</UserDocu>
</Documentation>
<Methode Name="addProperty">
<Documentation>
<UserDocu>
addProperty(string, string) -- Add a generic property.
The first argument specifies the type, the second the
name of the property.
</UserDocu>
</Documentation>
</Methode>
<Methode Name="removeProperty">
<Documentation>
<UserDocu>
removeProperty(string) -- Remove a generic property.
Note, you can only remove user-defined properties but not built-in ones.
</UserDocu>
</Documentation>
</Methode>
<Methode Name="supportedProperties">
<Documentation>
<UserDocu>A list of supported property types</UserDocu>
</Documentation>
</Methode>
<Methode Name="show">
<Documentation>
<UserDocu>Show the object</UserDocu>
</Documentation>
</Methode>
<Methode Name="hide">
<Documentation>
<UserDocu>Hide the object</UserDocu>
</Documentation>
</Methode>
<Methode Name="isVisible">
<Documentation>
<UserDocu>Check if the object is visible</UserDocu>
</Documentation>
</Methode>
<Methode Name="canDragObject">
<Documentation>
<UserDocu>canDragObject(obj=None): check whether the child object can be removed by dragging</UserDocu>
</Documentation>
</Methode>
<Methode Name="dragObject">
<Documentation>
<UserDocu>dragObject(obj): remove a child object by dropping</UserDocu>
</Documentation>
</Methode>
<Methode Name="canDropObject">
<Documentation>
<UserDocu>
canDropObject(obj=None,owner=None,subname=None)
check whether the child object can be added by dropping
</UserDocu>
</Documentation>
</Methode>
<Methode Name="dropObject">
<Documentation>
<UserDocu>dropObject(obj,owner=None,subname=None): add a child object by dropping</UserDocu>
</Documentation>
</Methode>
<Methode Name="canDragAndDropObject">
<Documentation>
<UserDocu>
canDragAndDropObject(obj)
Check whether the child object can be removed from other parent and added here by drag and drop
</UserDocu>
</Documentation>
</Methode>
<Methode Name="replaceObject">
<Documentation>
<UserDocu>
replaceObject(oldObj, newObj) -> Int: replace a child object
Returns 1 if succeed, 0 if not found, -1 if not supported
</UserDocu>
</Documentation>
</Methode>
<Methode Name="doubleClicked">
<Documentation>
<UserDocu>Trigger double clicking the corresponding tree item of this view object</UserDocu>
</Documentation>
</Methode>
<Methode Name="addDisplayMode">
<Documentation>
<UserDocu>Add a new display mode to the view provider</UserDocu>
</Documentation>
</Methode>
<Methode Name="listDisplayModes">
<Documentation>
<UserDocu>Show a list of all display modes</UserDocu>
</Documentation>
</Methode>
<Methode Name="toString">
<Documentation>
<UserDocu>Return a string representation of the Inventor node</UserDocu>
</Documentation>
</Methode>
<Methode Name="setTransformation">
<Documentation>
<UserDocu>Set a transformation on the Inventor node</UserDocu>
</Documentation>
</Methode>
<Methode Name="claimChildren" Const="true">
<Documentation>
<UserDocu>Returns list of objects that are to be grouped in tree under this object.</UserDocu>
</Documentation>
</Methode>
<Methode Name="signalChangeIcon" Const="true">
<Documentation>
<UserDocu>Trigger icon changed signal</UserDocu>
</Documentation>
</Methode>
<Attribute Name="Annotation" ReadOnly="false">
<Documentation>
<UserDocu>A pivy Separator to add a custom scene graph to this ViewProvider</UserDocu>
</Documentation>
<Parameter Name="Annotation" Type="Object" />
</Attribute>
<Attribute Name="Icon" ReadOnly="true">
<Documentation>
<UserDocu>The icon of this ViewProvider</UserDocu>
</Documentation>
<Parameter Name="Icon" Type="Object" />
</Attribute>
<Attribute Name="RootNode" ReadOnly="false">
<Documentation>
<UserDocu>A pivy Separator with the root of this ViewProvider</UserDocu>
</Documentation>
<Parameter Name="RootNode" Type="Object" />
</Attribute>
<Attribute Name="SwitchNode" ReadOnly="false">
<Documentation>
<UserDocu>A pivy SoSwitch for the display mode switch of this ViewProvider</UserDocu>
</Documentation>
<Parameter Name="SwitchNode" Type="Object" />
</Attribute>
<Attribute Name="DefaultMode" ReadOnly="false">
<Documentation>
<UserDocu>Get/Set the default display mode in turns of coin node index</UserDocu>
</Documentation>
<Parameter Name="DefaultNode" Type="Int" />
</Attribute>
<Attribute Name="IV" ReadOnly="true">
<Documentation>
<UserDocu>Represents the whole ViewProvider as an Inventor string.</UserDocu>
</Documentation>
<Parameter Name="IV" Type="String" />
</Attribute>
<Attribute Name="CanRemoveChildrenFromRoot" ReadOnly="true">
<Documentation>
<UserDocu>Tells the tree view whether to remvoe the children item from root or not</UserDocu>
</Documentation>
<Parameter Name="CanRemoveChildrenFromRoot" Type="Boolean" />
</Attribute>
<Attribute Name="LinkVisibility">
<Documentation>
<UserDocu>Get/set visiblities of all links to this view object</UserDocu>
</Documentation>
<Parameter Name="LinkVisibility" Type="Boolean" />
</Attribute>
<Attribute Name="DropPrefix" ReadOnly="true" >
<Documentation>
<UserDocu>Subname referecing the sub-object for holding dropped object</UserDocu>
</Documentation>
<Parameter Name="DropPrefix" Type="String" />
</Attribute>
</PythonExport>
</GenerateModel>