Arch: Automatic wall height - fixes #980

+ Walls can now be capped by roofs, by subtracting a roof from them
+ Walls and Structs with height = 0 take height from their parent floor
+ Changing the placement of a floor changes all the placements of its children
This commit is contained in:
Yorik van Havre
2014-01-14 16:16:04 -02:00
parent e14a9e49d9
commit e352e169da
6 changed files with 72 additions and 48 deletions

View File

@@ -321,6 +321,9 @@ class Component:
if hasattr(obj,prop):
for o in getattr(obj,prop):
if Draft.getType(o) != "Window":
if (Draft.getType(obj) == "Wall"):
if (Draft.getType(o) == "Roof"):
continue
o.ViewObject.hide()
def processSubShapes(self,obj,base,pl=None):
@@ -387,6 +390,13 @@ class Component:
if pl:
f.Placement = f.Placement.multiply(pl)
base = base.cut(f)
elif (Draft.getType(o) == "Roof") or (Draft.isClone(o,"Roof")):
# roofs define their own special subtraction volume
f = o.Proxy.getSubVolume(o)
if f:
if base.Solids and f.Solids:
base = base.cut(f)
elif o.isDerivedFrom("Part::Feature"):
if o.Shape:
@@ -419,18 +429,7 @@ class ViewProviderComponent:
return modes
def setDisplayMode(self,mode):
if mode == "Detailed":
if hasattr(self,"Object"):
if hasattr(self.Object,"Fixtures"):
for f in self.Object.Fixtures:
f.ViewObject.show()
return "Flat Lines"
else:
if hasattr(self,"Object"):
if hasattr(self.Object,"Fixtures"):
for f in self.Object.Fixtures:
f.ViewObject.hide()
return mode
return mode
def __getstate__(self):
return None
@@ -446,7 +445,12 @@ class ViewProviderComponent:
c = []
else:
c = [self.Object.Base]
c = c + self.Object.Additions + self.Object.Subtractions
c = c + self.Object.Additions
for s in self.Object.Subtractions:
if Draft.getType(self.Object) == "Wall":
if Draft.getType(s) == "Roof":
continue
c.append(s)
if hasattr(self.Object,"Fixtures"):
c.extend(self.Object.Fixtures)
if hasattr(self.Object,"Armatures"):