Proxy class for a Gui.ViewProviderDocumentObject
Collision.ViewObject.
More...
Public Member Functions | |
def | __init__ (self, vp, color=None) |
Initialization method for ViewProviderCollisionProxy. More... | |
def | doubleClicked (self, vp) |
Method called when CollisionDetector is double-clicked in the Tree View. More... | |
def | setupContextMenu (self, vp, menu) |
Method editing a context menu for right click on a Collision. More... | |
def | getIcon (self) |
Method used to get a path to an icon which will appear in the tree view. More... | |
def | setProperties (self, vp) |
Method to hide unused properties. More... | |
Proxy class for a Gui.ViewProviderDocumentObject
Collision.ViewObject.
A ViewProviderServerProxy instance changes a FeaturePython
Collision's icon. It prevents user from transforming a Collision
object after double-clicking it in the Tree View. It also removes options to Transform and Set colors... from a context menu.
To connect this Proxy
object to a Gui.ViewProviderDocumentObject
Collision.ViewObject do:
a = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", "Collision") CollisionProxy(a, shape, cause1, cause2)
Definition at line 140 of file CollisionObject.py.
def CollisionObject.ViewProviderCollisionProxy.__init__ | ( | self, | |
vp, | |||
color = None |
|||
) |
Initialization method for ViewProviderCollisionProxy.
A class instance is created and made a Proxy
for a generic Gui.ViewProviderDocumentObject
Collision.ViewObject. This method changes LineColor
, PointColor
, ShapeColor,
LineWidthand
PointSize` properties of a Collision instance and hides unnecessary unused View properties.
vp | A barebone Gui.ViewProviderDocumentObject Collision.ViewObject. |
color | A tuple of floats specifying Point, Line and Shape RGB color. |
Definition at line 154 of file CollisionObject.py.
def CollisionObject.ViewProviderCollisionProxy.doubleClicked | ( | self, | |
vp | |||
) |
Method called when CollisionDetector is double-clicked in the Tree View.
It just prevents user from accessing transformation panel and transforming a Collision
object. It's enough to just implement it and return True
for this purpose.
vp | A double-clicked Collision.ViewObject. |
Definition at line 176 of file CollisionObject.py.
def CollisionObject.ViewProviderCollisionProxy.getIcon | ( | self | ) |
Method used to get a path to an icon which will appear in the tree view.
Definition at line 199 of file CollisionObject.py.
def CollisionObject.ViewProviderCollisionProxy.setProperties | ( | self, | |
vp | |||
) |
Method to hide unused properties.
All unused unnecessary FeaturePython
s properties are hidden except for Transparency
and Visibility
.
vp | A Gui.ViewProviderDocumentObject Collision.ViewObject. |
Definition at line 211 of file CollisionObject.py.
def CollisionObject.ViewProviderCollisionProxy.setupContextMenu | ( | self, | |
vp, | |||
menu | |||
) |
Method editing a context menu for right click on a Collision.
The Transform and Set colors... items are removed from the context menu shown upon right click on the Collision in the Tree View. This is done to prevent user from transforming the Collision
object or changing its color.
vp | A right-clicked Collision.ViewObject. |
menu | A Qt's QMenu to be edited. |
Definition at line 190 of file CollisionObject.py.