39 from RobotPanel
import RobotPanel
41 from PySide2.QtWidgets
import QMessageBox
42 from bisect
import bisect
47 PATH_TO_ICONS = path.join(FreeCAD.getHomePath(),
"Mod",
"Animate",
"Resources",
51 PATH_TO_UI = path.join(FreeCAD.getHomePath(),
"Mod",
"Animate",
"Resources",
82 print(
"This is RobRotation")
118 elif prop ==
"thetaMinimum" and hasattr(fp,
"thetaMaximum"):
120 fp.thetaMaximum = (fp.thetaMaximum, fp.thetaMinimum,
122 elif prop ==
"thetaMaximum" and hasattr(fp,
"thetaMinimum"):
124 fp.thetaMinimum = (fp.thetaMinimum, -float(
"inf"),
129 hasattr(fp,
"thetaMaximum")
and \
130 hasattr(fp,
"thetaMinimum")
and \
133 fp.Timestamps, fp.thetaSequence)
134 if traj_valid != fp.ValidRotation:
135 fp.ValidRotation = traj_valid
137 elif prop ==
"Placement":
139 if hasattr(fp,
"Group")
and len(fp.Group) != 0:
140 for child
in fp.Group:
141 child.ParentFramePlacement = fp.Placement
146 if hasattr(fp,
"AnimatedObjects")
and len(fp.AnimatedObjects) != 0:
147 for o
in fp.AnimatedObjects:
148 o.Placement = fp.Placement
151 elif prop ==
"ParentFramePlacement":
153 fp.Placement = fp.ParentFramePlacement.multiply(
169 if not fp.RobotPanelActive:
171 if not fp.ValidRotation:
172 FreeCAD.Console.PrintWarning(fp.Name +
173 ".execute(): Rotation " +
174 "is not in a valid format.\n")
180 fp.theta = fp.thetaOffset \
181 + (weights[0]*fp.thetaSequence[indices[0]]
182 + weights[1]*fp.thetaSequence[indices[1]])
185 T_theta = FreeCAD.Placement(FreeCAD.Vector(0, 0, 0),
186 FreeCAD.Rotation(FreeCAD.Vector(0, 0, 1),
188 T_d = FreeCAD.Placement(FreeCAD.Vector(0, 0, fp.d),
189 FreeCAD.Rotation(FreeCAD.Vector(0, 0, 1), 0))
190 T_a = FreeCAD.Placement(FreeCAD.Vector(fp.a, 0, 0),
191 FreeCAD.Rotation(FreeCAD.Vector(1, 0, 0), 0))
192 T_alpha = FreeCAD.Placement(FreeCAD.Vector(0, 0, 0),
193 FreeCAD.Rotation(FreeCAD.Vector(1, 0, 0),
196 fp.ObjectPlacement = T_theta.multiply(T_d.multiply(
197 T_a.multiply(T_alpha)))
200 fp.Placement = fp.ParentFramePlacement.multiply(fp.ObjectPlacement)
213 fp.ViewObject.Proxy.setProperties(fp.ViewObject)
229 if not hasattr(fp,
"ValidRotation"):
230 fp.addProperty(
"App::PropertyBool",
"ValidRotation",
"General",
231 "This property records if rotation was changed." 232 ).ValidRotation =
False 233 if not hasattr(fp,
"RobotPanelActive"):
234 fp.addProperty(
"App::PropertyBool",
"RobotPanelActive",
"General",
235 "This property records if robot panel is active." 236 ).RobotPanelActive =
False 237 if not hasattr(fp,
"AnimatedObjects"):
238 fp.addProperty(
"App::PropertyLinkListGlobal",
"AnimatedObjects",
239 "General",
"Objects that will be animated.")
240 if not hasattr(fp,
"Interpolate"):
241 fp.addProperty(
"App::PropertyBool",
"Interpolate",
"General",
242 "Interpolate RobRotation between timestamps." 244 if not hasattr(fp,
"AllowServer"):
245 fp.addProperty(
"App::PropertyBool",
"AllowServer",
"General",
246 "Should this object allow a Server object to " 247 +
"change it.").AllowServer =
True 248 if not hasattr(fp,
"AllowControl"):
249 fp.addProperty(
"App::PropertyBool",
"AllowControl",
"General",
250 "Should this object allow a Control object " 252 ).AllowControl =
True 253 if not hasattr(fp,
"Time"):
254 fp.addProperty(
"App::PropertyFloat",
"Time",
"General",
255 "Animation time in seconds.").Time = 0
256 if not hasattr(fp,
"ParentFramePlacement"):
257 fp.addProperty(
"App::PropertyPlacement",
"ParentFramePlacement",
258 "General",
"Current placement of a Parent Frame.")
259 if not hasattr(fp,
"ObjectPlacement"):
260 fp.addProperty(
"App::PropertyPlacement",
"ObjectPlacement",
262 "Current Object placement in a Parent Frame.")
265 if not hasattr(fp,
"d"):
266 fp.addProperty(
"App::PropertyFloat",
"d",
"d-hParameters",
267 "Displacement along Z axis.").d = 0
268 if not hasattr(fp,
"a"):
269 fp.addProperty(
"App::PropertyFloat",
"a",
"d-hParameters",
270 "Displacement along X axis.").a = 0
271 if not hasattr(fp,
"alpha"):
272 fp.addProperty(
"App::PropertyFloat",
"alpha",
"d-hParameters",
273 "Rotation angle about X axis in degrees.").alpha = 0
274 if not hasattr(fp,
"theta"):
275 fp.addProperty(
"App::PropertyFloat",
"theta",
"d-hParameters",
276 "Rotation angle about X axis in degrees.").theta = 0
277 if not hasattr(fp,
"thetaMaximum"):
278 fp.addProperty(
"App::PropertyFloatConstraint",
"thetaMaximum",
279 "d-hParameters",
"Upper limit of rotation angle" 280 +
" about Z axis in degrees." 281 ).thetaMaximum = (360, 0, float(
"inf"), 1)
282 elif hasattr(fp,
"thetaMinimum"):
283 fp.thetaMaximum = (fp.thetaMaximum, fp.thetaMinimum,
285 if not hasattr(fp,
"thetaMinimum"):
286 fp.addProperty(
"App::PropertyFloatConstraint",
"thetaMinimum",
287 "d-hParameters",
"Lower limit of rotation angle" 288 +
" about Z axis in degrees." 289 ).thetaMinimum = (0, -float(
"inf"), 360, 1)
290 elif hasattr(fp,
"thetaMaximum"):
291 fp.thetaMinimum = (fp.thetaMinimum, -float(
"inf"),
293 if not hasattr(fp,
"thetaOffset"):
294 fp.addProperty(
"App::PropertyFloat",
"thetaOffset",
295 "d-hParameters",
"Offset of rotation angle" 296 +
" about Z axis in degrees.").thetaOffset = 0
299 if not hasattr(fp,
"ShowFrame"):
300 fp.addProperty(
"App::PropertyBool",
"ShowFrame",
"Frame",
301 "Show a frame for current pose." 303 if not hasattr(fp,
"FrameTransparency"):
304 fp.addProperty(
"App::PropertyPercent",
"FrameTransparency",
305 "Frame",
"Transparency of the frame in percents." 306 ).FrameTransparency = 0
307 if not hasattr(fp,
"ShowFrameArrowheads"):
308 fp.addProperty(
"App::PropertyBool",
"ShowFrameArrowheads",
"Frame",
309 "Show arrowheads for frame axis arrow's." 310 ).ShowFrameArrowheads =
True 311 if not hasattr(fp,
"FrameArrowheadLength"):
312 fp.addProperty(
"App::PropertyFloatConstraint",
313 "FrameArrowheadLength",
"Frame",
314 "Frame axis arrow's arrowhead length.\n" 315 +
"Range is < 1.0 | 1e6 >." 316 ).FrameArrowheadLength = (10, 1.0, 1e6, 1)
318 fp.FrameArrowheadLength = (fp.FrameArrowheadLength, 1.0, 1e6, 1)
319 if not hasattr(fp,
"FrameArrowheadRadius"):
320 fp.addProperty(
"App::PropertyFloatConstraint",
321 "FrameArrowheadRadius",
"Frame",
322 "Frame axis arrow's arrowhead bottom radius.\n" 323 +
"Range is < 0.5 | 1e6 >." 324 ).FrameArrowheadRadius = (5, 0.5, 1e6, 0.5)
326 fp.FrameArrowheadRadius = (fp.FrameArrowheadRadius, 0.5, 1e6, 0.5)
327 if not hasattr(fp,
"ShaftLength"):
328 fp.addProperty(
"App::PropertyFloatConstraint",
"ShaftLength",
329 "Frame",
"Frame axis arrow's shaft length.\n" 330 +
"Range is < 1.0 | 1e6 >." 331 ).ShaftLength = (20, 1.0, 1e6, 1)
333 fp.ShaftLength = (fp.ShaftLength, 1.0, 1e6, 1)
334 if not hasattr(fp,
"ShaftWidth"):
335 fp.addProperty(
"App::PropertyFloatConstraint",
"ShaftWidth",
336 "Frame",
"Frame axis arrow's shaft width.\n" 337 +
"Range is < 1.0 | 64 >." 338 ).ShaftWidth = (4, 1.0, 64, 1)
340 fp.ShaftWidth = (fp.ShaftWidth, 1.0, 64, 1)
341 if not hasattr(fp,
"ShowFrameLabels"):
342 fp.addProperty(
"App::PropertyBool",
"ShowFrameLabels",
343 "Frame",
"Show label for frame axes." 344 ).ShowFrameLabels =
True 347 if not hasattr(fp,
"FontSize"):
348 fp.addProperty(
"App::PropertyIntegerConstraint",
"FontSize",
349 "Labels",
"Label font size.\n" 350 +
"Range is < 1 | 100 >." 351 ).FontSize = (10, 1, 100, 1)
353 fp.FontSize = (fp.FontSize, 1, 100, 1)
354 if not hasattr(fp,
"DistanceToAxis"):
355 fp.addProperty(
"App::PropertyFloatConstraint",
"DistanceToAxis",
356 "Labels",
"Distance from label to its axis.\n" 357 +
"Range is < 0.5 | 1e6 >." 358 ).DistanceToAxis = (5, 0.5, 1e6, 0.5)
360 fp.DistanceToAxis = (fp.DistanceToAxis, 0.5, 1e6, 0.5)
361 if not hasattr(fp,
"Subscription"):
362 fp.addProperty(
"App::PropertyString",
"Subscription",
"Labels",
363 "Subscription added to an axis name." 365 if not hasattr(fp,
"Superscription"):
366 fp.addProperty(
"App::PropertyString",
"Superscription",
"Labels",
367 "Superscription added to an axis name." 368 ).Superscription =
"" 369 if not hasattr(fp,
"FontFamily"):
370 fp.addProperty(
"App::PropertyEnumeration",
"FontFamily",
371 "Labels",
"Label font family." 372 ).FontFamily = [
"SERIF",
"SANS",
"TYPEWRITER"]
373 if not hasattr(fp,
"FontStyle"):
374 fp.addProperty(
"App::PropertyEnumeration",
"FontStyle",
375 "Labels",
"Label font style." 376 ).FontStyle = [
"NONE",
"BOLD",
"ITALIC",
380 if not hasattr(fp,
"Placement"):
381 fp.addProperty(
"App::PropertyPlacement",
"Placement",
"Base",
382 "Current placement for animated objects in " 386 if not hasattr(fp,
"Timestamps"):
387 fp.addProperty(
"App::PropertyFloatList",
"Timestamps",
388 "Rotation",
"Timestamps at which we define\n" 389 +
"translation and rotation.")
390 if not hasattr(fp,
"thetaSequence"):
391 fp.addProperty(
"App::PropertyFloatList",
"thetaSequence",
392 "Rotation",
"Rotation angles about Z axis in" 399 fp.setEditorMode(
"ObjectPlacement", 1)
400 fp.setEditorMode(
"ParentFramePlacement", 1)
401 fp.setEditorMode(
"theta", 1)
404 fp.setEditorMode(
"Placement", 2)
405 fp.setEditorMode(
"ValidRotation", 2)
406 fp.setEditorMode(
"RobotPanelActive", 2)
408 import AnimateDocumentObserver
423 self.
fp.Timestamps = joint_sequence[
"Timestamps"]
424 self.
fp.thetaSequence = joint_sequence[
"thetaSequence"]
426 FreeCAD.Console.PrintError(
"Invalid joint sequence!")
440 return prop
in [
"Timestamps",
"thetaSequence"]
461 if rotation
is not None and isinstance(rotation, dict):
462 for key
in [
"Timestamps",
"thetaSequence"]:
463 if key
not in rotation.keys():
464 FreeCAD.Console.PrintWarning(
"Rotation misses key " +
467 timestamps = rotation[
"Timestamps"]
468 thetas = rotation[
"thetaSequence"]
471 if len(timestamps) == 0
or \
472 (len(timestamps) != 0
and len(timestamps) != len(thetas)):
473 FreeCAD.Console.PrintWarning(
"Rotation has lists with " 474 +
"inconsistent or zero " 479 if any([timestamps[i] >= timestamps[i+1]
480 for i
in range(len(timestamps)-1)]):
481 FreeCAD.Console.PrintWarning(
"Rotation 'Timestamps' is not " 482 +
"list of increasing values.\n")
485 if not all([self.
fp.thetaMinimum <= th <= self.
fp.thetaMaximum
487 FreeCAD.Console.PrintWarning(
"Rotation 'thetaSequence' elements" 488 +
" are out of theta range.\n")
516 if fp.Time <= fp.Timestamps[0]:
521 elif fp.Time >= fp.Timestamps[-1]:
528 indices = [bisect(fp.Timestamps, fp.Time)]
530 indices.insert(0, indices[0]-1)
531 weights = [fp.Timestamps[indices[1]] - fp.Time,
532 fp.Time - fp.Timestamps[indices[0]]]
533 if not fp.Interpolate:
534 if weights[0] > weights[1]:
539 weights = [weights[0]/sum(weights), weights[1]/sum(weights)]
541 return indices, weights
679 frame.insertChild(self.
font, 1)
681 self.
frame.addChild(frame)
688 vp.Object.Proxy.setProperties(vp.Object)
705 if prop ==
"Placement" and hasattr(fp,
"Placement"):
706 trans = fp.Placement.Base
707 rot = fp.Placement.Rotation
713 elif prop ==
"ShowFrame" and hasattr(fp,
"ShowFrame"):
715 self.
frame.whichChild.setValue(coin.SO_SWITCH_ALL)
717 self.
frame.whichChild.setValue(coin.SO_SWITCH_NONE)
719 elif prop ==
"FrameTransparency" and hasattr(fp,
"FrameTransparency"):
721 setValue(0xff0000ff - (0xff*fp.FrameTransparency)//100)
723 setValue(0x00ff00ff - (0xff*fp.FrameTransparency)//100)
725 setValue(0x0000ffff - (0xff*fp.FrameTransparency)//100)
727 elif prop ==
"ShaftLength" and hasattr(fp,
"ShaftLength"):
728 self.
frame_shaft.vertexProperty.getValue().vertex.\
729 set1Value(1, 0, fp.ShaftLength, 0)
730 if hasattr(fp,
"FrameArrowheadLength"):
732 0, fp.ShaftLength + fp.FrameArrowheadLength/2, 0)
733 if not fp.ShowFrameArrowheads
and hasattr(fp,
"DistanceToAxis"):
735 0, fp.ShaftLength + fp.DistanceToAxis, 0)
737 elif prop ==
"FrameArrowheadLength" and \
738 hasattr(fp,
"FrameArrowheadLength"):
740 if hasattr(fp,
"ShaftLength"):
742 0, fp.ShaftLength + fp.FrameArrowheadLength/2, 0)
743 if fp.ShowFrameArrowheads
and hasattr(fp,
"DistanceToAxis"):
745 0, fp.FrameArrowheadLength/2 + fp.DistanceToAxis, 0)
747 elif prop ==
"ShaftWidth" and hasattr(fp,
"ShaftWidth"):
750 elif prop ==
"FrameArrowheadRadius" and \
751 hasattr(fp,
"FrameArrowheadRadius"):
753 fp.FrameArrowheadRadius)
755 elif prop ==
"ShowFrameArrowheads" and \
756 hasattr(fp,
"ShowFrameArrowheads"):
757 if fp.ShowFrameArrowheads:
759 if hasattr(fp,
"FrameArrowheadLength")
and \
760 hasattr(fp,
"DistanceToAxis"):
762 0, fp.FrameArrowheadLength/2 + fp.DistanceToAxis, 0)
765 if hasattr(fp,
"ShaftLength")
and \
766 hasattr(fp,
"DistanceToAxis"):
768 0, fp.ShaftLength + fp.DistanceToAxis, 0)
770 elif prop ==
"ShowFrameLabels" and hasattr(fp,
"ShowFrameLabels"):
771 for label
in self.
labels[:3]:
772 if fp.ShowFrameLabels:
773 label.whichChild.setValue(coin.SO_SWITCH_ALL)
775 label.whichChild.setValue(coin.SO_SWITCH_NONE)
778 elif prop ==
"Subscription" and hasattr(fp,
"Subscription"):
780 l.string.setValues(2, 1, [fp.Subscription])
782 elif prop ==
"Superscription" and hasattr(fp,
"Superscription"):
784 l.string.setValues(0, 1, [fp.Superscription])
786 elif prop ==
"FontFamily" and hasattr(fp,
"FontFamily"):
787 if fp.FontFamily ==
"SERIF":
788 self.
font.family.setValue(self.
font.SERIF)
789 if fp.FontFamily ==
"SANS":
790 self.
font.family.setValue(self.
font.SANS)
791 if fp.FontFamily ==
"TYPEWRITER":
792 self.
font.family.setValue(self.
font.TYPEWRITER)
794 elif prop ==
"FontStyle" and hasattr(fp,
"FontStyle"):
795 if fp.FontStyle ==
"NONE":
796 self.
font.style.setValue(self.
font.NONE)
797 if fp.FontStyle ==
"BOLD":
798 self.
font.style.setValue(self.
font.BOLD)
799 if fp.FontStyle ==
"ITALIC":
800 self.
font.style.setValue(self.
font.ITALIC)
801 if fp.FontStyle ==
"BOLD ITALIC":
802 self.
font.style.setValue(self.
font.BOLD | self.
font.ITALIC)
804 elif prop ==
"FontSize" and hasattr(fp,
"FontSize"):
805 self.
font.size.setValue(fp.FontSize)
807 elif prop ==
"DistanceToAxis" and hasattr(fp,
"DistanceToAxis")
and \
808 hasattr(fp,
"ShowFrameArrowheads"):
809 if fp.ShowFrameArrowheads
and hasattr(fp,
"FrameArrowheadLength"):
811 0, fp.FrameArrowheadLength/2 + fp.DistanceToAxis, 0)
812 elif hasattr(fp,
"ShaftLength"):
814 0, fp.ShaftLength + fp.DistanceToAxis, 0)
827 if prop ==
"Visibility":
843 if hasattr(self,
"fp")
and self.
fp:
857 if hasattr(obj,
"Proxy")
and \
858 (obj.Proxy.__class__.__name__ ==
"RobRotationProxy" or 859 obj.Proxy.__class__.__name__ ==
"RobTranslationProxy"):
872 return path.join(PATH_TO_ICONS,
"RobRotation.png")
910 vp.setEditorMode(
"DisplayMode", 2)
930 FreeCADGui.Control.showTaskView()
935 new_form = [FreeCADGui.PySideUic.loadUi(path.join(PATH_TO_UI,
936 "AnimationJoint.ui"))]
937 new_form[0].setWindowTitle(vp.Object.Label)
942 FreeCADGui.Control.showDialog(self.
panel)
943 except RuntimeError
as e:
950 for obj
in FreeCAD.ActiveDocument.Objects:
951 if hasattr(obj,
"Proxy")
and \
952 (obj.Proxy.__class__.__name__
953 ==
"RobRotationProxy" 954 or obj.Proxy.__class__.__name__
955 ==
"RobTranslationProxy"):
956 if obj.ViewObject.Proxy.panel
is not None:
957 robot_joints.append(obj)
959 if len(robot_joints) > 0:
961 robot_joints[0].ViewObject.Proxy.panel.reject()
966 for joint
in robot_joints:
967 form = FreeCADGui.PySideUic.loadUi(
968 path.join(PATH_TO_UI,
"AnimationJoint.ui"))
969 form.setWindowTitle(joint.Label)
973 forms.append(new_form[0])
976 robot_joints.append(vp.Object)
981 for joint
in robot_joints:
982 joint.ViewObject.Proxy.panel = self.
panel 983 FreeCADGui.Control.showDialog(self.
panel)
990 'Error while opening RobotPanel',
991 "A different panel is already active.\n" 992 +
"Close it before opening this one.")
993 FreeCADGui.Control.showTaskView()
1009 action = menu.addAction(
"Check joint range")
1023 label_strings = [
"X",
"Y",
"Z"]
1024 colors = [0xFF0000FF, 0x00FF00FF, 0x0000FFFF]
1033 label_group = coin.SoSeparator()
1035 frame_axis_color = coin.SoPackedColor()
1036 frame_axis_color.orderedRGBA.setValue(colors[i])
1037 label_group.addChild(frame_axis_color)
1040 0, 3, [
"", label_strings[i],
""])
1045 self.
labels.append(coin.SoSwitch())
1046 self.
labels[i].addChild(label_group)
1062 shaft_vertices = coin.SoVertexProperty()
1063 shaft_vertices.vertex.setNum(2)
1064 shaft_vertices.vertex.set1Value(0, 0, 0, 0)
1066 self.
frame_shaft.vertexProperty.setValue(shaft_vertices)
1080 rot_y2x = coin.SoRotation()
1081 rot_y2x.rotation.setValue(coin.SbRotation(coin.SbVec3f(0, 1, 0),
1082 coin.SbVec3f(1, 0, 0)))
1083 rot_y2z = coin.SoRotation()
1084 rot_y2z.rotation.setValue(coin.SbRotation(coin.SbVec3f(0, 1, 0),
1085 coin.SbVec3f(0, 0, 1)))
1093 x_arrow = coin.SoSeparator()
1094 x_arrow.addChild(rot_y2x)
1098 x_arrow.addChild(frame_labels[0])
1099 y_arrow = coin.SoSeparator()
1103 y_arrow.addChild(frame_labels[1])
1104 z_arrow = coin.SoSeparator()
1105 z_arrow.addChild(rot_y2z)
1109 z_arrow.addChild(frame_labels[2])
1115 separated_frame = coin.SoSeparator()
1117 separated_frame.addChild(x_arrow)
1118 separated_frame.addChild(y_arrow)
1119 separated_frame.addChild(z_arrow)
1121 return separated_frame
1142 return {
'Pixmap': path.join(PATH_TO_ICONS,
"RobRotationCmd.png"),
1143 'MenuText':
"RobRotation",
1144 'ToolTip':
"Create RobRotation instance."}
1155 doc = FreeCAD.ActiveDocument
1156 a = doc.addObject(
"App::DocumentObjectGroupPython",
"RobRotation")
1174 if FreeCAD.ActiveDocument
is None:
def getIcon(self)
Method called by FreeCAD to supply an icon for the Tree View.
font
A SoFontStyle font for axes labels.
frame_arrowhead
A SoSwitch translated cone for frame axes.
def __setstate__(self, state)
Necessary method to avoid errors when trying to restore unserializable objects.
def is_ValidRotation(self, timestamps=[], thetas=[], rotation=None)
Method to check if a rotation is valid.
def canDropObject(self, obj)
Method called by FreeCAD to ask if an object obj can be dropped into a Group.
def __setstate__(self, state)
Necessary method to avoid errors when trying to restore unserializable objects.
def addObserver()
Adds an AnimateDocumentObserver between FreeCAD's document observers safely.
fp
A DocumentObjectGroupPython associated with the proxy.
def __getstate__(self)
Necessary method to avoid errors when trying to save unserializable objects.
frame_color_z
A SoPackedColor blue color for an Z axis.
def doubleClicked(self, vp)
Method called by FreeCAD when RobRotation is double-clicked in the Tree View.
def onChanged(self, vp, prop)
Method called after RobRotation.ViewObject was changed.
def find_timestamp_indices_and_weights(self, fp)
Method to find weighted timestamps indices corresponding to a given time.
panel
A RobotPanel if one is active or None.
def Activated(self)
Method used as a callback when the toolbar button or the menu item is clicked.
def __init__(self, fp)
Initialization method for RobRotationProxy.
frame_color_y
A SoPackedColor green color for an Y axis.
labels
A list of SoSwitches containing colored translated labels.
def makeLabels(self)
Method which makes Coin3D labels to be displayed in the FreeCAD View.
label_texts
A list of SoText2s labels denoting all axes and an origin.
def makeFrame(self, frame_labels)
Method which makes a Coin3D frame to show a current pose in a RobRotation.
Proxy class for Gui.ViewProviderDocumentObject RobRotation.ViewObject.
def __init__(self, vp)
Initialization method for ViewProviderRobRotationProxy.
Proxy class for a DocumentObjectGroupPython RobRotation instance.
frame_color_x
A SoPackedColor red color for an X axis.
Class specifying Animate workbench's RobRotation button/command.
frame
A SoSeparator with a coordinate frame made from 3 RGB arrows.
frame_drawstyle
A SoDrawStyle controlling frame axes shaft line width.
visualisations
A SoSwitch with all visualisations (frame & rotation axis).
def onDocumentRestored(self, fp)
Method called when document is restored to make sure everything is as it was.
bool updated
A bool - True if a property was changed by a class and not user.
def setProperties(self, fp)
Method to set properties during initialization or document restoration.
label_translations
A list of SoTranslations moving labels.
def setProperties(self, vp)
Method to hide unused properties.
def is_rotation_property(self, prop)
Method to check that a property describes a rotation.
frame_arrowhead_translation
A SoTranslation moving frame arrowheads.
def setupContextMenu(self, vp, menu)
Method called by the FreeCAD to customize a RobRotation context menu.
Class providing funcionality to a RobRotation panel inside the TaskView.
def IsActive(self)
Method to specify when the toolbar button and the menu item are enabled.
def claimChildren(self)
Method called by FreeCAD to retrieve assigned children.
tf_object2world
A SoTransform transformation from object to world frame.
def GetResources(self)
Method used by FreeCAD to retrieve resources to use for this command.
frame_shaft
A SoLineSet shaft for frame axes.
frame_arrowhead_cone
A SoCone arrowhead cone for frame axes.
def __getstate__(self)
Necessary method to avoid errors when trying to save unserializable objects.
def change_joint_sequence(self, joint_sequence)
Method used to change a RobRotation's joint variable sequence.
def attach(self, vp)
Method called by FreeCAD after initialization to attach Coin3D constructs.
def updateData(self, fp, prop)
Method called after DocumentObjectGroupPython RobRotation was changed.
def onChanged(self, fp, prop)
Method called after DocumentObjectGroupPython RobRotation was changed.
def execute(self, fp)
Method called when recomputing a DocumentObjectGroupPython.