Proxy class for Gui.ViewProviderDocumentObject
RobWorld.ViewObject.
More...
Public Member Functions | |
def | __init__ (self, vp) |
Initialization method for ViewProviderRobWorldProxy. More... | |
def | attach (self, vp) |
Method called by FreeCAD after initialization to attach Coin3D constructs. More... | |
def | updateData (self, fp, prop) |
Method called after DocumentObjectGroupPython RobWorld was changed. More... | |
def | onChanged (self, vp, prop) |
Method called after RobWorld.ViewObject was changed. More... | |
def | claimChildren (self) |
Method called by FreeCAD to retrieve assigned children. More... | |
def | canDropObject (self, obj) |
Method called by FreeCAD to ask if an object obj can be dropped into a Group. More... | |
def | getIcon (self) |
Method called by FreeCAD to supply an icon for the Tree View. More... | |
def | __getstate__ (self) |
Necessary method to avoid errors when trying to save unserializable objects. More... | |
def | __setstate__ (self, state) |
Necessary method to avoid errors when trying to restore unserializable objects. More... | |
def | setProperties (self, vp) |
Method to hide unused properties. More... | |
def | doubleClicked (self, vp) |
Method called by FreeCAD when RobWorld is double-clicked in the Tree View. More... | |
def | setupContextMenu (self, vp, menu) |
Method called by the FreeCAD to customize a context menu for a RobWorld. More... | |
def | makeLabels (self) |
Method which makes Coin3D labels to be displayed in the FreeCAD View. More... | |
def | makeFrame (self, frame_labels) |
Method which makes a Coin3D frame to show a current pose in a RobWorld. More... | |
Public Attributes | |
tf_object2world | |
A SoTransform transformation from object to world frame. More... | |
font | |
A SoFontStyle font for axes labels. More... | |
frame | |
A SoSeparator with a coordinate frame made from 3 RGB arrows. More... | |
visualisations | |
A SoSwitch with all visualisations (frame & rotation axis). More... | |
label_texts | |
A list of SoText2 s labels denoting all axes and an origin. More... | |
label_translations | |
A list of SoTranslation s moving labels. More... | |
labels | |
A list of SoSwitch es containing colored translated labels. More... | |
frame_shaft | |
A SoLineSet shaft for frame axes. More... | |
frame_arrowhead_translation | |
A SoTranslation moving frame arrowheads. More... | |
frame_arrowhead_cone | |
A SoCone arrowhead cone for frame axes. More... | |
frame_arrowhead | |
A SoSwitch translated cone for frame axes. More... | |
frame_color_x | |
A SoPackedColor red color for an X axis. More... | |
frame_color_y | |
A SoPackedColor green color for an Y axis. More... | |
frame_color_z | |
A SoPackedColor blue color for an Z axis. More... | |
frame_drawstyle | |
A SoDrawStyle controlling frame axes shaft line width. More... | |
Static Public Attributes | |
panel = None | |
A RobWorldPanel if one is active or None. More... | |
fp = None | |
A RobWorld object. More... | |
Proxy class for Gui.ViewProviderDocumentObject
RobWorld.ViewObject.
A ViewProviderRobWorldProxy instance provides a RobWorld's icon, and displays frame.
To connect this Proxy
object to a Gui.ViewProviderDocumentObject
RobWorld.ViewObject do:
Definition at line 277 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.__init__ | ( | self, | |
vp | |||
) |
Initialization method for ViewProviderRobWorldProxy.
A class instance is created and made a Proxy
for a generic Gui.ViewProviderDocumentObject
RobWorld.ViewObject. During initialization number of properties are specified and preset.
vp | A barebone Gui.ViewProviderDocumentObject RobWorld.ViewObject. |
Definition at line 344 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.__getstate__ | ( | self | ) |
Necessary method to avoid errors when trying to save unserializable objects.
This method is used by JSON to serialize unserializable objects during autosave. Without this an Error would rise when JSON would try to do that itself.
We need this for unserializable fp
attribute, but we don't serialize it, because it's enough to reset it when object is restored.
Definition at line 575 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.__setstate__ | ( | self, | |
state | |||
) |
Necessary method to avoid errors when trying to restore unserializable objects.
This method is used during a document restoration. We need this for unserializable fp
attribute, but we do not restore it, because it's enough to reset it.
Definition at line 585 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.attach | ( | self, | |
vp | |||
) |
Method called by FreeCAD after initialization to attach Coin3D constructs.
A coordinate frame made of RGB arrows corresponding to X, Y and Z axes. This frame shows current pose in a RobWorld. This method adds RobWorld as the fp
attribute.
vp | A RobWorld.ViewObject after initialization. |
Definition at line 358 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.canDropObject | ( | self, | |
obj | |||
) |
Method called by FreeCAD to ask if an object obj
can be dropped into a Group.
Only FreeCAD objects of a RobRotation and RobTranslation type are allowed to drop inside a RobWorld group.
obj | A FreeCAD object hovering above a RobWorld item in the Tree View. |
Definition at line 544 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.claimChildren | ( | self | ) |
Method called by FreeCAD to retrieve assigned children.
When a property of a RobWorld is touched the RobWorld and the FreeCAD ActiveDocument are notified. The FreeCAD ActiveDocument then emits a signal to inform all its observers e.g. the FreeCADGui ActiveDocument. The FreeCADGui document then emits a new signal to inform e.g. the tree view. The tree view then invokes claimChildren()
.
Definition at line 530 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.doubleClicked | ( | self, | |
vp | |||
) |
Method called by FreeCAD when RobWorld is double-clicked in the Tree View.
The default behavior is blocked, because it does not make sense in given context.
vp | A Gui.ViewProviderDocumentObject RobWorld.ViewObject. |
Definition at line 612 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.getIcon | ( | self | ) |
Method called by FreeCAD to supply an icon for the Tree View.
A full path to an icon is supplied for the FreeCADGui.
Definition at line 559 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.makeFrame | ( | self, | |
frame_labels | |||
) |
Method which makes a Coin3D frame to show a current pose in a RobWorld.
A frame is made from 3 red, green and blue arrows representing X, Y and Z. Arrows are each constructed from a shaft and an arrowhead. Their dimensions and other attributes are unassigned as they are extracted from appropriate RobWorld
properties.
Definition at line 676 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.makeLabels | ( | self | ) |
Method which makes Coin3D labels to be displayed in the FreeCAD View.
Frame labels for axes X, Y and Z are made. The labels have the same color as the axes.
Definition at line 638 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.onChanged | ( | self, | |
vp, | |||
prop | |||
) |
Method called after RobWorld.ViewObject was changed.
If visibility changed, an appropriate Coin3D construct hides the frame showing current pose.
vp | A RobWorld.ViewObject. |
prop | A str name of a changed property. |
Definition at line 514 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.setProperties | ( | self, | |
vp | |||
) |
Method to hide unused properties.
Property Display Mode is set to be invisible as they are unused.
vp | A Gui.ViewProviderDocumentObject RobWorld.ViewObject. |
Definition at line 596 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.setupContextMenu | ( | self, | |
vp, | |||
menu | |||
) |
Method called by the FreeCAD to customize a context menu for a RobWorld.
The Transform and Set colors... items are removed from the context menu shown upon right click on DocumentObjectGroupPython
RobWorld in the Tree View.
vp | A right-clicked Gui.ViewProviderDocumentObject RobWorld.ViewObject. |
menu | A Qt's QMenu to be edited. |
Definition at line 626 of file RobWorld.py.
def RobWorld.ViewProviderRobWorldProxy.updateData | ( | self, | |
fp, | |||
prop | |||
) |
Method called after DocumentObjectGroupPython
RobWorld was changed.
This method is used to update Coin3D constructs, if associated properties changed e.g. if the FrameArrowheadRadius
changes, all Coin3D cones representing frame arrowheads will change their radius accordingly.
fp | A DocumentObjectGroupPython RobWorld object. |
prop | A str name of a changed property. |
Definition at line 391 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.font |
A SoFontStyle font for axes labels.
Definition at line 363 of file RobWorld.py.
|
static |
A RobWorld object.
Definition at line 331 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.frame |
A SoSeparator with a coordinate frame made from 3 RGB arrows.
Definition at line 368 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.frame_arrowhead |
A SoSwitch translated cone for frame axes.
Definition at line 690 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.frame_arrowhead_cone |
A SoCone arrowhead cone for frame axes.
Definition at line 689 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.frame_arrowhead_translation |
A SoTranslation moving frame arrowheads.
Definition at line 688 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.frame_color_x |
A SoPackedColor red color for an X axis.
Definition at line 704 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.frame_color_y |
A SoPackedColor green color for an Y axis.
Definition at line 705 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.frame_color_z |
A SoPackedColor blue color for an Z axis.
Definition at line 706 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.frame_drawstyle |
A SoDrawStyle controlling frame axes shaft line width.
Definition at line 728 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.frame_shaft |
A SoLineSet shaft for frame axes.
Definition at line 681 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.label_texts |
A list of SoText2
s labels denoting all axes and an origin.
Definition at line 641 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.label_translations |
A list of SoTranslation
s moving labels.
Definition at line 642 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.labels |
A list of SoSwitch
es containing colored translated labels.
Definition at line 647 of file RobWorld.py.
|
static |
A RobWorldPanel if one is active or None.
Definition at line 330 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.tf_object2world |
A SoTransform transformation from object to world frame.
Definition at line 360 of file RobWorld.py.
RobWorld.ViewProviderRobWorldProxy.visualisations |
A SoSwitch with all visualisations (frame & rotation axis).
Definition at line 371 of file RobWorld.py.