40 PATH_TO_ICONS = path.join(FreeCAD.getHomePath(),
"Mod",
"Animate",
"Resources",
71 def __init__(self, fp, shape=None, cause1=None, cause2=None):
74 if cause1
is not None and cause2
is not None:
75 fp.Label = cause1.Label +
" x " + cause2.Label
91 fp.ViewObject.Proxy.setProperties(
105 if not hasattr(fp,
"CausedBy"):
107 "App::PropertyLinkList",
"CausedBy",
"Collision",
108 "Objects that made this collision").CausedBy = [cause1, cause2]
109 if not hasattr(fp,
"Volume"):
111 "App::PropertyVolume",
"Volume",
"Collision",
112 "Overlapping volume of interfering objects." 113 ).Volume = fp.Shape.Volume
115 fp.setEditorMode(
"Placement", 1)
116 fp.setEditorMode(
"CausedBy", 1)
117 fp.setEditorMode(
"Volume", 1)
118 fp.setEditorMode(
"Label", 1)
122 fp.__dict__[
"ViewObject"] = fp.ViewObject
156 color = (1.0, 0.0, 0.0)
157 vp.LineColor = vp.PointColor = vp.ShapeColor = color
200 return path.join(PATH_TO_ICONS,
"Collision.png")
212 vp.setEditorMode(
"AngularDeflection", 2)
213 vp.setEditorMode(
"BoundingBox", 2)
214 vp.setEditorMode(
"Deviation", 2)
215 vp.setEditorMode(
"DisplayMode", 2)
216 vp.setEditorMode(
"DrawStyle", 2)
217 vp.setEditorMode(
"Lighting", 2)
218 vp.setEditorMode(
"LineColor", 2)
219 vp.setEditorMode(
"LineWidth", 2)
220 vp.setEditorMode(
"PointColor", 2)
221 vp.setEditorMode(
"PointSize", 2)
222 vp.setEditorMode(
"Selectable", 2)
223 vp.setEditorMode(
"SelectionStyle", 2)
224 vp.setEditorMode(
"ShapeColor", 2)
def onDocumentRestored(self, fp)
Method called when document is restored to make sure everything is as it was.
def doubleClicked(self, vp)
Method called when CollisionDetector is double-clicked in the Tree View.
def __init__(self, vp, color=None)
Initialization method for ViewProviderCollisionProxy.
Proxy class for a FeaturePython Collision instance.
def __init__(self, fp, shape=None, cause1=None, cause2=None)
Initialization method for CollisionProxy.
Proxy class for a Gui.ViewProviderDocumentObject Collision.ViewObject.
def setupContextMenu(self, vp, menu)
Method editing a context menu for right click on a Collision.
def setProperties(self, vp)
Method to hide unused properties.
def setProperties(self, fp, cause1=None, cause2=None)
Method to set properties during initialization or document restoration.
def getIcon(self)
Method used to get a path to an icon which will appear in the tree view.