Class that keeps Animate
workbench objects in recommended structures.
More...
Public Member Functions | |
def | __new__ (cls, *args, **kwargs) |
Method creating an AnimateDocumentObserver singleton instance. More... | |
def | slotBeforeChangeObject (self, obj, prop) |
Qt slot method called when an object in a surveyed document is about to change. More... | |
def | slotChangedObject (self, obj, prop) |
Qt slot method called when an object in an observed document was changed. More... | |
def | isAnimateGroup (self, obj) |
Method to check whether a group object comes from the Animate workbench. More... | |
def | isAnimateObject (self, obj) |
Method to check whether an object comes from the Animate workbench. More... | |
def | foreignObjectInAnimateGroup (self, obj, group) |
Method testing whether a forbidden object is in an Animate group object. More... | |
def | animateObjectInForeignGroup (self, obj, group) |
Method testing whether an Animate object is in a foreign group object. More... | |
def | slotDeletedDocument (self, doc) |
Qt slot method called if a document is about to be closed. More... | |
def | addServerToNotify (self, server_proxy, document_name) |
Method to add a server which needs to be notified when its document is closing. More... | |
Public Attributes | |
group_before | |
A list of objects inside a group object about to change. More... | |
Static Public Attributes | |
dictionary | server_proxies = {} |
A dict of document names and ServerProxies in them. More... | |
Class that keeps Animate
workbench objects in recommended structures.
Definition at line 63 of file AnimateDocumentObserver.py.
def AnimateDocumentObserver.AnimateDocumentObserver.__new__ | ( | cls, | |
* | args, | ||
** | kwargs | ||
) |
Method creating an AnimateDocumentObserver
singleton instance.
AnimateDocumentObserver
singleton instance. Definition at line 86 of file AnimateDocumentObserver.py.
def AnimateDocumentObserver.AnimateDocumentObserver.addServerToNotify | ( | self, | |
server_proxy, | |||
document_name | |||
) |
Method to add a server which needs to be notified when its document is closing.
An active server must close a socket, it is using, when a document it's on is closing, so that a socket won't be blocked when it is needed again.
server_proxy | A ServerProxy which takes care of a Server instance. |
document_name | Name of a document with the Server instance. |
Definition at line 308 of file AnimateDocumentObserver.py.
def AnimateDocumentObserver.AnimateDocumentObserver.animateObjectInForeignGroup | ( | self, | |
obj, | |||
group | |||
) |
Method testing whether an Animate
object is in a foreign group object.
obj | A suspected Animate object. |
group | A group object which is possibly not from the Animate workbench. |
Definition at line 279 of file AnimateDocumentObserver.py.
def AnimateDocumentObserver.AnimateDocumentObserver.foreignObjectInAnimateGroup | ( | self, | |
obj, | |||
group | |||
) |
Method testing whether a forbidden object is in an Animate
group object.
Trajectory group objects are allowed to be stacked. Control objects can contain any other Animate
object. CollisionDetector objects can accommodate only Collision objects.
obj | A suspected foreign object in an Animate group object. |
group | The Animate group object possibly harboring an illegal object. |
Definition at line 234 of file AnimateDocumentObserver.py.
def AnimateDocumentObserver.AnimateDocumentObserver.isAnimateGroup | ( | self, | |
obj | |||
) |
Method to check whether a group object comes from the Animate
workbench.
As all Animate
objects have a Proxy
attached, its reasonable to firstly check for it and then decide according to the Proxy
object's name if it is an Animate
group.
Animate
workbench and false otherwise. Definition at line 178 of file AnimateDocumentObserver.py.
def AnimateDocumentObserver.AnimateDocumentObserver.isAnimateObject | ( | self, | |
obj | |||
) |
Method to check whether an object comes from the Animate
workbench.
As all Animate
objects have a Proxy
attached, its reasonable to firstly check for it and then decide according to the Proxy
object's name if it is from the Animate
workbench.
Animate
workbench and false otherwise. Definition at line 204 of file AnimateDocumentObserver.py.
def AnimateDocumentObserver.AnimateDocumentObserver.slotBeforeChangeObject | ( | self, | |
obj, | |||
prop | |||
) |
Qt slot method called when an object in a surveyed document is about to change.
If the object which is going to change has a Group
property, then a transaction is begun and a current state of the Group
property is recorded.
obj | An object in the observed document about to change. |
prop | A str of a property about to change. |
Definition at line 103 of file AnimateDocumentObserver.py.
def AnimateDocumentObserver.AnimateDocumentObserver.slotChangedObject | ( | self, | |
obj, | |||
prop | |||
) |
Qt slot method called when an object in an observed document was changed.
This method is used to enforce a recommended structure of Animate
objects in Tree View. It checks that only allowed objects are inside Animate
group objects. It also checks that no Animate
object is inside a group object that does not belong to the Animate
workbench. Lastly, it obstructs user from deleting Collision objects from a CollisionDetector group object.
obj | An object in the observed document about to change. |
prop | A str of a property about to change. |
Definition at line 122 of file AnimateDocumentObserver.py.
def AnimateDocumentObserver.AnimateDocumentObserver.slotDeletedDocument | ( | self, | |
doc | |||
) |
Qt slot method called if a document is about to be closed.
This method is used to notify all ServerProxies
that the document they are in is going to be closed.
doc | A FreeCAD's App.Document document about to be closed. |
Definition at line 291 of file AnimateDocumentObserver.py.
AnimateDocumentObserver.AnimateDocumentObserver.group_before |
A list of objects inside a group object about to change.
Definition at line 107 of file AnimateDocumentObserver.py.
|
static |
A dict of document names and ServerProxies
in them.
Definition at line 78 of file AnimateDocumentObserver.py.