Added 2D displaymode to Arch walls

This commit is contained in:
Yorik van Havre 2012-02-04 17:26:48 -02:00
parent d22d654007
commit 47765a1844

View File

@ -255,6 +255,10 @@ class _Wall(ArchComponent.Component):
import Part
from draftlibs import fcgeo
flat = False
if hasattr(obj.ViewObject,"DisplayMode"):
flat = (obj.ViewObject.DisplayMode == "Flat 2D")
def getbase(wire):
"returns a full shape from a base wire"
@ -277,7 +281,7 @@ class _Wall(ArchComponent.Component):
sh = fcgeo.bind(w1,w2)
# fixing self-intersections
sh.fix(0.1,0,1)
if height:
if height and (not flat):
norm = Vector(normal).multiply(height)
sh = sh.extrude(norm)
return sh
@ -352,5 +356,19 @@ class _ViewProviderWall(ArchComponent.ViewProviderComponent):
def getIcon(self):
return ":/icons/Arch_Wall_Tree.svg"
def getDisplayModes(self,vobj):
return ["Flat 2D"]
def setDisplayMode(self,mode):
self.Object.Proxy.createGeometry(self.Object)
if mode == "Flat 2D":
return "Flat Lines"
else:
return mode
def attach(self,vobj):
self.Object = vobj.Object
return
FreeCADGui.addCommand('Arch_Wall',_CommandWall())