diff --git a/src/Mod/Arch/ArchPanel.py b/src/Mod/Arch/ArchPanel.py
index 58d2ae80a6..5774a89116 100644
--- a/src/Mod/Arch/ArchPanel.py
+++ b/src/Mod/Arch/ArchPanel.py
@@ -89,28 +89,7 @@ def makePanel(baseobj=None,length=0,width=0,thickness=0,placement=None,name="Pan
return obj
-def makePanelView(panel,page=None,name="PanelView"):
-
- """makePanelView(panel,[page]) : Creates a Drawing view of the given panel
- in the given or active Page object (a new page will be created if none exists)."""
-
- if not page:
- for o in FreeCAD.ActiveDocument.Objects:
- if o.isDerivedFrom("Drawing::FeaturePage"):
- page = o
- break
- if not page:
- page = FreeCAD.ActiveDocument.addObject("Drawing::FeaturePage",translate("Arch","Page"))
- page.Template = Draft.getParam("template",FreeCAD.getResourceDir()+'Mod/Drawing/Templates/A3_Landscape.svg')
- view = FreeCAD.ActiveDocument.addObject("Drawing::FeatureViewPython",name)
- page.addObject(view)
- PanelView(view)
- view.Source = panel
- view.Label = translate("Arch","View of")+" "+panel.Label
- return view
-
-
-def makePanelCut(panel,name="PanelView"):
+def makePanelCut(panel,name="PanelCut"):
"""makePanelCut(panel) : Creates a 2D view of the given panel
in the 3D space, positioned at the origin."""
@@ -816,116 +795,12 @@ class _ViewProviderPanel(ArchComponent.ViewProviderComponent):
ArchComponent.ViewProviderComponent.updateData(self,obj,prop)
-class PanelView:
-
- "A Drawing view for Arch Panels"
-
- def __init__(self, obj):
-
- obj.Proxy = self
-
- # setProperties of ArchComponent will be overwritten
- # thus setProperties from ArchComponent will be explicit called to get the properties
- ArchComponent.ViewProviderComponent.setProperties(self, vobj)
-
- self.setProperties(obj)
- obj.X = 10
- obj.Y = 10
-
- def setProperties(self,obj):
-
- pl = obj.PropertiesList
- if not "Source" in pl:
- obj.addProperty("App::PropertyLink","Source","PanelView",QT_TRANSLATE_NOOP("App::Property","The linked object"))
- if not "LineWidth" in pl:
- obj.addProperty("App::PropertyFloat","LineWidth","PanelView",QT_TRANSLATE_NOOP("App::Property","The line width of the rendered objects"))
- obj.LineWidth = 0.35
- if not "LineColor" in pl:
- obj.addProperty("App::PropertyColor","LineColor","PanelView",QT_TRANSLATE_NOOP("App::Property","The color of the panel outline"))
- obj.LineColor = (0.0,0.0,0.0)
- if not "FontSize" in pl:
- obj.addProperty("App::PropertyLength","FontSize","PanelView",QT_TRANSLATE_NOOP("App::Property","The size of the tag text"))
- if not "TextColor" in pl:
- obj.addProperty("App::PropertyColor","TextColor","PanelView",QT_TRANSLATE_NOOP("App::Property","The color of the tag text"))
- obj.TextColor = (0.0,0.0,1.0)
- if not "TextX" in pl:
- obj.addProperty("App::PropertyFloat","TextX","PanelView",QT_TRANSLATE_NOOP("App::Property","The X offset of the tag text"))
- obj.TextX = 10
- if not "TextY" in pl:
- obj.addProperty("App::PropertyFloat","TextY","PanelView",QT_TRANSLATE_NOOP("App::Property","The Y offset of the tag text"))
- obj.TextY = 10
- if not "FontName" in pl:
- obj.addProperty("App::PropertyString","FontName","PanelView",QT_TRANSLATE_NOOP("App::Property","The font of the tag text"))
- obj.FontName = "sans"
- self.Type = "PanelView"
-
- def onDocumentRestored(self,obj):
-
- self.setProperties(obj)
-
- def execute(self, obj):
-
- if obj.Source:
- if hasattr(obj.Source.Proxy,"BaseProfile"):
- p = obj.Source.Proxy.BaseProfile
- n = obj.Source.Proxy.ExtrusionVector
- import TechDraw
- svg1 = ""
- svg2 = ""
- result = ""
- svg1 = TechDraw.projectToSVG(p,DraftVecUtils.neg(n))
- if svg1:
- w = str(obj.LineWidth/obj.Scale) #don't let linewidth be influenced by the scale...
- svg1 = svg1.replace('stroke-width="0.35"','stroke-width="'+w+'"')
- svg1 = svg1.replace('stroke-width="1"','stroke-width="'+w+'"')
- svg1 = svg1.replace('stroke-width:0.01','stroke-width:'+w)
- svg1 = svg1.replace('scale(1,-1)','scale('+str(obj.Scale)+',-'+str(obj.Scale)+')')
- if obj.Source.Tag:
- svg2 = ''
- svg2 += ''+obj.Source.Tag+'\n'
- result += '\n '
- result += svg1
- result += svg2
- result += ''
- obj.ViewResult = result
-
- def onChanged(self, obj, prop):
-
- pass
-
- def __getstate__(self):
-
- return None
-
- def __setstate__(self,state):
-
- return None
-
- def getDisplayModes(self,vobj):
-
- modes=["Default"]
- return modes
-
- def setDisplayMode(self,mode):
-
- return mode
-
-
-class PanelCut(Draft._DraftObject):
+class PanelCut(Draft.DraftObject):
"A flat, 2D view of an Arch Panel"
def __init__(self, obj):
- Draft._DraftObject.__init__(self,obj)
+ Draft.DraftObject.__init__(self,obj)
obj.Proxy = self
# setProperties of ArchComponent will be overwritten
@@ -1117,13 +992,13 @@ class PanelCut(Draft._DraftObject):
return (outl, inl, tag)
-class ViewProviderPanelCut(Draft._ViewProviderDraft):
+class ViewProviderPanelCut(Draft.ViewProviderDraft):
"a view provider for the panel cut object"
def __init__(self,vobj):
- Draft._ViewProviderDraft.__init__(self,vobj)
+ Draft.ViewProviderDraft.__init__(self,vobj)
self.setProperties(vobj)
def setProperties(self,vobj):
@@ -1140,7 +1015,7 @@ class ViewProviderPanelCut(Draft._ViewProviderDraft):
def attach(self,vobj):
- Draft._ViewProviderDraft.attach(self,vobj)
+ Draft.ViewProviderDraft.attach(self,vobj)
from pivy import coin
self.coords = coin.SoCoordinate3()
self.lineset = coin.SoLineSet()
@@ -1190,22 +1065,22 @@ class ViewProviderPanelCut(Draft._ViewProviderDraft):
if hasattr(vobj,"LineColor"):
c = vobj.LineColor
self.color.rgb.setValue(c[0],c[1],c[2])
- Draft._ViewProviderDraft.onChanged(self,vobj,prop)
+ Draft.ViewProviderDraft.onChanged(self,vobj,prop)
def updateData(self,obj,prop):
if prop in ["Shape"]:
self.onChanged(obj.ViewObject,"Margin")
- Draft._ViewProviderDraft.updateData(self,obj,prop)
+ Draft.ViewProviderDraft.updateData(self,obj,prop)
-class PanelSheet(Draft._DraftObject):
+class PanelSheet(Draft.DraftObject):
"A collection of Panel cuts under a sheet"
def __init__(self, obj):
- Draft._DraftObject.__init__(self,obj)
+ Draft.DraftObject.__init__(self,obj)
obj.Proxy = self
self.setProperties(obj)
@@ -1375,13 +1250,13 @@ class PanelSheet(Draft._DraftObject):
return outp
-class ViewProviderPanelSheet(Draft._ViewProviderDraft):
+class ViewProviderPanelSheet(Draft.ViewProviderDraft):
"a view provider for the panel sheet object"
def __init__(self,vobj):
- Draft._ViewProviderDraft.__init__(self,vobj)
+ Draft.ViewProviderDraft.__init__(self,vobj)
self.setProperties(vobj)
vobj.PatternSize = 0.0035
@@ -1401,7 +1276,7 @@ class ViewProviderPanelSheet(Draft._ViewProviderDraft):
def getIcon(self):
- return ":/icons/Draft_Drawing.svg"
+ return ":/icons/Arch_Panel_Sheet_Tree.svg"
def setEdit(self, vobj, mode):
if mode == 1 or mode == 2:
@@ -1421,7 +1296,7 @@ class ViewProviderPanelSheet(Draft._ViewProviderDraft):
def attach(self,vobj):
- Draft._ViewProviderDraft.attach(self,vobj)
+ Draft.ViewProviderDraft.attach(self,vobj)
from pivy import coin
self.coords = coin.SoCoordinate3()
self.lineset = coin.SoLineSet()
@@ -1469,7 +1344,7 @@ class ViewProviderPanelSheet(Draft._ViewProviderDraft):
vobj.Pattern = "woodgrain"
else:
vobj.Pattern = "None"
- Draft._ViewProviderDraft.onChanged(self,vobj,prop)
+ Draft.ViewProviderDraft.onChanged(self,vobj,prop)
def updateData(self,obj,prop):
@@ -1484,7 +1359,7 @@ class ViewProviderPanelSheet(Draft._ViewProviderDraft):
vT = DraftVecUtils.rotate(FreeCAD.Vector(0,s,0),-math.radians(obj.GrainDirection.Value))
self.texcoords.directionS.setValue(vS.x,vS.y,vS.z)
self.texcoords.directionT.setValue(vT.x,vT.y,vT.z)
- Draft._ViewProviderDraft.updateData(self,obj,prop)
+ Draft.ViewProviderDraft.updateData(self,obj,prop)
class SheetTaskPanel(ArchComponent.ComponentTaskPanel):
diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py
index 8e919f5eed..dcfba46845 100644
--- a/src/Mod/Arch/ArchSectionPlane.py
+++ b/src/Mod/Arch/ArchSectionPlane.py
@@ -51,7 +51,7 @@ else:
#
# This module provides tools to build Section plane objects.
# It also contains functionality to produce SVG rendering of
-# section planes, to be used in TechDraw and Drawing modules
+# section planes, to be used in the TechDraw module
ISRENDERING = False # flag to prevent concurrent runs of the coin renderer
@@ -83,29 +83,6 @@ def makeSectionPlane(objectslist=None,name="Section"):
return obj
-def makeSectionView(section,name="View"):
-
- """OBSOLETE
- makeSectionView(section) : Creates a Drawing view of the given Section Plane
- in the active Page object (a new page will be created if none exists"""
-
- page = None
- for o in FreeCAD.ActiveDocument.Objects:
- if o.isDerivedFrom("Drawing::FeaturePage"):
- page = o
- break
- if not page:
- page = FreeCAD.ActiveDocument.addObject("Drawing::FeaturePage","Page")
- page.Template = Draft.getParam("template",FreeCAD.getResourceDir()+'Mod/Drawing/Templates/A3_Landscape.svg')
-
- view = FreeCAD.ActiveDocument.addObject("Drawing::FeatureViewPython",name)
- page.addObject(view)
- _ArchDrawingView(view)
- view.Source = section
- view.Label = translate("Arch","View of")+" "+section.Name
- return view
-
-
def getSectionData(source):
"""Returns some common data from section planes and building parts"""
@@ -210,7 +187,7 @@ def getCutShapes(objs,cutplane,onlySolids,clip,joinArch,showHidden,groupSshapesB
f = Part.Face(w)
tmpSshapes.append(f)
except Part.OCCError:
- #print "ArchDrawingView: unable to get a face"
+ #print "ArchView: unable to get a face"
tmpSshapes.append(s)
shapes.extend(c.SubShapes if c.ShapeType == "Compound" else [c])
if showHidden:
@@ -461,7 +438,7 @@ def getSVG(source,
if should_update_svg_cache:
svgcache = ""
- # render using the Drawing module
+ # render using the TechDraw module
import TechDraw, Part
if vshapes:
baseshape = Part.makeCompound(vshapes)
@@ -591,17 +568,9 @@ def getSVG(source,
def getDXF(obj):
- """Return a DXF representation from a TechDraw/Drawing view."""
- allOn = True
- if hasattr(obj,"AllOn"):
- allOn = obj.AllOn
- elif hasattr(obj,"AlwaysOn"):
- allOn = obj.AlwaysOn
- showHidden = False
- if hasattr(obj,"showCut"):
- showHidden = obj.showCut
- elif hasattr(obj,"showHidden"):
- showHidden = obj.showHidden
+ """Return a DXF representation from a TechDraw view."""
+ allOn = getattr(obj, "AllOn", True)
+ showHidden = getattr(obj, "ShowHidden", False)
result = []
import TechDraw, Part
if not obj.Source:
@@ -868,8 +837,6 @@ class _CommandSectionPlane:
FreeCAD.ActiveDocument.openTransaction(translate("Arch","Create Section Plane"))
FreeCADGui.addModule("Arch")
FreeCADGui.doCommand("section = Arch.makeSectionPlane("+ss+")")
- #FreeCADGui.doCommand("section.Placement = FreeCAD.DraftWorkingPlane.getPlacement()")
- #FreeCADGui.doCommand("Arch.makeSectionView(section)")
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()
@@ -1232,89 +1199,6 @@ class _ViewProviderSectionPlane:
vobj.CutView = not vobj.CutView
-class _ArchDrawingView:
-
- def __init__(self, obj):
-
- obj.Proxy = self
- self.setProperties(obj)
-
- def setProperties(self,obj):
-
- pl = obj.PropertiesList
- if not "Source" in pl:
- obj.addProperty("App::PropertyLink", "Source", "Base", QT_TRANSLATE_NOOP("App::Property","The linked object"))
- if not "RenderingMode" in pl:
- obj.addProperty("App::PropertyEnumeration", "RenderingMode", "Drawing view", QT_TRANSLATE_NOOP("App::Property","The rendering mode to use"))
- obj.RenderingMode = ["Solid","Wireframe"]
- obj.RenderingMode = "Wireframe"
- if not "ShowCut" in pl:
- obj.addProperty("App::PropertyBool", "ShowCut", "Drawing view", QT_TRANSLATE_NOOP("App::Property","If cut geometry is shown or not"))
- if not "ShowFill" in pl:
- obj.addProperty("App::PropertyBool", "ShowFill", "Drawing view", QT_TRANSLATE_NOOP("App::Property","If cut geometry is filled or not"))
- if not "LineWidth" in pl:
- obj.addProperty("App::PropertyFloat", "LineWidth", "Drawing view", QT_TRANSLATE_NOOP("App::Property","The line width of the rendered objects"))
- obj.LineWidth = 0.35
- if not "FontSize" in pl:
- obj.addProperty("App::PropertyLength", "FontSize", "Drawing view", QT_TRANSLATE_NOOP("App::Property","The size of the texts inside this object"))
- obj.FontSize = 12
- if not "AlwaysOn" in pl:
- obj.addProperty("App::PropertyBool", "AlwaysOn", "Drawing view", QT_TRANSLATE_NOOP("App::Property","If checked, source objects are displayed regardless of being visible in the 3D model"))
- if not "LineColor" in pl:
- obj.addProperty("App::PropertyColor", "LineColor", "Drawing view",QT_TRANSLATE_NOOP("App::Property","The line color of the projected objects"))
- if not "FillColor" in pl:
- obj.addProperty("App::PropertyColor", "FillColor", "Drawing view",QT_TRANSLATE_NOOP("App::Property","The color of the cut faces (if turned on)"))
- obj.FillColor = (0.8, 0.8, 0.8)
- self.Type = "ArchSectionView"
-
- def onDocumentRestored(self, obj):
-
- self.setProperties(obj)
-
- def execute(self, obj):
-
- if hasattr(obj,"Source"):
- if obj.Source:
- svgbody = getSVG(source=obj.Source,
- renderMode=obj.RenderingMode,
- allOn=getattr(obj, 'AlwaysOn', False),
- showHidden=obj.ShowCut,
- scale=obj.Scale,
- linewidth=obj.LineWidth,
- lineColor=obj.LineColor,
- fontsize=obj.FontSize,
- showFill=obj.ShowFill,
- fillColor=obj.FillColor)
- if svgbody:
- result = '\n'
- result += svgbody
- result += '\n'
- obj.ViewResult = result
-
- def __getstate__(self):
-
- return self.Type
-
- def __setstate__(self,state):
-
- if state:
- self.Type = state
-
- def getDisplayModes(self,vobj):
-
- modes=["Default"]
- return modes
-
- def setDisplayMode(self,mode):
-
- return mode
-
-
class SectionPlaneTaskPanel:
'''A TaskPanel for all the section plane object'''
diff --git a/src/Mod/Arch/Resources/Arch.qrc b/src/Mod/Arch/Resources/Arch.qrc
index 08e60d4b1d..551e61015a 100644
--- a/src/Mod/Arch/Resources/Arch.qrc
+++ b/src/Mod/Arch/Resources/Arch.qrc
@@ -44,6 +44,7 @@
icons/Arch_Panel_Clone.svg
icons/Arch_Panel_Cut.svg
icons/Arch_Panel_Sheet.svg
+ icons/Arch_Panel_Sheet_Tree.svg
icons/Arch_Panel_Tree.svg
icons/Arch_Pipe.svg
icons/Arch_Pipe_Tree.svg
diff --git a/src/Mod/Arch/Resources/icons/Arch_Panel_Sheet_Tree.svg b/src/Mod/Arch/Resources/icons/Arch_Panel_Sheet_Tree.svg
new file mode 100644
index 0000000000..68efd2c059
--- /dev/null
+++ b/src/Mod/Arch/Resources/icons/Arch_Panel_Sheet_Tree.svg
@@ -0,0 +1,234 @@
+
+
+
+
diff --git a/src/Mod/Arch/TestArch.py b/src/Mod/Arch/TestArch.py
index d1b4be500c..f1907bf880 100644
--- a/src/Mod/Arch/TestArch.py
+++ b/src/Mod/Arch/TestArch.py
@@ -613,7 +613,6 @@ class ArchTest(unittest.TestCase):
def testSection(self):
App.Console.PrintLog ('Checking Arch Section...\n')
s = Arch.makeSectionPlane([])
- #v = Arch.makeSectionView(s) # obsolete, uses the Drawing module
self.failUnless(s,"Arch Section failed")
def testSpace(self):