0000981: Arch groups now have a placement
This commit is contained in:
@@ -78,6 +78,8 @@ class _Floor:
|
||||
def __init__(self,obj):
|
||||
obj.addProperty("App::PropertyLength","Height","Base",
|
||||
str(translate("Arch","The height of this floor")))
|
||||
obj.addProperty("App::PropertyPlacement","Placement","Base",
|
||||
str(translate("Arch","The placement of this group")))
|
||||
self.Type = "Floor"
|
||||
obj.Proxy = self
|
||||
self.Object = obj
|
||||
@@ -90,10 +92,18 @@ class _Floor:
|
||||
self.Type = state
|
||||
|
||||
def execute(self,obj):
|
||||
pass
|
||||
if hasattr(obj,"Placement"):
|
||||
self.OldPlacement = obj.Placement.copy()
|
||||
|
||||
def onChanged(self,obj,prop):
|
||||
self.Object = obj
|
||||
if prop == "Placement":
|
||||
if hasattr(self,"OldPlacement"):
|
||||
delta = obj.Placement.Base.sub(self.OldPlacement.Base)
|
||||
for o in obj.Group:
|
||||
if hasattr(o,"Placement"):
|
||||
o.Placement.move(delta)
|
||||
self.OldPlacement = FreeCAD.Placement(obj.Placement)
|
||||
|
||||
def addObject(self,child):
|
||||
if hasattr(self,"Object"):
|
||||
|
||||
@@ -1936,7 +1936,14 @@ class Move(Modifier):
|
||||
def proceed(self):
|
||||
if self.call: self.view.removeEventCallback("SoEvent",self.call)
|
||||
self.sel = Draft.getSelection()
|
||||
self.sel = Draft.getGroupContents(self.sel)
|
||||
# testing for special case: only Arch groups in selection
|
||||
onlyarchgroups = True
|
||||
for o in self.sel:
|
||||
if not(Draft.getType(o) in ["Floor","Building","Site"]):
|
||||
onlyarchgroups = False
|
||||
if not onlyarchgroups:
|
||||
# arch groups can be moved, no need to add their children
|
||||
self.sel = Draft.getGroupContents(self.sel)
|
||||
self.ui.pointUi(self.name)
|
||||
self.ui.modUi()
|
||||
self.ui.xValue.setFocus()
|
||||
|
||||
Reference in New Issue
Block a user