Proxy class for Gui.ViewProviderDocumentObject
RobTranslation.ViewObject.
More...
Public Member Functions | |
def | __init__ (self, vp) |
Initialization method for ViewProviderRobTranslationProxy. 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 RobTranslation was changed. More... | |
def | onChanged (self, vp, prop) |
Method called after RobTranslation.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 when RobTranslation is double-clicked in the Tree View. More... | |
def | setupContextMenu (self, vp, menu) |
Method called by the FreeCAD to customize a RobTranslation context menu. 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 RobTranslation. 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 RobotPanel if one is active or None. More... | |
fp = None | |
A RobTranslation object. More... | |
Proxy class for Gui.ViewProviderDocumentObject
RobTranslation.ViewObject.
A ViewProviderRobTranslationProxy instance provides a RobTranslation's icon, double-click response and context menu with a Check joint range option.
To connect this Proxy
object to a Gui.ViewProviderDocumentObject
RobTranslation.ViewObject do:
Definition at line 579 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.__init__ | ( | self, | |
vp | |||
) |
Initialization method for ViewProviderRobTranslationProxy.
A class instance is created and made a Proxy
for a generic Gui.ViewProviderDocumentObject
RobTranslation.ViewObject. During initialization number of properties are specified and preset.
vp | A barebone Gui.ViewProviderDocumentObject RobTranslation.ViewObject. |
Definition at line 646 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.__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 877 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.__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 887 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.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 translation. This method adds RobTranslation as the fp
attribute.
vp | A RobTranslation.ViewObject after initialization. |
Definition at line 660 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.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 RobTranslation group.
obj | An object hovering above a RobTranslation item in the Tree View. |
Definition at line 846 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.claimChildren | ( | self | ) |
Method called by FreeCAD to retrieve assigned children.
When a property of a RobTranslation is touched the RobTranslation 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 832 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.doubleClicked | ( | self, | |
vp | |||
) |
Method called when RobTranslation is double-clicked in the Tree View.
If no dialog is opened in the Task View, a new RobotPanel
is opened. If another RobotPanel
is opened, it is closed and all its QDialogs are added to a new RobotPanel
. If a RobotPanel
is already opened, the Model tab on the Combo View is swapped for the Tasks tab so that the panel becomes visible. If another dialog is opened a warning is shown.
vp | A Gui.ViewProviderDocumentObject RobTranslation.ViewObject. |
Definition at line 917 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.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 861 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.makeFrame | ( | self, | |
frame_labels | |||
) |
Method which makes a Coin3D frame to show a current pose in a RobTranslation.
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 RobTranslation
properties.
Definition at line 1050 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.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 1012 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.onChanged | ( | self, | |
vp, | |||
prop | |||
) |
Method called after RobTranslation.ViewObject was changed.
If visibility changed, an appropriate Coin3D construct hides the frame showing current pose.
vp | A RobTranslation.ViewObject. |
prop | A str name of a changed property. |
Definition at line 816 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.setProperties | ( | self, | |
vp | |||
) |
Method to hide unused properties.
Property Display Mode is set to be invisible as they are unused.
vp | A Gui.ViewProviderDocumentObject RobTranslation.ViewObject. |
Definition at line 898 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.setupContextMenu | ( | self, | |
vp, | |||
menu | |||
) |
Method called by the FreeCAD to customize a RobTranslation context menu.
The Transform and Set colors... items are removed from the context menu shown upon right click on DocumentObjectGroupPython
RobTranslation in the Tree View. The option to Check joint range is added instead.
vp | A right-clicked RobTranslation.ViewObject. |
menu | A Qt's QMenu to be edited. |
Definition at line 997 of file RobTranslation.py.
def RobTranslation.ViewProviderRobTranslationProxy.updateData | ( | self, | |
fp, | |||
prop | |||
) |
Method called after DocumentObjectGroupPython
RobTranslation 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 RobTranslation object. |
prop | A str name of a changed property. |
Definition at line 693 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.font |
A SoFontStyle font for axes labels.
Definition at line 665 of file RobTranslation.py.
|
static |
A RobTranslation object.
Definition at line 633 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.frame |
A SoSeparator with a coordinate frame made from 3 RGB arrows.
Definition at line 670 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.frame_arrowhead |
A SoSwitch translated cone for frame axes.
Definition at line 1064 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.frame_arrowhead_cone |
A SoCone arrowhead cone for frame axes.
Definition at line 1063 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.frame_arrowhead_translation |
A SoTranslation moving frame arrowheads.
Definition at line 1062 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.frame_color_x |
A SoPackedColor red color for an X axis.
Definition at line 1078 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.frame_color_y |
A SoPackedColor green color for an Y axis.
Definition at line 1079 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.frame_color_z |
A SoPackedColor blue color for an Z axis.
Definition at line 1080 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.frame_drawstyle |
A SoDrawStyle controlling frame axes shaft line width.
Definition at line 1102 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.frame_shaft |
A SoLineSet shaft for frame axes.
Definition at line 1055 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.label_texts |
A list of SoText2
s labels denoting all axes and an origin.
Definition at line 1015 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.label_translations |
A list of SoTranslation
s moving labels.
Definition at line 1016 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.labels |
A list of SoSwitch
es containing colored translated labels.
Definition at line 1021 of file RobTranslation.py.
|
static |
A RobotPanel if one is active or None.
Definition at line 632 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.tf_object2world |
A SoTransform transformation from object to world frame.
Definition at line 662 of file RobTranslation.py.
RobTranslation.ViewProviderRobTranslationProxy.visualisations |
A SoSwitch with all visualisations (frame & rotation axis).
Definition at line 673 of file RobTranslation.py.