Removed surfaces modules (broken due to Part import)

This commit is contained in:
Jose Luis Cercós Pita 2012-08-10 11:42:03 +02:00 committed by Yorik van Havre
parent 3d0328134d
commit 060d63c6c9
4 changed files with 31 additions and 7 deletions

View File

@ -31,7 +31,6 @@ from PyQt4 import QtGui,QtCore
import Preview, Plot
import Instance
from shipUtils import Paths, Translator
from surfUtils import Geometry
from shipHydrostatics import Tools as Hydrostatics
class TaskPanel:
@ -114,7 +113,7 @@ class TaskPanel:
""" Set initial values for fields
"""
# Get objects
selObjs = Geometry.getSelectedObjs()
selObjs = Gui.Selection.getSelection()
if not selObjs:
msg = Translator.translate("Ship instance must be selected (no object selected)\n")
App.Console.PrintError(msg)

View File

@ -28,7 +28,6 @@ import FreeCADGui as Gui
from PyQt4 import QtGui,QtCore
# Module
from shipUtils import Paths, Translator
from surfUtils import Geometry
class TaskPanel:
def __init__(self):

View File

@ -27,7 +27,6 @@ from FreeCAD import Base, Vector
import Part
# FreeCADShip modules
from shipUtils import Paths, Translator
from surfUtils import Geometry
def Plot(scale, sections, shape):
""" Creates the outline draw.
@ -52,7 +51,7 @@ def Plot(scale, sections, shape):
x0 = xMid - 0.5*xTot
y0 = 297.0 - yMid - 0.5*yTot # 297 = A3_width
# Get border
edges = Geometry.getEdges([shape])
edges = self.getEdges([shape])
border = edges[0]
for i in range(0,len(edges)):
border = border.oldFuse(edges[i]) # Only group objects, don't try to build more complex entities
@ -95,3 +94,31 @@ def Plot(scale, sections, shape):
FreeCAD.ActiveDocument.OutlineDrawPlot.addObject(FreeCAD.ActiveDocument.OutlineDrawUpView)
FreeCAD.ActiveDocument.recompute()
return obj
def getEdges(self, objs=None):
""" Returns object edges (list of them)
@param objs Object to get the faces, none if selected
object may used.
@return Selected edges. None if errors happens
"""
edges = []
if not objs:
objs = FreeCADGui.Selection.getSelection()
if not objs:
return None
for i in range(0, len(objs)):
obj = objs[i]
if obj.isDerivedFrom('Part::Feature'):
# get shape
shape = obj.Shape
if not shape:
return None
obj = shape
if not obj.isDerivedFrom('Part::TopoShape'):
return None
objEdges = obj.Edges
if not objEdges:
continue
for j in range(0, len(objEdges)):
edges.append(objEdges[j])
return edges

View File

@ -30,7 +30,6 @@ from PyQt4 import QtGui,QtCore
import Preview, Plot
import Instance
from shipUtils import Paths, Translator
from surfUtils import Geometry
class TaskPanel:
def __init__(self):
@ -116,7 +115,7 @@ class TaskPanel:
""" Set initial values for fields
"""
# Get selected objects
selObjs = Geometry.getSelectedObjs()
selObjs = Gui.Selection.getSelection()
if not selObjs:
msg = Translator.translate("Ship instance must be selected (no object selected)\n")
App.Console.PrintError(msg)