Gui: add tags for TempoVis
Tags can be used to identify TV instances in the stack. This is mostly for add-ons, for Part-o-magic in particular, who may want to insert some visibility automation in specific places in the stack.
This commit is contained in:
committed by
Yorik van Havre
parent
d33c7b724c
commit
ec7c18bef3
@@ -285,7 +285,7 @@ class AttachmentEditorTaskPanel(FrozenClass):
|
||||
self.updatePreview()
|
||||
self.updateRefButtons()
|
||||
|
||||
self.tv = TempoVis(self.obj.Document)
|
||||
self.tv = TempoVis(self.obj.Document, tag= "PartGui.TaskAttachmentEditor")
|
||||
if self.tv: # tv will still be None if Show module is unavailable
|
||||
self.tv.hide_all_dependent(self.obj)
|
||||
self.tv.show(self.obj)
|
||||
|
||||
@@ -186,7 +186,7 @@ void DlgExtrusion::on_btnSelectEdge_clicked()
|
||||
try{
|
||||
QString code = QString::fromLatin1(
|
||||
"import Show\n"
|
||||
"tv = Show.TempoVis(App.ActiveDocument)\n"
|
||||
"tv = Show.TempoVis(App.ActiveDocument, tag= 'PartGui::DlgExtrusion')\n"
|
||||
"tv.hide([%1])"
|
||||
);
|
||||
std::vector<App::DocumentObject*>sources = getShapesToExtrude();
|
||||
|
||||
@@ -953,7 +953,7 @@ void TaskAttacher::visibilityAutomation(bool opening_not_closing)
|
||||
try{
|
||||
QString code = QString::fromLatin1(
|
||||
"import Show\n"
|
||||
"tv = Show.TempoVis(App.ActiveDocument)\n"
|
||||
"tv = Show.TempoVis(App.ActiveDocument, tag= 'PartGui::TaskAttacher')\n"
|
||||
"tvObj = %1\n"
|
||||
"dep_features = tv.get_all_dependent(%2, '%3')\n"
|
||||
"if tvObj.isDerivedFrom('PartDesign::CoordinateSystem'):\n"
|
||||
|
||||
@@ -5668,7 +5668,7 @@ bool ViewProviderSketch::setEdit(int ModNum)
|
||||
try{
|
||||
QString cmdstr = QString::fromLatin1(
|
||||
"ActiveSketch = App.getDocument('%1').getObject('%2')\n"
|
||||
"tv = Show.TempoVis(App.ActiveDocument)\n"
|
||||
"tv = Show.TempoVis(App.ActiveDocument, tag= ActiveSketch.ViewObject.TypeId)\n"
|
||||
"if ActiveSketch.ViewObject.EditingWorkbench:\n"
|
||||
" tv.activateWorkbench(ActiveSketch.ViewObject.EditingWorkbench)\n"
|
||||
"if ActiveSketch.ViewObject.HideDependent:\n"
|
||||
|
||||
Reference in New Issue
Block a user