]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0021122: EDF 1735 SMESH: Bug when saving in .hdf
authoreap <eap@opencascade.com>
Thu, 3 Feb 2011 12:28:55 +0000 (12:28 +0000)
committereap <eap@opencascade.com>
Thu, 3 Feb 2011 12:28:55 +0000 (12:28 +0000)
   In Mesh_Algorithm.Assign(), add to study the not pubished sub-shape

src/SMESH_SWIG/smeshDC.py

index eb1f505730d0266d52b35b0f50034319b5d8629c..03598d6a2d1a7e8222436dbb26cb66bcaf14b1e5 100644 (file)
@@ -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 )