]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix on [Bug PAL7948] Post-Pro REGR: Import from File fails
authorapo <apo@opencascade.com>
Tue, 1 Feb 2005 11:31:13 +0000 (11:31 +0000)
committerapo <apo@opencascade.com>
Tue, 1 Feb 2005 11:31:13 +0000 (11:31 +0000)
Was caused by RTTI failure during dll-loading of SMESH component

src/CONVERTOR/VISU_MedConvertor.cxx

index a0434a30cd6c652ee092178ee109bccc9343be28..15fbf9f7f78011b6306d69da9d901d3f0992f191 100644 (file)
@@ -159,30 +159,15 @@ VISU_Convertor* VISU_MedConvertor::Build()  {
     try{
       MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
       
+      MED::PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
+      
       MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo);
       
       MED::TElemGroup anElemGroup = GetElemsByEntity(aMed,aMeshInfo,aEntityInfo);
 
-      // Find PNodeInfo
-      MED::TElemGroup::const_iterator anElemGroupIter = anElemGroup.find(MED::eNOEUD);
-      if(anElemGroupIter == anElemGroup.end())
-       continue;
-
-      const MED::TElemMap& anElemMap = anElemGroupIter->second;
-      MED::TElemMap::const_iterator anElemMapIter = anElemMap.find(MED::ePOINT1);
-      if(anElemMapIter == anElemMap.end())
-       continue;
-
-      MED::PNodeInfo aNodeInfo(anElemMapIter->second);
-
-      // creating TMesh structure and TMeshOnEntityMap
-      typedef std::map<TInt,TInt> TFamilyCounterMap;
-      TFamilyCounterMap aFamilyNbCellsCounterMap, aFamilyCellsSizeCounterMap;
-      TFamilyCounterMap aFamilyNbPolygonesCounterMap, aFamilyPolygonesSizeCounterMap;
-
       MED::TInt aDim = aMeshInfo->GetDim();
       std::string aMeshName = aMeshInfo->GetName();
-    
+
       VISU::PMEDMesh aMesh = myMeshMap[aMeshName](new VISU::TMEDMesh());
       aMesh->myDim = aDim;
       aMesh->myName = aMeshName;
@@ -196,8 +181,12 @@ VISU_Convertor* VISU_MedConvertor::Build()  {
       
       BEGMSG(MYDEBUG,"aEntityInfo.size() = "<<aEntityInfo.size()<<"\n");
 
+      typedef std::map<TInt,TInt> TFamilyCounterMap;
+      TFamilyCounterMap aFamilyNbCellsCounterMap, aFamilyCellsSizeCounterMap;
+      TFamilyCounterMap aFamilyNbPolygonesCounterMap, aFamilyPolygonesSizeCounterMap;
+
       VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
-      anElemGroupIter = anElemGroup.begin();
+      MED::TElemGroup::const_iterator anElemGroupIter = anElemGroup.begin();
       for(; anElemGroupIter != anElemGroup.end(); anElemGroupIter++){
        const MED::EEntiteMaillage& aMEntity = anElemGroupIter->first;
        const MED::TElemMap& anElemMap = anElemGroupIter->second;
@@ -225,18 +214,19 @@ VISU_Convertor* VISU_MedConvertor::Build()  {
 
          INITMSG(MYDEBUG,"myNbCells = "<<aMeshOnEntity->myNbCells<<
                  "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<"\n");;
-
+         
        }else{
          aMeshOnEntity->myNbCells = 0;
          aMeshOnEntity->myCellsSize = 0;
-         anElemMapIter = anElemMap.begin();
+         MED::TElemMap::const_iterator anElemMapIter = anElemMap.begin();
          for(; anElemMapIter != anElemMap.end(); anElemMapIter++){
            const MED::EGeometrieElement& aGeom = anElemMapIter->first;
            MED::PElemInfo anElemInfo = anElemMapIter->second;
            
            switch(aGeom){
            case MED::ePOLYGONE: {
-             MED::PPolygoneInfo aPolygoneInfo(anElemInfo);
+             MED::PPolygoneInfo aPolygoneInfo = 
+               aMed->GetPPolygoneInfo(aMeshInfo,aMEntity,MED::ePOLYGONE);
              MED::TInt aNbElem = aPolygoneInfo->GetNbElem();
              MED::TElemNum aConn  = aPolygoneInfo->GetConnectivite();
              MED::TElemNum aIndex = aPolygoneInfo->GetIndex();
@@ -264,7 +254,7 @@ VISU_Convertor* VISU_MedConvertor::Build()  {
            }
            default: {
              int aVNbNodes = VTKGeom2NbNodes(MEDGeomToVTK(aGeom));
-             MED::PCellInfo aCellInfo(anElemInfo);
+             MED::PCellInfo aCellInfo = aMed->GetPCellInfo(aMeshInfo,aMEntity,aGeom);
              MED::TInt aNbElem = aCellInfo->GetNbElem();
              aMeshOnEntity->myNbCells += aNbElem;
              aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
@@ -346,7 +336,7 @@ VISU_Convertor* VISU_MedConvertor::Build()  {
        const MED::TFamilyGroup& aFamilyGroup = aGroupInfoIter->second;
        VISU::PMEDGroup aGroup(new TMEDGroup());
        aGroup->myName = aGroupName;
-       aGroup->myMeshName = aMesh->myName;
+       aGroup->myMeshName = aMeshName;
        
        INITMSG(MYDEBUG,"aGroup->myName = '"<<aGroup->myName<<"'\n");
        
@@ -450,7 +440,7 @@ VISU_Convertor* VISU_MedConvertor::Build()  {
        }
       }
     }catch (std::exception& exc){
-      MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+      throw;
     }catch(...){
       EXCEPTION(runtime_error,"Unknown exception !!!");
     }