RobWorld.py
1 # -*- coding: utf-8 -*-
2 
3 # ***************************************************************************
4 # * *
5 # * Animate workbench - FreeCAD Workbench for lightweight animation *
6 # * Copyright (c) 2019 Jiří Valášek jirka362@gmail.com *
7 # * *
8 # * This file is part of the Animate workbench. *
9 # * *
10 # * This program is free software; you can redistribute it and/or modify *
11 # * it under the terms of the GNU Lesser General Public License (LGPL) *
12 # * as published by the Free Software Foundation; either version 2 of *
13 # * the License, or (at your option) any later version. *
14 # * for detail see the LICENCE text file. *
15 # * *
16 # * Animate workbench is distributed in the hope that it will be useful, *
17 # * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 # * GNU Lesser General Public License for more details. *
20 # * *
21 # * You should have received a copy of the GNU Library General Public *
22 # * License along with Animate workbench; if not, write to the Free *
23 # * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
24 # * MA 02111-1307 USA *
25 # * *
26 # ***************************************************************************/
27 
28 
35 
36 import FreeCAD
37 import FreeCADGui
38 
39 from pivy import coin
40 from os import path
41 
42 
43 PATH_TO_ICONS = path.join(FreeCAD.getHomePath(), "Mod", "Animate", "Resources",
44  "Icons")
45 
46 
47 
59 
61 
62 
71 
72  def __init__(self, fp):
73  # Add (and preset) properties
74  self.setProperties(fp)
75  fp.Proxy = self
76 
77 
87 
88  def onChanged(self, fp, prop):
89  if prop == "Placement":
90  # Propagate the Placement updates down the chain
91  if hasattr(fp, "Group") and len(fp.Group) != 0:
92  for child in fp.Group:
93  child.ParentFramePlacement = fp.Placement
94  child.purgeTouched()
95 
96 
104 
105  def execute(self, fp):
106  rotation = FreeCAD.Rotation(fp.AngleYaw, fp.AnglePitch, fp.AngleRoll)
107  rotation_center = FreeCAD.Vector(0, 0, 0)
108  position = FreeCAD.Vector(fp.PositionX, fp.PositionY, fp.PositionZ)
109  fp.Placement = FreeCAD.Placement(position, rotation, rotation_center)
110 
111 
120 
121  def onDocumentRestored(self, fp):
122  fp.ViewObject.Proxy.setProperties(fp.ViewObject)
123  self.setProperties(fp)
124 
125  # supporting methods-------------------------------------------------------
126 
134 
135  def setProperties(self, fp):
136  # Add (and preset) properties
137  # Animation properties
138  if not hasattr(fp, "AllowServer"):
139  fp.addProperty("App::PropertyBool", "AllowServer", "General",
140  "Should this object allow a Server object to "
141  + "change it.").AllowServer = True
142 
143  # Frame Placement
144  if not hasattr(fp, "PositionX"):
145  fp.addProperty("App::PropertyFloat", "PositionX", "FramePlacement",
146  "X position of the world frame.").PositionX = 0
147  if not hasattr(fp, "PositionY"):
148  fp.addProperty("App::PropertyFloat", "PositionY", "FramePlacement",
149  "Y position of the world frame.").PositionY = 0
150  if not hasattr(fp, "PositionZ"):
151  fp.addProperty("App::PropertyFloat", "PositionZ", "FramePlacement",
152  "Z position of the world frame.").PositionZ = 0
153  if not hasattr(fp, "AngleYaw"):
154  fp.addProperty("App::PropertyFloat", "AngleYaw", "FramePlacement",
155  "Yaw angle (rotation about Z axis) of the world"
156  + " frame in degrees.").AngleYaw = 0
157  if not hasattr(fp, "AnglePitch"):
158  fp.addProperty("App::PropertyFloat", "AnglePitch",
159  "FramePlacement", "Pitch angle (rotation about Y"
160  + " axis) of the world frame in degrees."
161  ).AnglePitch = 0
162  if not hasattr(fp, "AngleRoll"):
163  fp.addProperty("App::PropertyFloat", "AngleRoll", "FramePlacement",
164  "Roll angle (rotation about X axis) of the world"
165  + " frame in degrees.").AngleRoll = 0
166 
167  # Frame properties
168  if not hasattr(fp, "ShowFrame"):
169  fp.addProperty("App::PropertyBool", "ShowFrame", "Frame",
170  "Show a frame for current pose."
171  ).ShowFrame = True
172  if not hasattr(fp, "FrameTransparency"):
173  fp.addProperty("App::PropertyPercent", "FrameTransparency",
174  "Frame", "Transparency of the frame in percents."
175  ).FrameTransparency = 0
176  if not hasattr(fp, "ShowFrameArrowheads"):
177  fp.addProperty("App::PropertyBool", "ShowFrameArrowheads", "Frame",
178  "Show arrowheads for frame axis arrow's."
179  ).ShowFrameArrowheads = True
180  if not hasattr(fp, "FrameArrowheadLength"):
181  fp.addProperty("App::PropertyFloatConstraint",
182  "FrameArrowheadLength", "Frame",
183  "Frame axis arrow's arrowhead length.\n"
184  + "Range is < 1.0 | 1e6 >."
185  ).FrameArrowheadLength = (10, 1.0, 1e6, 1)
186  else:
187  fp.FrameArrowheadLength = (fp.FrameArrowheadLength, 1.0, 1e6, 1)
188  if not hasattr(fp, "FrameArrowheadRadius"):
189  fp.addProperty("App::PropertyFloatConstraint",
190  "FrameArrowheadRadius", "Frame",
191  "Frame axis arrow's arrowhead bottom radius.\n"
192  + "Range is < 0.5 | 1e6 >."
193  ).FrameArrowheadRadius = (5, 0.5, 1e6, 0.5)
194  else:
195  fp.FrameArrowheadRadius = (fp.FrameArrowheadRadius, 0.5, 1e6, 0.5)
196  if not hasattr(fp, "ShaftLength"):
197  fp.addProperty("App::PropertyFloatConstraint", "ShaftLength",
198  "Frame", "Frame axis arrow's shaft length.\n"
199  + "Range is < 1.0 | 1e6 >."
200  ).ShaftLength = (20, 1.0, 1e6, 1)
201  else:
202  fp.ShaftLength = (fp.ShaftLength, 1.0, 1e6, 1)
203  if not hasattr(fp, "ShaftWidth"):
204  fp.addProperty("App::PropertyFloatConstraint", "ShaftWidth",
205  "Frame", "Frame axis arrow's shaft width.\n"
206  + "Range is < 1.0 | 64 >."
207  ).ShaftWidth = (4, 1.0, 64, 1)
208  else:
209  fp.ShaftWidth = (fp.ShaftWidth, 1.0, 64, 1)
210  if not hasattr(fp, "ShowFrameLabels"):
211  fp.addProperty("App::PropertyBool", "ShowFrameLabels",
212  "Frame", "Show label for frame axes."
213  ).ShowFrameLabels = True
214 
215  # Label properties
216  if not hasattr(fp, "FontSize"):
217  fp.addProperty("App::PropertyIntegerConstraint", "FontSize",
218  "Labels", "Label font size.\n"
219  + "Range is < 1 | 100 >."
220  ).FontSize = (10, 1, 100, 1)
221  else:
222  fp.FontSize = (fp.FontSize, 1, 100, 1)
223  if not hasattr(fp, "DistanceToAxis"):
224  fp.addProperty("App::PropertyFloatConstraint", "DistanceToAxis",
225  "Labels", "Distance from label to its axis.\n"
226  + "Range is < 0.5 | 1e6 >."
227  ).DistanceToAxis = (5, 0.5, 1e6, 0.5)
228  else:
229  fp.DistanceToAxis = (fp.DistanceToAxis, 0.5, 1e6, 0.5)
230  if not hasattr(fp, "Subscription"):
231  fp.addProperty("App::PropertyString", "Subscription", "Labels",
232  "Subscription added to an axis name."
233  ).Subscription = ""
234  if not hasattr(fp, "Superscription"):
235  fp.addProperty("App::PropertyString", "Superscription", "Labels",
236  "Superscription added to an axis name."
237  ).Superscription = ""
238  if not hasattr(fp, "FontFamily"):
239  fp.addProperty("App::PropertyEnumeration", "FontFamily",
240  "Labels", "Label font family."
241  ).FontFamily = ["SERIF", "SANS", "TYPEWRITER"]
242  if not hasattr(fp, "FontStyle"):
243  fp.addProperty("App::PropertyEnumeration", "FontStyle",
244  "Labels", "Label font style."
245  ).FontStyle = ["NONE", "BOLD", "ITALIC",
246  "BOLD ITALIC"]
247 
248  # Placement properties
249  if not hasattr(fp, "Placement"):
250  fp.addProperty("App::PropertyPlacement", "Placement", "Base",
251  "Current placement for animated objects in "
252  + "world frame.")
253 
254  # Hide some properties
255  fp.setEditorMode("Placement", 2)
256 
257  import AnimateDocumentObserver
259 
260 
261 
276 
278 
279 
281 
282 
284 
285 
287 
288 
290 
291 
293 
294 
296 
297 
299 
300 
302 
303 
305 
306 
308 
309 
311 
312 
314 
315 
317 
318 
320 
321 
323 
324 
326 
327 
329 
330  panel = None
331  fp = None
332 
333  # standard methods---------------------------------------------------------
334 
343 
344  def __init__(self, vp):
345  self.setProperties(vp)
346  vp.Proxy = self
347 
348 
357 
358  def attach(self, vp):
359  # prepare transformation to keep pose corresponding to placement
360  self.tf_object2world = coin.SoTransform()
361 
362  labels = self.makeLabels()
363  self.font = coin.SoFontStyle()
364 
365  frame = self.makeFrame(labels[:3])
366  frame.insertChild(self.tf_object2world, 0)
367  frame.insertChild(self.font, 1)
368  self.frame = coin.SoSwitch()
369  self.frame.addChild(frame)
370 
371  self.visualisations = coin.SoSwitch()
372  self.visualisations.addChild(self.frame)
373  self.visualisations.whichChild.setValue(coin.SO_SWITCH_ALL)
374  vp.RootNode.addChild(self.visualisations)
375 
376  vp.Object.Proxy.setProperties(vp.Object)
377  self.setProperties(vp)
378  self.fp = vp.Object
379 
380 
390 
391  def updateData(self, fp, prop):
392  # Placement changes
393  if prop == "Placement" and hasattr(fp, "Placement"):
394  trans = fp.Placement.Base
395  rot = fp.Placement.Rotation
396  self.tf_object2world.translation.setValue((trans.x, trans.y,
397  trans.z))
398  self.tf_object2world.rotation.setValue(rot.Q)
399 
400  # Frame changes
401  elif prop == "ShowFrame" and hasattr(fp, "ShowFrame"):
402  if fp.ShowFrame:
403  self.frame.whichChild.setValue(coin.SO_SWITCH_ALL)
404  else:
405  self.frame.whichChild.setValue(coin.SO_SWITCH_NONE)
406 
407  elif prop == "FrameTransparency" and hasattr(fp, "FrameTransparency"):
408  self.frame_color_x.orderedRGBA.\
409  setValue(0xff0000ff - (0xff*fp.FrameTransparency)//100)
410  self.frame_color_y.orderedRGBA.\
411  setValue(0x00ff00ff - (0xff*fp.FrameTransparency)//100)
412  self.frame_color_z.orderedRGBA.\
413  setValue(0x0000ffff - (0xff*fp.FrameTransparency)//100)
414 
415  elif prop == "ShaftLength" and hasattr(fp, "ShaftLength"):
416  self.frame_shaft.vertexProperty.getValue().vertex.\
417  set1Value(1, 0, fp.ShaftLength, 0)
418  if hasattr(fp, "FrameArrowheadLength"):
419  self.frame_arrowhead_translation.translation.setValue(
420  0, fp.ShaftLength + fp.FrameArrowheadLength/2, 0)
421  if not fp.ShowFrameArrowheads and hasattr(fp, "DistanceToAxis"):
422  self.label_translations[0].translation.setValue(
423  0, fp.ShaftLength + fp.DistanceToAxis, 0)
424 
425  elif prop == "FrameArrowheadLength" and \
426  hasattr(fp, "FrameArrowheadLength"):
427  self.frame_arrowhead_cone.height.setValue(fp.FrameArrowheadLength)
428  if hasattr(fp, "ShaftLength"):
429  self.frame_arrowhead_translation.translation.setValue(
430  0, fp.ShaftLength + fp.FrameArrowheadLength/2, 0)
431  if fp.ShowFrameArrowheads and hasattr(fp, "DistanceToAxis"):
432  self.label_translations[0].translation.setValue(
433  0, fp.FrameArrowheadLength/2 + fp.DistanceToAxis, 0)
434 
435  elif prop == "ShaftWidth" and hasattr(fp, "ShaftWidth"):
436  self.frame_drawstyle.lineWidth.setValue(fp.ShaftWidth)
437 
438  elif prop == "FrameArrowheadRadius" and \
439  hasattr(fp, "FrameArrowheadRadius"):
440  self.frame_arrowhead_cone.bottomRadius.setValue(
441  fp.FrameArrowheadRadius)
442 
443  elif prop == "ShowFrameArrowheads" and \
444  hasattr(fp, "ShowFrameArrowheads"):
445  if fp.ShowFrameArrowheads:
446  self.frame_arrowhead.whichChild.setValue(coin.SO_SWITCH_ALL)
447  if hasattr(fp, "FrameArrowheadLength") and \
448  hasattr(fp, "DistanceToAxis"):
449  self.label_translations[0].translation.setValue(
450  0, fp.FrameArrowheadLength/2 + fp.DistanceToAxis, 0)
451  else:
452  self.frame_arrowhead.whichChild.setValue(coin.SO_SWITCH_NONE)
453  if hasattr(fp, "ShaftLength") and \
454  hasattr(fp, "DistanceToAxis"):
455  self.label_translations[0].translation.setValue(
456  0, fp.ShaftLength + fp.DistanceToAxis, 0)
457 
458  elif prop == "ShowFrameLabels" and hasattr(fp, "ShowFrameLabels"):
459  for label in self.labels[:3]:
460  if fp.ShowFrameLabels:
461  label.whichChild.setValue(coin.SO_SWITCH_ALL)
462  else:
463  label.whichChild.setValue(coin.SO_SWITCH_NONE)
464 
465  # Changes to the labels
466  elif prop == "Subscription" and hasattr(fp, "Subscription"):
467  for l in self.label_texts:
468  l.string.setValues(2, 1, [fp.Subscription])
469 
470  elif prop == "Superscription" and hasattr(fp, "Superscription"):
471  for l in self.label_texts:
472  l.string.setValues(0, 1, [fp.Superscription])
473 
474  elif prop == "FontFamily" and hasattr(fp, "FontFamily"):
475  if fp.FontFamily == "SERIF":
476  self.font.family.setValue(self.font.SERIF)
477  if fp.FontFamily == "SANS":
478  self.font.family.setValue(self.font.SANS)
479  if fp.FontFamily == "TYPEWRITER":
480  self.font.family.setValue(self.font.TYPEWRITER)
481 
482  elif prop == "FontStyle" and hasattr(fp, "FontStyle"):
483  if fp.FontStyle == "NONE":
484  self.font.style.setValue(self.font.NONE)
485  if fp.FontStyle == "BOLD":
486  self.font.style.setValue(self.font.BOLD)
487  if fp.FontStyle == "ITALIC":
488  self.font.style.setValue(self.font.ITALIC)
489  if fp.FontStyle == "BOLD ITALIC":
490  self.font.style.setValue(self.font.BOLD | self.font.ITALIC)
491 
492  elif prop == "FontSize" and hasattr(fp, "FontSize"):
493  self.font.size.setValue(fp.FontSize)
494 
495  elif prop == "DistanceToAxis" and hasattr(fp, "DistanceToAxis") and \
496  hasattr(fp, "ShowFrameArrowheads"):
497  if fp.ShowFrameArrowheads and hasattr(fp, "FrameArrowheadLength"):
498  self.label_translations[0].translation.setValue(
499  0, fp.FrameArrowheadLength/2 + fp.DistanceToAxis, 0)
500  elif hasattr(fp, "ShaftLength"):
501  self.label_translations[0].translation.setValue(
502  0, fp.ShaftLength + fp.DistanceToAxis, 0)
503 
504 
513 
514  def onChanged(self, vp, prop):
515  if prop == "Visibility":
516  if vp.Visibility:
517  self.visualisations.whichChild.setValue(coin.SO_SWITCH_ALL)
518  else:
519  self.visualisations.whichChild.setValue(coin.SO_SWITCH_NONE)
520 
521 
529 
530  def claimChildren(self):
531  if hasattr(self, "fp") and self.fp:
532  return self.fp.Group
533  return []
534 
535 
543 
544  def canDropObject(self, obj):
545  if hasattr(obj, "Proxy") and \
546  (obj.Proxy.__class__.__name__ == "RobRotationProxy" or
547  obj.Proxy.__class__.__name__ == "RobTranslationProxy"):
548  return True
549  return False
550 
551 
558 
559  def getIcon(self):
560  return path.join(PATH_TO_ICONS, "RobWorld.png")
561 
562 
574 
575  def __getstate__(self):
576  return None
577 
578 
584 
585  def __setstate__(self, state):
586  pass
587 
588 
595 
596  def setProperties(self, vp):
597  # hide unnecessary view properties
598  vp.setEditorMode("DisplayMode", 2)
599 
600 
611 
612  def doubleClicked(self, vp):
613  return True
614 
615 
625 
626  def setupContextMenu(self, vp, menu):
627  menu.clear()
628 
629 
637 
638  def makeLabels(self):
639  label_strings = ["X", "Y", "Z"]
640  colors = [0xFF0000FF, 0x00FF00FF, 0x0000FFFF]
641  self.label_texts = []
643  # frame translation
644  self.label_translations.append(coin.SoTranslation())
645  # axis translation
646  self.label_translations.append(coin.SoTranslation())
647  self.labels = []
648  for i in range(3):
649  label_group = coin.SoSeparator()
650  label_group.addChild(self.label_translations[0])
651  frame_axis_color = coin.SoPackedColor()
652  frame_axis_color.orderedRGBA.setValue(colors[i])
653  label_group.addChild(frame_axis_color)
654  self.label_texts.append(coin.SoText2())
655  self.label_texts[i].string.setValues(
656  0, 3, ["", label_strings[i], ""])
657  self.label_texts[i].justification.setValue(
658  self.label_texts[i].CENTER)
659  self.label_texts[i].spacing.setValue(0.45)
660  label_group.addChild(self.label_texts[i])
661  self.labels.append(coin.SoSwitch())
662  self.labels[i].addChild(label_group)
663  return self.labels
664 
665 
675 
676  def makeFrame(self, frame_labels):
677  # make a generic shaft from 0 in Y direction
678  shaft_vertices = coin.SoVertexProperty()
679  shaft_vertices.vertex.setNum(2)
680  shaft_vertices.vertex.set1Value(0, 0, 0, 0)
681  self.frame_shaft = coin.SoLineSet()
682  self.frame_shaft.vertexProperty.setValue(shaft_vertices)
683  self.frame_shaft.numVertices.setNum(1)
684  self.frame_shaft.numVertices.setValue(2)
685 
686  # make a generic conic arrowhead oriented in Y axis direction and
687  # move it at the end of the shaft
688  self.frame_arrowhead_translation = coin.SoTranslation()
689  self.frame_arrowhead_cone = coin.SoCone()
690  self.frame_arrowhead = coin.SoSwitch()
691  self.frame_arrowhead.addChild(self.frame_arrowhead_translation)
692  self.frame_arrowhead.addChild(self.frame_arrowhead_cone)
693 
694  # make rotations to rotate prepared shaft and arrowhead for Y axis
695  # direction also to X and Z
696  rot_y2x = coin.SoRotation()
697  rot_y2x.rotation.setValue(coin.SbRotation(coin.SbVec3f(0, 1, 0),
698  coin.SbVec3f(1, 0, 0)))
699  rot_y2z = coin.SoRotation()
700  rot_y2z.rotation.setValue(coin.SbRotation(coin.SbVec3f(0, 1, 0),
701  coin.SbVec3f(0, 0, 1)))
702 
703  # prepare colors for X,Y,Z which will correspond to R,G,B as customary
704  self.frame_color_x = coin.SoPackedColor()
705  self.frame_color_y = coin.SoPackedColor()
706  self.frame_color_z = coin.SoPackedColor()
707 
708  # make complete colored and rotated arrows
709  x_arrow = coin.SoSeparator()
710  x_arrow.addChild(rot_y2x)
711  x_arrow.addChild(self.frame_color_x)
712  x_arrow.addChild(self.frame_shaft)
713  x_arrow.addChild(self.frame_arrowhead)
714  x_arrow.addChild(frame_labels[0])
715  y_arrow = coin.SoSeparator()
716  y_arrow.addChild(self.frame_color_y)
717  y_arrow.addChild(self.frame_shaft)
718  y_arrow.addChild(self.frame_arrowhead)
719  y_arrow.addChild(frame_labels[1])
720  z_arrow = coin.SoSeparator()
721  z_arrow.addChild(rot_y2z)
722  z_arrow.addChild(self.frame_color_z)
723  z_arrow.addChild(self.frame_shaft)
724  z_arrow.addChild(self.frame_arrowhead)
725  z_arrow.addChild(frame_labels[2])
726 
727  # prepare draw style to control shaft width
728  self.frame_drawstyle = coin.SoDrawStyle()
729 
730  # make complete frame and it to shaded display mode
731  separated_frame = coin.SoSeparator()
732  separated_frame.addChild(self.frame_drawstyle)
733  separated_frame.addChild(x_arrow)
734  separated_frame.addChild(y_arrow)
735  separated_frame.addChild(z_arrow)
736 
737  return separated_frame
738 
739 
740 
746 
747 class RobWorldCommand(object):
748 
749 
756 
757  def GetResources(self):
758  return {'Pixmap': path.join(PATH_TO_ICONS, "RobWorldCmd.png"),
759  'MenuText': "RobWorld",
760  'ToolTip': "Create RobWorld instance."}
761 
762 
769 
770  def Activated(self):
771  doc = FreeCAD.ActiveDocument
772  a = doc.addObject("App::DocumentObjectGroupPython", "RobWorld")
773  RobWorldProxy(a)
774  if FreeCAD.GuiUp:
775  ViewProviderRobWorldProxy(a.ViewObject)
776  doc.recompute()
777  return
778 
779 
788 
789  def IsActive(self):
790  if FreeCAD.ActiveDocument is None:
791  return False
792  else:
793  return True
794 
795 
796 if FreeCAD.GuiUp:
797  # Add command to FreeCAD Gui when importing this module in InitGui
798  FreeCADGui.addCommand('RobWorldCommand', RobWorldCommand())
def __init__(self, fp)
Initialization method for RobWorldProxy.
Definition: RobWorld.py:72
Proxy class for a DocumentObjectGroupPython RobWorld instance.
Definition: RobWorld.py:60
def attach(self, vp)
Method called by FreeCAD after initialization to attach Coin3D constructs.
Definition: RobWorld.py:358
frame_color_x
A SoPackedColor red color for an X axis.
Definition: RobWorld.py:704
def Activated(self)
Method used as a callback when the toolbar button or the menu item is clicked.
Definition: RobWorld.py:770
def doubleClicked(self, vp)
Method called by FreeCAD when RobWorld is double-clicked in the Tree View.
Definition: RobWorld.py:612
def addObserver()
Adds an AnimateDocumentObserver between FreeCAD's document observers safely.
labels
A list of SoSwitches containing colored translated labels.
Definition: RobWorld.py:647
def onChanged(self, vp, prop)
Method called after RobWorld.ViewObject was changed.
Definition: RobWorld.py:514
def execute(self, fp)
Method called when recomputing a DocumentObjectGroupPython.
Definition: RobWorld.py:105
def __setstate__(self, state)
Necessary method to avoid errors when trying to restore unserializable objects.
Definition: RobWorld.py:585
Proxy class for Gui.ViewProviderDocumentObject RobWorld.ViewObject.
Definition: RobWorld.py:277
def makeFrame(self, frame_labels)
Method which makes a Coin3D frame to show a current pose in a RobWorld.
Definition: RobWorld.py:676
def onDocumentRestored(self, fp)
Method called when document is restored to make sure everything is as it was.
Definition: RobWorld.py:121
def makeLabels(self)
Method which makes Coin3D labels to be displayed in the FreeCAD View.
Definition: RobWorld.py:638
frame_color_y
A SoPackedColor green color for an Y axis.
Definition: RobWorld.py:705
visualisations
A SoSwitch with all visualisations (frame & rotation axis).
Definition: RobWorld.py:371
def onChanged(self, fp, prop)
Method called after DocumentObjectGroupPython RobWorld was changed.
Definition: RobWorld.py:88
label_texts
A list of SoText2s labels denoting all axes and an origin.
Definition: RobWorld.py:641
def __init__(self, vp)
Initialization method for ViewProviderRobWorldProxy.
Definition: RobWorld.py:344
tf_object2world
A SoTransform transformation from object to world frame.
Definition: RobWorld.py:360
def updateData(self, fp, prop)
Method called after DocumentObjectGroupPython RobWorld was changed.
Definition: RobWorld.py:391
def setProperties(self, fp)
Method to set properties during initialization or document restoration.
Definition: RobWorld.py:135
def getIcon(self)
Method called by FreeCAD to supply an icon for the Tree View.
Definition: RobWorld.py:559
def claimChildren(self)
Method called by FreeCAD to retrieve assigned children.
Definition: RobWorld.py:530
def __getstate__(self)
Necessary method to avoid errors when trying to save unserializable objects.
Definition: RobWorld.py:575
def canDropObject(self, obj)
Method called by FreeCAD to ask if an object obj can be dropped into a Group.
Definition: RobWorld.py:544
frame
A SoSeparator with a coordinate frame made from 3 RGB arrows.
Definition: RobWorld.py:368
def setupContextMenu(self, vp, menu)
Method called by the FreeCAD to customize a context menu for a RobWorld.
Definition: RobWorld.py:626
def GetResources(self)
Method used by FreeCAD to retrieve resources to use for this command.
Definition: RobWorld.py:757
def IsActive(self)
Method to specify when the toolbar button and the menu item are enabled.
Definition: RobWorld.py:789
frame_arrowhead_translation
A SoTranslation moving frame arrowheads.
Definition: RobWorld.py:688
Class specifying Animate workbench's RobWorld button/command.
Definition: RobWorld.py:747
frame_shaft
A SoLineSet shaft for frame axes.
Definition: RobWorld.py:681
frame_color_z
A SoPackedColor blue color for an Z axis.
Definition: RobWorld.py:706
frame_arrowhead_cone
A SoCone arrowhead cone for frame axes.
Definition: RobWorld.py:689
frame_arrowhead
A SoSwitch translated cone for frame axes.
Definition: RobWorld.py:690
label_translations
A list of SoTranslations moving labels.
Definition: RobWorld.py:642
frame_drawstyle
A SoDrawStyle controlling frame axes shaft line width.
Definition: RobWorld.py:728
def setProperties(self, vp)
Method to hide unused properties.
Definition: RobWorld.py:596
font
A SoFontStyle font for axes labels.
Definition: RobWorld.py:363