Salome HOME
Mantis issue 0020483: EDF 1117 SMESH,VISU: Mesh with descending connectivity is badly...
authorjfa <jfa@opencascade.com>
Fri, 25 Jan 2013 13:47:57 +0000 (13:47 +0000)
committerjfa <jfa@opencascade.com>
Fri, 25 Jan 2013 13:47:57 +0000 (13:47 +0000)
idl/SMESH_Mesh.idl
src/Driver/Driver_Mesh.h
src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
src/SMESHGUI/SMESH_msg_en.ts
src/SMESHGUI/SMESH_msg_fr.ts
src/SMESH_I/SMESH_Mesh_i.cxx

index 29c6a15393d57a1dfc90c34bc9f352afbe719919..33c775e38b96e36bd1f80cc43836185bb22d0275 100644 (file)
@@ -228,6 +228,7 @@ module SMESH
     DRS_WARN_RENUMBER,  // a MED file has overlapped ranges of element numbers,
                         // so the numbers from the file are ignored
     DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
+    DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity
     DRS_FAIL            // general failure (exception etc.)
   };
 
index fcaea2b3e6f0e54c4206aa30ee91d9a82ad918bb..a3629e497b86fae606efa71b07d221dafb10c329 100644 (file)
@@ -54,6 +54,7 @@ class MESHDRIVER_EXPORT Driver_Mesh
     DRS_WARN_RENUMBER,  // a file has overlapped ranges of element numbers,
                         // so the numbers from the file are ignored
     DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
+    DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity
     DRS_FAIL            // general failure (exception etc.)
   };
 
index 35caa0286e17d144444063469d93701754119c82..d6bb729e490d8eb5d3199cc8d564730f556bf676 100644 (file)
@@ -71,6 +71,7 @@ DriverMED_R_SMESHDS_Mesh
 ::Perform()
 {
   Status aResult = DRS_FAIL;
+  bool isDescConn = false;
 #ifndef _DEXCEPT_
   try{
 #endif
@@ -173,15 +174,26 @@ DriverMED_R_SMESHDS_Mesh
           }
         }
 
+        // Are there any MED cells in descending connectivity
+        //---------------------------------------------------
+        if (!isDescConn) {
+          MED::TEntityInfo aEntityInfoDesc = aMed->GetEntityInfo(aMeshInfo, eDESC);
+          MED::TEntityInfo::iterator anEntityIterDesc = aEntityInfoDesc.begin();
+          for (; anEntityIterDesc != aEntityInfoDesc.end() && !isDescConn; anEntityIterDesc++) {
+            const EEntiteMaillage& anEntity = anEntityIterDesc->first;
+            if (anEntity != eNOEUD) isDescConn = true;
+          }
+        }
+
         // Reading pre information about all MED cells
         //--------------------------------------------
         typedef MED::TVector<int> TNodeIds;
         bool takeNumbers = true;  // initially we trust the numbers from file
-        MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo);
+        MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo, eNOD);
         MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin();
-        for(; anEntityIter != aEntityInfo.end(); anEntityIter++){
+        for (; anEntityIter != aEntityInfo.end(); anEntityIter++) {
           const EEntiteMaillage& anEntity = anEntityIter->first;
-          if(anEntity == eNOEUD) continue;
+          if (anEntity == eNOEUD) continue;
           // Reading MED cells to the corresponding SMDS structure
           //------------------------------------------------------
           const MED::TGeom2Size& aGeom2Size = anEntityIter->second;
@@ -905,6 +917,12 @@ DriverMED_R_SMESHDS_Mesh
 #endif
   if (myMesh)
     myMesh->compactMesh();
+
+  if (aResult == DRS_OK && isDescConn) {
+    INFOS("There are some elements in descending connectivity in med file. They were not read !!!");
+    aResult = DRS_WARN_DESCENDING;
+  }
+
   if(MYDEBUG) MESSAGE("Perform - aResult status = "<<aResult);
   return aResult;
 }
index c0f36aa9fec5c89765535c4e49b4a7af96c5ecaa..aa1c2add025d9c05e674817d59c16810928ffbc1 100644 (file)
@@ -1478,6 +1478,10 @@ so that the application may crash. Do you wish to continue visualization?</trans
     </message>
     <message>
         <source>SMESH_DRS_4</source>
+        <translation type="unfinished">MED file contains some elements in descending connectivity. They were not read.</translation>
+    </message>
+    <message>
+        <source>SMESH_DRS_5</source>
         <translation>The file is incorrect, some data is missed</translation>
     </message>
     <message>
index 74dbb01254f9c427433f0c8c50164b8d3a264a3b..5345d612b8975a2b0f4075999a7ca1c7b8b77ef7 100755 (executable)
@@ -1450,6 +1450,10 @@ ce qui peut faire planter l&apos;application. Voulez-vous continuer la visualisa
     </message>
     <message>
         <source>SMESH_DRS_4</source>
+        <translation type="unfinished">MED file contains some elements in descending connectivity. They were not read.</translation>
+    </message>
+    <message>
+        <source>SMESH_DRS_5</source>
         <translation>Le fichier n&apos;est pas correct, des donnĂ©es sont manquantes</translation>
     </message>
     <message>
index dde636000a0009209bdfe78a2b7a62d9b30d66a7..cf844162374e6285040eda9a199d0916670d2919 100644 (file)
@@ -320,6 +320,8 @@ static SMESH::DriverMED_ReadStatus ConvertDriverMEDReadStatus (int theStatus)
     res = SMESH::DRS_WARN_RENUMBER; break;
   case DriverMED_R_SMESHDS_Mesh::DRS_WARN_SKIP_ELEM:
     res = SMESH::DRS_WARN_SKIP_ELEM; break;
+  case DriverMED_R_SMESHDS_Mesh::DRS_WARN_DESCENDING:
+    res = SMESH::DRS_WARN_DESCENDING; break;
   case DriverMED_R_SMESHDS_Mesh::DRS_FAIL:
   default:
     res = SMESH::DRS_FAIL; break;