From: eap Date: Thu, 3 Feb 2011 12:28:55 +0000 (+0000) Subject: 0021122: EDF 1735 SMESH: Bug when saving in .hdf X-Git-Tag: StartingPortingMED3~81 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=692ae6c6e32ae3f80fa4a07ec4da51c133b29473;p=modules%2Fsmesh.git 0021122: EDF 1735 SMESH: Bug when saving in .hdf In Mesh_Algorithm.Assign(), add to study the not pubished sub-shape --- diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index eb1f50573..03598d6a2 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -4354,12 +4354,20 @@ class Mesh_Algorithm: name = GetName(geom) pass except: + pass + if not name and geom.GetShapeType() != geompyDC.GEOM.COMPOUND: + # for all groups SubShapeName() returns "Compound_-1" name = mesh.geompyD.SubShapeName(geom, piece) - if not name: - name = "%s_%s"%(geom.GetShapeType(), id(geom%1000)) + if not name: + name = "%s_%s"%(geom.GetShapeType(), id(geom)%10000) + # publish geom of sub-mesh (issue 0021122) + if not self.geom.IsSame( self.mesh.geom ) and not self.geom.GetStudyEntry(): + studyID = self.mesh.smeshpyD.GetCurrentStudy()._get_StudyId() + if studyID != self.mesh.geompyD.myStudyId: + self.mesh.geompyD.init_geom( self.mesh.smeshpyD.GetCurrentStudy()) + self.mesh.geompyD.addToStudyInFather( self.mesh.geom, self.geom, name ) pass self.subm = mesh.mesh.GetSubMesh(geom, algo.GetName()) - self.algo = algo status = mesh.mesh.AddHypothesis(self.geom, self.algo) TreatHypoStatus( status, algo.GetName(), name, True )