FreeCAD Python
|
TempoVis - helper object to save visibilities of objects before doing some GUI editing, hiding or showing relevant stuff during edit, and then restoring all visibilities after editing. Constructors: TempoVis(document): creates a new TempoVis. Supplying document is mandatory. Objects not belonging to the document can't be modified via TempoVis.
Public Member Functions | |
def | modifyVPProperty (self, doc_obj_or_list, prop_name, new_value) |
def | show (self, doc_obj_or_list) |
def | hide (self, doc_obj_or_list) |
def | get_all_dependent (self, doc_obj) |
def | hide_all_dependent (self, doc_obj) |
def | show_all_dependent (self, doc_obj) |
def | restore_all_dependent (self, doc_obj) |
def | hide_all_dependencies (self, doc_obj) |
def | show_all_dependencies (self, doc_obj) |
def | restore (self) |
def | restoreVPProperty (self, object_or_list, prop_name) |
def | forget (self) |
def | setUnpickable (self, doc_obj_or_list, actual_pick_style=2) |
def | clipPlane (self, doc_obj_or_list, enable, placement, offset=0.02) |
def | sketchClipPlane (self, sketch, enable=None) |
Static Public Member Functions | |
def | is3DObject (obj) |
def | allVisibleObjects (aroundObject) |
|
static |
allVisibleObjects(aroundObject): returns list of objects that have to be toggled invisible for only aroundObject to remain. If a whole container can be made invisible, it is returned, instead of its child objects.
def Mod.Show.TempoVis.TempoVis.clipPlane | ( | self, | |
doc_obj_or_list, | |||
enable, | |||
placement, | |||
offset = 0.02 |
|||
) |
clipPlane(doc_obj_or_list, enable, placement, offset): slices off the object with a clipping plane. doc_obj_or_list: object or list of objects to alter (App) enable: True if you want clipping, False if you want to remove clipping: placement: XY plane of local coordinates of the placement is the clipping plane. The placement must be in document's global coordinate system. offset: shifts the plane. Positive offset reveals more of the object. Implementation detail: uses SoClipPlane node. If viewprovider already has a node of this type as direct child, one is used. Otherwise, new one is created and inserted as the very first node. The node is left, but disabled when tempovis is restoring.
def Mod.Show.TempoVis.TempoVis.forget | ( | self | ) |
forget(): resets TempoVis
def Mod.Show.TempoVis.TempoVis.get_all_dependent | ( | self, | |
doc_obj | |||
) |
get_all_dependent(doc_obj): gets all objects that depend on doc_obj. Containers of the object are excluded from the list.
def Mod.Show.TempoVis.TempoVis.hide | ( | self, | |
doc_obj_or_list | |||
) |
hide(doc_obj_or_list): hides objects (sets their Visibility to False). doc_obj_or_list can be a document object, or a list of document objects
def Mod.Show.TempoVis.TempoVis.hide_all_dependencies | ( | self, | |
doc_obj | |||
) |
hide_all_dependencies(doc_obj): hides all objects that doc_obj depends on (directly and indirectly).
def Mod.Show.TempoVis.TempoVis.hide_all_dependent | ( | self, | |
doc_obj | |||
) |
hide_all_dependent(doc_obj): hides all objects that depend on doc_obj. Groups, Parts and Bodies are not hidden by this.
|
static |
is3DObject(obj): tests if the object has some 3d geometry. TempoVis is made only for objects in 3d view, so all objects that don't pass this check are ignored by TempoVis.
def Mod.Show.TempoVis.TempoVis.modifyVPProperty | ( | self, | |
doc_obj_or_list, | |||
prop_name, | |||
new_value | |||
) |
modifyVPProperty(self, doc_obj_or_list, prop_name, new_value): modifies prop_name property of ViewProvider of doc_obj_or_list, and remembers original value of the property. Original values will be restored upon TempoVis deletion, or call to restore().
def Mod.Show.TempoVis.TempoVis.restore | ( | self | ) |
restore(): restore all ViewProvider properties modified via TempoVis to their original values, and saved camera, if any. Called automatically when instance is destroyed, unless it was called explicitly. Should not raise exceptions.
def Mod.Show.TempoVis.TempoVis.restore_all_dependent | ( | self, | |
doc_obj | |||
) |
show_all_dependent(doc_obj): restores original visibilities of all dependent objects.
def Mod.Show.TempoVis.TempoVis.restoreVPProperty | ( | self, | |
object_or_list, | |||
prop_name | |||
) |
restoreVPProperty(object_or_list, prop_name): restores original values of certain property for certain objects.
def Mod.Show.TempoVis.TempoVis.setUnpickable | ( | self, | |
doc_obj_or_list, | |||
actual_pick_style = 2 |
|||
) |
setUnpickable(doc_obj_or_list, actual_pick_style = 2): sets object unpickable (transparent to clicks). doc_obj_or_list: object or list of objects to alter (App) actual_pick_style: optional parameter, specifying the actual pick style: 0 = regular, 1 = bounding box, 2 (default) = unpickable. Implementation detail: uses SoPickStyle node. If viewprovider already has a node of this type as direct child, one is used. Otherwise, new one is created and inserted as the very first node, and remains there even after restore()/deleting tempovis.
def Mod.Show.TempoVis.TempoVis.show | ( | self, | |
doc_obj_or_list | |||
) |
show(doc_obj_or_list): shows objects (sets their Visibility to True). doc_obj_or_list can be a document object, or a list of document objects
def Mod.Show.TempoVis.TempoVis.show_all_dependencies | ( | self, | |
doc_obj | |||
) |
show_all_dependencies(doc_obj): shows all objects that doc_obj depends on (directly and indirectly). This method is probably useless.
def Mod.Show.TempoVis.TempoVis.show_all_dependent | ( | self, | |
doc_obj | |||
) |
show_all_dependent(doc_obj): shows all objects that depend on doc_obj. This method is probably useless.
def Mod.Show.TempoVis.TempoVis.sketchClipPlane | ( | self, | |
sketch, | |||
enable = None |
|||
) |
sketchClipPlane(sketch, enable = None): Clips all objects by plane of sketch. If enable argument is omitted, calling the routine repeatedly will toggle clipping plane.