Skip to content

Commit

Permalink
Arch: Extended panel tools
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Dec 17, 2016
1 parent b97f93c commit 5998723
Show file tree
Hide file tree
Showing 9 changed files with 1,195 additions and 65 deletions.
11 changes: 8 additions & 3 deletions src/Mod/Arch/ArchComponent.py
Expand Up @@ -63,7 +63,7 @@ def addToComponent(compobject,addobject,mod=None):
if compobject == addobject: return
# first check zis already there
found = False
attribs = ["Additions","Objects","Components","Subtractions","Base"]
attribs = ["Additions","Objects","Components","Subtractions","Base","Group"]
for a in attribs:
if hasattr(compobject,a):
if a == "Base":
Expand All @@ -89,6 +89,8 @@ def addToComponent(compobject,addobject,mod=None):
setattr(compobject,mod,l)
if mod != "Objects":
addobject.ViewObject.hide()
if Draft.getType(compobject) == "PanelSheet":
addobject.Placement.move(compobject.Placement.Base.negative())
else:
for a in attribs[:3]:
if hasattr(compobject,a):
Expand All @@ -106,7 +108,7 @@ def removeFromComponent(compobject,subobject):
it is added as a subtraction.'''
if compobject == subobject: return
found = False
attribs = ["Additions","Subtractions","Objects","Components","Base","Axes","Fixtures"]
attribs = ["Additions","Subtractions","Objects","Components","Base","Axes","Fixtures","Group"]
for a in attribs:
if hasattr(compobject,a):
if a == "Base":
Expand All @@ -120,6 +122,8 @@ def removeFromComponent(compobject,subobject):
l.remove(subobject)
setattr(compobject,a,l)
subobject.ViewObject.show()
if Draft.getType(compobject) == "PanelSheet":
subobject.Placement.move(compobject.Placement.Base)
found = True
if not found:
if hasattr(compobject,"Subtractions"):
Expand Down Expand Up @@ -154,7 +158,7 @@ def __init__(self):
# the categories are shown only if they are not empty.

self.obj = None
self.attribs = ["Base","Additions","Subtractions","Objects","Components","Axes","Fixtures","Armatures"]
self.attribs = ["Base","Additions","Subtractions","Objects","Components","Axes","Fixtures","Armatures","Group"]
self.baseform = QtGui.QWidget()
self.baseform.setObjectName("TaskPanel")
self.grid = QtGui.QGridLayout(self.baseform)
Expand Down Expand Up @@ -300,6 +304,7 @@ def retranslateUi(self, TaskPanel):
self.treeComponents.setText(0,QtGui.QApplication.translate("Arch", "Components", None, QtGui.QApplication.UnicodeUTF8))
self.treeFixtures.setText(0,QtGui.QApplication.translate("Arch", "Fixtures", None, QtGui.QApplication.UnicodeUTF8))
self.treeArmatures.setText(0,QtGui.QApplication.translate("Arch", "Armatures", None, QtGui.QApplication.UnicodeUTF8))
self.treeGroup.setText(0,QtGui.QApplication.translate("Arch", "Group", None, QtGui.QApplication.UnicodeUTF8))

class Component:
"The default Arch Component object"
Expand Down
416 changes: 409 additions & 7 deletions src/Mod/Arch/ArchPanel.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Mod/Arch/InitGui.py
Expand Up @@ -37,7 +37,7 @@ def Initialize(self):
"Arch_Floor","Arch_Building","Arch_Site",
"Arch_Window","Arch_Roof","Arch_Axis",
"Arch_SectionPlane","Arch_Space","Arch_Stairs",
"Arch_Panel","Arch_Equipment",
"Arch_PanelTools","Arch_Equipment",
"Arch_Frame","Arch_Material","Arch_Schedule","Arch_PipeTools",
"Arch_CutPlane","Arch_Add","Arch_Remove","Arch_Survey"]
self.utilities = ["Arch_Component","Arch_SplitMesh","Arch_MeshToShape",
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Arch/Resources/Arch.qrc
Expand Up @@ -45,6 +45,8 @@
<file>icons/Arch_Panel.svg</file>
<file>icons/Arch_Panel_Tree.svg</file>
<file>icons/Arch_Panel_Clone.svg</file>
<file>icons/Arch_Panel_Cut.svg</file>
<file>icons/Arch_Panel_Sheet.svg</file>
<file>icons/Arch_Equipment.svg</file>
<file>icons/Arch_Equipment_Tree.svg</file>
<file>icons/Arch_Equipment_Clone.svg</file>
Expand Down
139 changes: 139 additions & 0 deletions src/Mod/Arch/Resources/icons/Arch_Panel_Cut.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5998723

Please sign in to comment.