Salome HOME
Fix regression of SALOME_TESTS/Grids/smesh/mesh_BLSURF_02/C6
[modules/smesh.git] / src / SMESH / SMESH_Mesh.cxx
index afefed35a9f660365e0443e00de9c2d45c66bbbe..226800af21610bc9887940fddf84c0fd719e3d5e 100644 (file)
@@ -361,6 +361,7 @@ double SMESH_Mesh::GetShapeDiagonalSize(const TopoDS_Shape & aShape)
     bool isPrecise = false;
     if ( nbFaces < maxNbFaces )
       try {
+        OCC_CATCH_SIGNALS;
         GEOMUtils::PreciseBoundingBox( aShape, Box );
         isPrecise = true;
       }
@@ -1193,8 +1194,8 @@ void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* h
   if ( !GetMeshDS()->IsUsedHypothesis( hyp ))
     return;
 
-  if (_callUp)
-    _callUp->HypothesisModified();
+  if (_callUp && hyp)
+    _callUp->HypothesisModified( hyp->GetID() );
 
   SMESH_Algo *algo;
   const SMESH_HypoFilter* compatibleHypoKind;
@@ -1347,8 +1348,8 @@ bool SMESH_Mesh::IsComputedOK()
   if ( NbNodes() == 0 )
     return false;
 
-  if ( !HasShapeToMesh() )
-    return true;
+  // if ( !HasShapeToMesh() )
+  //   return true;
 
   if ( SMESH_subMesh* mainSM = GetSubMeshContaining( 1 ))
   {
@@ -1402,6 +1403,10 @@ bool SMESH_Mesh::HasDuplicatedGroupNamesMED()
  *  \param [in] theAutoGroups - boolean parameter for creating/not creating
  *              the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
  *              the typical use is auto_groups=false.
+ *  \param [in] theMinor - define the minor version (y, where version is x.y.z) of MED file format.
+ *              The theMinor must be between 0 and the current minor version of MED file library.
+ *              If theMinor is equal to -1, the minor version is not changed (default).
+ *              The major version (x, where version is x.y.z) cannot be changed.
  *  \param [in] meshPart - mesh data to export
  *  \param [in] theAutoDimension - if \c true, a space dimension of a MED mesh can be either
      *         - 1D if all mesh nodes lie on OX coordinate axis, or
@@ -1417,6 +1422,7 @@ bool SMESH_Mesh::HasDuplicatedGroupNamesMED()
 void SMESH_Mesh::ExportMED(const char *        file, 
                            const char*         theMeshName, 
                            bool                theAutoGroups,
+                           int                 theMinor,
                            const SMESHDS_Mesh* meshPart,
                            bool                theAutoDimension,
                            bool                theAddODOnVertices,
@@ -1427,7 +1433,7 @@ void SMESH_Mesh::ExportMED(const char *        file,
   SMESH_TRY;
 
   DriverMED_W_SMESHDS_Mesh myWriter;
-  myWriter.SetFile         ( file );
+  myWriter.SetFile         ( file , theMinor);
   myWriter.SetMesh         ( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS   );
   myWriter.SetAutoDimension( theAutoDimension );
   myWriter.AddODOnVertices ( theAddODOnVertices );
@@ -1503,7 +1509,7 @@ void SMESH_Mesh::ExportSAUV(const char *file,
   cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')";
   cmd += "\"";
   system(cmd.c_str());
-  ExportMED(medfilename.c_str(), theMeshName, theAutoGroups,
+  ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, /*minor=*/-1,
             /*meshPart=*/NULL, /*theAutoDimension=*/false, /*theAddODOnVertices=*/false,
             /*theAllElemsToGroup=*/true ); // theAllElemsToGroup is for PAL0023413
 #ifdef WIN32