Salome HOME
IMP: SMESH / CMake build procedure: Added the export of MEDFILE_ROOT_DIR to the confi...
[modules/smesh.git] / src / SMESH_I / SMESH_Mesh_i.cxx
index 979a572ad0a33b3222d59b8153a52831d4edc39a..812d3c0cdb83a5a751ef9fa17182ed741e66d24d 100644 (file)
@@ -2120,10 +2120,10 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone( SMESH::SMESH_GroupBase
 SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::createSubMesh( GEOM::GEOM_Object_ptr theSubShapeObject )
 {
   if(MYDEBUG) MESSAGE( "createSubMesh" );
-  TopoDS_Shape myLocSubShape = _gen_i->GeomObjectToShape(theSubShapeObject);
-  const int        subMeshId = _impl->GetMeshDS()->ShapeToIndex( myLocSubShape );
+  TopoDS_Shape  myLocSubShape = _gen_i->GeomObjectToShape(theSubShapeObject);
+  ::SMESH_subMesh * mySubMesh = _impl->GetSubMesh(myLocSubShape);
+  const int         subMeshId = mySubMesh->GetId();
 
-  ::SMESH_subMesh *      mySubMesh = _impl->GetSubMesh(myLocSubShape);
   SMESH_subMesh_i * subMeshServant = new SMESH_subMesh_i(myPOA, _gen_i, this, subMeshId);
   SMESH::SMESH_subMesh_var subMesh = subMeshServant->_this();
 
@@ -2710,7 +2710,7 @@ void SMESH_Mesh_i::ExportToMEDX (const char*        file,
                                  CORBA::Boolean     autoDimension)
   throw(SALOME::SALOME_Exception)
 {
-  Unexpect aCatch(SALOME_SalomeException);
+  SMESH_TRY;
   if ( _preMeshInfo )
     _preMeshInfo->FullLoadFromFile();
 
@@ -2721,6 +2721,8 @@ void SMESH_Mesh_i::ExportToMEDX (const char*        file,
                 << autoDimension << " )";
 
   _impl->ExportMED( file, aMeshName.c_str(), auto_groups, theVersion, 0, autoDimension );
+
+  SMESH_CATCH( SMESH::throwCorbaException );
 }
 
 //================================================================================