CollisionDetector.CollisionDetectorCommand Class Reference

Class specifying Animate workbench's CollisionDetector button/command. More...

Inheritance diagram for CollisionDetector.CollisionDetectorCommand:

Public Member Functions

def GetResources (self)
 Method used by FreeCAD to retrieve resources to use for this command. More...
 
def Activated (self)
 Method used as a callback when the toolbar button or the menu item is clicked. More...
 
def IsActive (self)
 Method to specify when the toolbar button and the menu item are enabled. More...
 

Detailed Description

Class specifying Animate workbench's CollisionDetector button/command.

This class provides resources for a toolbar button and a menu button. It controls their behaivor(Active/Inactive) and responds to callbacks after either of them was clicked(Activated).

Definition at line 944 of file CollisionDetector.py.

Member Function Documentation

◆ Activated()

def CollisionDetector.CollisionDetectorCommand.Activated (   self)

Method used as a callback when the toolbar button or the menu item is clicked.

This method creates a CollisionDetector instance in currently active document. Afterwards it adds a CollisionDetectorProxy as a Proxy to this instance as well as ViewProviderCollisionDetectorProxy to its ViewObject.Proxy, if FreeCAD runs in the Graphic mode.

Definition at line 967 of file CollisionDetector.py.

967  def Activated(self):
968  doc = FreeCAD.ActiveDocument
969  a = doc.addObject("App::DocumentObjectGroupPython",
970  "CollisionDetector")
971  CollisionDetectorProxy(a)
972  if FreeCAD.GuiUp:
973  ViewProviderCollisionDetectorProxy(a.ViewObject)
974  doc.recompute()
975  return
976 
def Activated(self)
Method used as a callback when the toolbar button or the menu item is clicked.
Definition: Trajectory.py:1575

◆ GetResources()

def CollisionDetector.CollisionDetectorCommand.GetResources (   self)

Method used by FreeCAD to retrieve resources to use for this command.

Returns
A dict with items PixMap, MenuText and ToolTip which contain a path to a command icon, a text to be shown in a menu and a tooltip message.

Definition at line 954 of file CollisionDetector.py.

954  def GetResources(self):
955  return {'Pixmap': path.join(PATH_TO_ICONS, "CollisionDetectorCmd.png"),
956  'MenuText': "CollisionDetector",
957  'ToolTip': "Create CollisionDetector instance."}
958 
def GetResources(self)
Method used by FreeCAD to retrieve resources to use for this command.
Definition: Trajectory.py:1562

◆ IsActive()

def CollisionDetector.CollisionDetectorCommand.IsActive (   self)

Method to specify when the toolbar button and the menu item are enabled.

The toolbar button CollisionDetector and menu item CollisionDetector are set to be active only when there is an active document in which a CollisionDetector instance can be created.

Returns
True if buttons shall be enabled and False otherwise.

Definition at line 987 of file CollisionDetector.py.

987  def IsActive(self):
988  if FreeCAD.ActiveDocument is None:
989  return False
990  else:
991  return True
992 
993 
def IsActive(self)
Method to specify when the toolbar button and the menu item are enabled.
Definition: Trajectory.py:1594

The documentation for this class was generated from the following file: