From 72848e0477c2b03870f56521d5ef557aeee2aa69 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Wed, 9 Oct 2013 17:38:48 -0300 Subject: [PATCH] Arch: General cleaning and removal of fixtures tool (unused anyway) --- src/Mod/Arch/ArchCommands.py | 3 ++- src/Mod/Arch/ArchComponent.py | 13 +------------ src/Mod/Arch/ArchWindow.py | 11 ++++++----- src/Mod/Arch/InitGui.py | 2 +- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index 96437e6799..00ee8e1cee 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -795,6 +795,7 @@ class _CommandCheck: class _CommandFixture: + # OBSOLETE - To be removed "the Arch Fixture command definition" def GetResources(self): return {'Pixmap' : 'Arch_Fixture', @@ -826,4 +827,4 @@ FreeCADGui.addCommand('Arch_SelectNonSolidMeshes',_CommandSelectNonSolidMeshes() FreeCADGui.addCommand('Arch_RemoveShape',_CommandRemoveShape()) FreeCADGui.addCommand('Arch_CloseHoles',_CommandCloseHoles()) FreeCADGui.addCommand('Arch_Check',_CommandCheck()) -FreeCADGui.addCommand('Arch_Fixture',_CommandFixture()) +#FreeCADGui.addCommand('Arch_Fixture',_CommandFixture()) diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index 4dabc84a5c..afbfb445a8 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -283,8 +283,6 @@ class Component: "Other shapes that are appended to this object") obj.addProperty("App::PropertyLinkList","Subtractions","Arch", "Other shapes that are subtracted from this object") - obj.addProperty("App::PropertyLinkList","Fixtures","Arch", - "Shapes or Meshes that are appended to this object without modifying its geometry") obj.Proxy = self self.Type = "Component" self.Subvolume = None @@ -300,16 +298,7 @@ class Component: self.Type = state def onChanged(self,obj,prop): - if prop == "Placement": - # make fixtures move along with host - if hasattr(obj,"Fixtures"): - vo = obj.Shape.Placement.Base - vn = obj.Placement.Base - import DraftVecUtils - if not DraftVecUtils.equals(vo,vn): - delta = vn.sub(vo) - for o in obj.Fixtures: - o.Placement.move(delta) + pass def hideSubobjects(self,obj,prop): "Hides subobjects when a subobject lists change" diff --git a/src/Mod/Arch/ArchWindow.py b/src/Mod/Arch/ArchWindow.py index 88810551ba..4fd86a93a1 100644 --- a/src/Mod/Arch/ArchWindow.py +++ b/src/Mod/Arch/ArchWindow.py @@ -26,11 +26,12 @@ from FreeCAD import Vector from PyQt4 import QtCore,QtGui from DraftTools import translate -__title__="FreeCAD Wall" +__title__="FreeCAD Window" __author__ = "Yorik van Havre" __url__ = "http://www.freecadweb.org" WindowPartTypes = ["Frame","Solid panel","Glass panel"] +AllowedHosts = ["Wall","Structure"] def makeWindow(baseobj=None,width=None,name=str(translate("Arch","Window"))): '''makeWindow(obj,[name]): creates a window based on the @@ -81,7 +82,7 @@ class _CommandWindow: sel = FreeCADGui.Selection.getSelection() if sel: obj = sel[0] - if Draft.getType(obj) == "Wall": + if Draft.getType(obj) in AllowedHosts: FreeCADGui.activateWorkbench("SketcherWorkbench") FreeCADGui.runCommand("Sketcher_NewSketch") FreeCAD.ArchObserver = ArchComponent.ArchSelectionObserver(obj,FreeCAD.ActiveDocument.Objects[-1],hide=False,nextCommand="Arch_Window") @@ -118,7 +119,7 @@ class _Window(ArchComponent.Component): obj.addProperty("App::PropertyStringList","WindowParts","Arch", str(translate("Arch","the components of this window"))) obj.addProperty("App::PropertyDistance","HoleDepth","Arch", - str(translate("Arch","The depth of the hole that this window makes in its host wall. Keep 0 for automatic."))) + str(translate("Arch","The depth of the hole that this window makes in its host object. Keep 0 for automatic."))) self.Type = "Window" obj.Proxy = self @@ -128,7 +129,7 @@ class _Window(ArchComponent.Component): self.execute(obj) elif prop == "HoleDepth": for o in obj.InList: - if Draft.getType(o) == "Wall": + if Draft.getType(o) in AllowedHosts: o.Proxy.execute(o) def execute(self,obj): @@ -187,7 +188,7 @@ class _Window(ArchComponent.Component): obj.Shape = base def getSubVolume(self,obj,plac=None): - "returns a subvolume for cutting in a base wall" + "returns a subvolume for cutting in a base object" # getting extrusion depth base = None diff --git a/src/Mod/Arch/InitGui.py b/src/Mod/Arch/InitGui.py index c4dd06bfbe..0de772e673 100644 --- a/src/Mod/Arch/InitGui.py +++ b/src/Mod/Arch/InitGui.py @@ -73,7 +73,7 @@ class ArchWorkbench(Workbench): "Arch_Floor","Arch_Building","Arch_Site", "Arch_Window","Arch_Roof","Arch_Axis", "Arch_SectionPlane","Arch_Space","Arch_Stairs", - "Arch_Add","Arch_Remove","Arch_Fixture"] + "Arch_Add","Arch_Remove"] self.meshtools = ["Arch_SplitMesh","Arch_MeshToShape", "Arch_SelectNonSolidMeshes","Arch_RemoveShape", "Arch_CloseHoles","Arch_MergeWalls"]