in Compute(), fix showing compute error in case of imported mesh

This commit is contained in:
eap 2010-05-05 13:58:31 +00:00
parent 05577711c3
commit 3ad2a95049

View File

@ -1189,6 +1189,7 @@ class Mesh:
computeErrors = self.smeshpyD.GetComputeErrors( self.mesh, geom ) computeErrors = self.smeshpyD.GetComputeErrors( self.mesh, geom )
for err in computeErrors: for err in computeErrors:
shapeText = "" shapeText = ""
if self.mesh.HasShapeToMesh():
try: try:
mainIOR = salome.orb.object_to_string(geom) mainIOR = salome.orb.object_to_string(geom)
for sname in salome.myStudyManager.GetOpenStudies(): for sname in salome.myStudyManager.GetOpenStudies():
@ -1206,16 +1207,16 @@ class Mesh:
if not go: continue if not go: continue
ids = go.GetSubShapeIndices() ids = go.GetSubShapeIndices()
if len(ids) == 1 and ids[0] == err.subShapeID: if len(ids) == 1 and ids[0] == err.subShapeID:
shapeText = '"%s"' % subSO.GetName() shapeText = ' on "%s"' % subSO.GetName()
break break
if not shapeText: if not shapeText:
shape = self.geompyD.GetSubShape( geom, [err.subShapeID]) shape = self.geompyD.GetSubShape( geom, [err.subShapeID])
if shape: if shape:
shapeText = "%s #%s" % (shape.GetShapeType(), err.subShapeID) shapeText = " on %s #%s" % (shape.GetShapeType(), err.subShapeID)
else: else:
shapeText = "%subshape #%s" % (err.subShapeID) shapeText = " on subshape #%s" % (err.subShapeID)
except: except:
shapeText = "%subshape #%s" % (err.subShapeID) shapeText = " on subshape #%s" % (err.subShapeID)
errText = "" errText = ""
stdErrors = ["OK", #COMPERR_OK stdErrors = ["OK", #COMPERR_OK
"Invalid input mesh", #COMPERR_BAD_INPUT_MESH "Invalid input mesh", #COMPERR_BAD_INPUT_MESH
@ -1233,7 +1234,7 @@ class Mesh:
if errText: errText += ". " if errText: errText += ". "
errText += err.comment errText += err.comment
if allReasons != "":allReasons += "\n" if allReasons != "":allReasons += "\n"
allReasons += '"%s" failed on %s. Error: %s' %(err.algoName, shapeText, errText) allReasons += '"%s" failed%s. Error: %s' %(err.algoName, shapeText, errText)
pass pass
# Treat hyp errors # Treat hyp errors