Arch: update some functions that come from the Draft workbench

In particular `getGroupContents` was renamed to `get_group_contents`
in the Draft workbench, so the function name is updated accordingly.
This commit is contained in:
vocx-fc
2020-06-28 13:35:19 -05:00
committed by Yorik van Havre
parent d61fa25f43
commit c97d13164e
11 changed files with 35 additions and 24 deletions

View File

@@ -444,7 +444,7 @@ class BuildingPart(ArchIFC.IfcProduct):
"recursively get the shapes of objects inside this BuildingPart"
shapes = []
for child in Draft.getGroupContents(obj):
for child in Draft.get_group_contents(obj):
if hasattr(child,'Shape'):
shapes.extend(child.Shape.Faces)
return shapes
@@ -653,7 +653,7 @@ class ViewProviderBuildingPart:
"recursively get the colors of objects inside this BuildingPart"
colors = []
for child in Draft.getGroupContents(obj):
for child in Draft.get_group_contents(obj):
if hasattr(child,'Shape') and (hasattr(child.ViewObject,"DiffuseColor") or hasattr(child.ViewObject,"ShapeColor")):
if hasattr(child.ViewObject,"DiffuseColor") and len(child.ViewObject.DiffuseColor) == len(child.Shape.Faces):
colors.extend(child.ViewObject.DiffuseColor)
@@ -739,7 +739,8 @@ class ViewProviderBuildingPart:
if self.clip:
sg.removeChild(self.clip)
self.clip = None
for o in Draft.getGroupContents(vobj.Object.Group,walls=True):
for o in Draft.get_group_contents(vobj.Object.Group,
walls=True):
if hasattr(o.ViewObject,"Lighting"):
o.ViewObject.Lighting = "One side"
self.clip = coin.SoClipPlane()
@@ -764,7 +765,8 @@ class ViewProviderBuildingPart:
if self.clip:
sg.removeChild(self.clip)
self.clip = None
for o in Draft.getGroupContents(vobj.Object.Group,walls=True):
for o in Draft.get_group_contents(vobj.Object.Group,
walls=True):
if hasattr(o.ViewObject,"Lighting"):
o.ViewObject.Lighting = "Two side"
elif prop == "Visibility":
@@ -779,7 +781,7 @@ class ViewProviderBuildingPart:
if self.clip:
sg.removeChild(self.clip)
self.clip = None
for o in Draft.getGroupContents(vobj.Object.Group,walls=True):
for o in Draft.get_group_contents(vobj.Object.Group, walls=True):
if hasattr(o.ViewObject,"Lighting"):
o.ViewObject.Lighting = "Two side"
return True