Proxy class for Gui.ViewProviderDocumentObject
Trajectory.ViewObject.
More...
Public Member Functions | |
def | __init__ (self, vp) |
Initialization method for ViewProviderTrajectoryProxy. 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 Trajectory was changed. More... | |
def | onChanged (self, vp, prop) |
Method called after Trajectory.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 Trajectory 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 Trajectory. 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 trajectory. More... | |
def | makeRotationAxis (self, axis_label) |
Method which makes a Coin3D rotation axis to show in the FreeCAD View. More... | |
Public Attributes | |
tf_object2world | |
A SoTransform transformation from object to world frame. More... | |
font | |
A SoFontStyle font for axes labels. More... | |
rot_axis | |
A SoSwitch with a rotation axis in form of an arrow. 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... | |
axis_label_color | |
A SoPackedColor coloring a rotational axis(RA) label. 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... | |
rot_axis_shaft | |
A SoLineSet shaft for a rotation axis. More... | |
rot_axis_arrowhead_translation | |
A SoTranslation moving a RA arrowhead. More... | |
rot_axis_arrowhead_cone | |
A SoCone arrowhead cone for a rotation axis. More... | |
rot_axis_arrowhead | |
A SoSwitch translated cone for a rotation axis. More... | |
tf_y2axis | |
A SoTransform transformation from Y axis to a rotation axis. More... | |
rot_axis_color | |
A SoPackedColor coloring a rotational axis. More... | |
rot_axis_drawstyle | |
A SoDrawStyle controlling RA shaft line width. More... | |
Static Public Attributes | |
panel = None | |
A TrajectoryPanel if one is active or None. More... | |
fp = None | |
A Trajectory object. More... | |
Proxy class for Gui.ViewProviderDocumentObject
Trajectory.ViewObject.
A ViewProviderTrajectoryProxy instance provides a Trajectory's icon, double-click response and context menu with a Select Time option.
To connect this Proxy
object to a Gui.ViewProviderDocumentObject
Trajectory.ViewObject do:
Definition at line 824 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.__init__ | ( | self, | |
vp | |||
) |
Initialization method for ViewProviderTrajectoryProxy.
A class instance is created and made a Proxy
for a generic Gui.ViewProviderDocumentObject
Trajectory.ViewObject. During initialization number of properties are specified and preset.
vp | A barebone Gui.ViewProviderDocumentObject Trajectory.ViewObject. |
Definition at line 918 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.__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 1250 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.__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 1260 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.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 trajectory. This method adds Trajectory as the fp
attribute.
vp | A Trajectory.ViewObject after initialization. |
Definition at line 932 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.canDropObject | ( | self, | |
obj | |||
) |
Method called by FreeCAD to ask if an object obj
can be dropped into a Group.
Only FreeCAD objects of a Trajectory type are allowed to drop inside a Trajectory group.
obj | A FreeCAD object hovering above a Trajectory item in the Tree View. |
Definition at line 1220 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.claimChildren | ( | self | ) |
Method called by FreeCAD to retrieve assigned children.
When a property of a Trajectory is touched the Trajectory 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 1206 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.doubleClicked | ( | self, | |
vp | |||
) |
Method called by FreeCAD when Trajectory is double-clicked in the Tree View.
If no dialog is opened in the Task View, a new TrajectoryPanel
is opened. If another TrajectoryPanel
is opened, it is closed and all its QDialogs are added to a new TrajectoryPanel
. If a TrajectoryPanel
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 Trajectory.ViewObject. |
Definition at line 1287 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.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 1234 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.makeFrame | ( | self, | |
frame_labels | |||
) |
Method which makes a Coin3D frame to show a current pose in a trajectory.
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 Trajectory
properties.
Definition at line 1432 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.makeLabels | ( | self | ) |
Method which makes Coin3D labels to be displayed in the FreeCAD View.
Frame labels for axes X, Y and Z and a label for rotation axis are made. The labels have the same color as the axes.
Definition at line 1389 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.makeRotationAxis | ( | self, | |
axis_label | |||
) |
Method which makes a Coin3D rotation axis to show in the FreeCAD View.
A rotation axis is made from a shaft and an arrowhead. Its dimensions and other attributes are unassigned as they are extracted from appropriate Trajectory
properties.
Definition at line 1505 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.onChanged | ( | self, | |
vp, | |||
prop | |||
) |
Method called after Trajectory.ViewObject was changed.
If visibility changed, an appropriate Coin3D construct hides the frame showing current pose.
vp | A Trajectory.ViewObject. |
prop | A str name of a changed property. |
Definition at line 1190 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.setProperties | ( | self, | |
vp | |||
) |
Method to hide unused properties.
Property Display Mode is set to be invisible as they are unused.
vp | A Gui.ViewProviderDocumentObject Trajectory.ViewObject. |
Definition at line 1271 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.setupContextMenu | ( | self, | |
vp, | |||
menu | |||
) |
Method called by the FreeCAD to customize a context menu for a Trajectory.
The Transform and Set colors... items are removed from the context menu shown upon right click on DocumentObjectGroupPython
Trajectory in the Tree View. The option to Select Time is added instead.
vp | A right-clicked Gui.ViewProviderDocumentObject Trajectory.ViewObject. |
menu | A Qt's QMenu to be edited. |
Definition at line 1374 of file Trajectory.py.
def Trajectory.ViewProviderTrajectoryProxy.updateData | ( | self, | |
fp, | |||
prop | |||
) |
Method called after DocumentObjectGroupPython
Trajectory 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 Trajectory object. |
prop | A str name of a changed property. |
Definition at line 972 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.axis_label_color |
A SoPackedColor coloring a rotational axis(RA) label.
Definition at line 1408 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.font |
A SoFontStyle font for axes labels.
Definition at line 937 of file Trajectory.py.
|
static |
A Trajectory object.
Definition at line 905 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.frame |
A SoSeparator with a coordinate frame made from 3 RGB arrows.
Definition at line 948 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.frame_arrowhead |
A SoSwitch translated cone for frame axes.
Definition at line 1446 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.frame_arrowhead_cone |
A SoCone arrowhead cone for frame axes.
Definition at line 1445 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.frame_arrowhead_translation |
A SoTranslation moving frame arrowheads.
Definition at line 1444 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.frame_color_x |
A SoPackedColor red color for an X axis.
Definition at line 1460 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.frame_color_y |
A SoPackedColor green color for an Y axis.
Definition at line 1461 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.frame_color_z |
A SoPackedColor blue color for an Z axis.
Definition at line 1462 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.frame_drawstyle |
A SoDrawStyle controlling frame axes shaft line width.
Definition at line 1484 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.frame_shaft |
A SoLineSet shaft for frame axes.
Definition at line 1437 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.label_texts |
A list of SoText2
s labels denoting all axes and an origin.
Definition at line 1392 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.label_translations |
A list of SoTranslation
s moving labels.
Definition at line 1393 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.labels |
A list of SoSwitch
es containing colored translated labels.
Definition at line 1398 of file Trajectory.py.
|
static |
A TrajectoryPanel if one is active or None.
Definition at line 904 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.rot_axis |
A SoSwitch with a rotation axis in form of an arrow.
Definition at line 942 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.rot_axis_arrowhead |
A SoSwitch translated cone for a rotation axis.
Definition at line 1519 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.rot_axis_arrowhead_cone |
A SoCone arrowhead cone for a rotation axis.
Definition at line 1518 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.rot_axis_arrowhead_translation |
A SoTranslation moving a RA arrowhead.
Definition at line 1517 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.rot_axis_color |
A SoPackedColor coloring a rotational axis.
Definition at line 1528 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.rot_axis_drawstyle |
A SoDrawStyle controlling RA shaft line width.
Definition at line 1531 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.rot_axis_shaft |
A SoLineSet shaft for a rotation axis.
Definition at line 1510 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.tf_object2world |
A SoTransform transformation from object to world frame.
Definition at line 934 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.tf_y2axis |
A SoTransform transformation from Y axis to a rotation axis.
Definition at line 1525 of file Trajectory.py.
Trajectory.ViewProviderTrajectoryProxy.visualisations |
A SoSwitch with all visualisations (frame & rotation axis).
Definition at line 951 of file Trajectory.py.