Salome HOME
First stable version after merging with V3_2_2
[modules/smesh.git] / src / DriverMED / DriverMED_R_SMESHDS_Mesh.cxx
index 7e7c9b6ae3baac5b3bbde3b42e76c32278382299..f87bd3f075bdb6ea0fd6bc2ae5d39ba2809ed5a7 100644 (file)
@@ -130,9 +130,11 @@ DriverMED_R_SMESHDS_Mesh
 
         // Reading MED nodes to the corresponding SMDS structure
        //------------------------------------------------------
-      PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
-       if(!aNodeInfo)
+        PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
+       if (!aNodeInfo) {
+          aResult = DRS_FAIL;
          continue;
+        }
 
        PCoordHelper aCoordHelper = GetCoordHelper(aNodeInfo);
 
@@ -915,18 +917,17 @@ bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
     for(MED::TInt iDim=0;iDim<aMeshDim;iDim++)
       aCoords[(int)iDim] = aMEDNodeCoord[(int)iDim];
     aNode = myMesh->AddNodeWithID(aCoords[0],aCoords[1],aCoords[2],(int)iNode);
-  }
 
-  /* not implemented FAMILY
-     
-  TInt aFamNum = aNodeInfo->GetFamNum(iElem);
-  if ( checkFamilyID ( aFamily, aFamNum ))
-    {
-      aFamily->AddElement(aNode);
-      aFamily->SetType(SMDSAbs_Node);
+    if((aGrilleInfo->myFamNumNode).size() > 0){
+      TInt aFamNum = aGrilleInfo->GetFamNumNode(iNode);
+      if ( checkFamilyID ( aFamily, aFamNum ))
+       {
+         aFamily->AddElement(aNode);
+         aFamily->SetType(SMDSAbs_Node);
+       }
     }
     
-  */
+  }
 
   SMDS_MeshElement* anElement = NULL;
   MED::TIntVector aNodeIds;
@@ -971,6 +972,14 @@ bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
     default:
       break;
     }
+    
+    if((aGrilleInfo->myFamNum).size() > 0){
+      TInt aFamNum = aGrilleInfo->GetFamNum(iCell);
+      if ( checkFamilyID ( aFamily, aFamNum )){
+       aFamily->AddElement(anElement);
+       aFamily->SetType(anElement->GetType());
+      }
+    }
   }
 
   return res;