Tree view optimization

This commit is contained in:
DeepSOIC 2015-10-18 00:31:04 +03:00
parent ebdd365619
commit bb90c235af
2 changed files with 10 additions and 1 deletions

View File

@ -169,7 +169,14 @@ class _ViewProviderCompoundFilter:
def __setstate__(self,state):
return None
def claimChildren(self):
children = [self.Object.Base]
if self.Object.Stencil:
children.append(self.Object.Stencil)
return children
def CreateCompoundFilter(name):
sel = FreeCADGui.Selection.getSelection()
FreeCAD.ActiveDocument.openTransaction("Create CompoundFilter")
FreeCADGui.addModule("CompoundFilter")
FreeCADGui.doCommand("f = CompoundFilter.makeCompoundFilter(name = '"+name+"')")
@ -181,7 +188,6 @@ def CreateCompoundFilter(name):
FreeCADGui.doCommand("f.FilterType = 'window-volume'")
FreeCADGui.doCommand("f.Proxy.execute(f)")
FreeCADGui.doCommand("f.purgeTouched()")
FreeCADGui.doCommand("f.Base.ViewObject.hide()")
FreeCADGui.doCommand("f = None")
FreeCAD.ActiveDocument.commitTransaction()

View File

@ -90,6 +90,9 @@ class _ViewProviderFuseCompound:
def __setstate__(self,state):
return None
def claimChildren(self):
return [self.Object.Base]
def CreateFuseCompound(name):
FreeCAD.ActiveDocument.openTransaction("Create FuseCompound")
FreeCADGui.addModule("FuseCompound")