]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
The fix solve problem with NonRegression Test execition for 001/L0 -L7 cases.
authorapo <apo@opencascade.com>
Thu, 10 Feb 2005 13:17:38 +0000 (13:17 +0000)
committerapo <apo@opencascade.com>
Thu, 10 Feb 2005 13:17:38 +0000 (13:17 +0000)
src/VISU_I/VISU_CorbaMedConvertor.cxx
src/VISU_I/VISU_ViewManager_i.cc

index 464abb14e612b35ee67d465299488f2b7a443364..58e3d6ebf652058a11986675414de05206b6bd8c 100644 (file)
@@ -39,16 +39,21 @@ using namespace VISU;
 #define USER_INTERLACE MED_FULL_INTERLACE
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
 #else
 static int MYDEBUG = 0;
 #endif
 
 extern "C" {
-  VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) {
+  VISU_Convertor* 
+  CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) 
+  {
     return new VISU_MEDConvertor(theMedSObject);
   }
-  VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) {
+
+  VISU_Convertor* 
+  CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) 
+  {
     return new VISU_MEDFieldConvertor(theField);
   }
 }
@@ -278,14 +283,20 @@ namespace{
       vtkIdType aNbCells, aCellsSize;
       GetCellsSize(aNbCells,aCellsSize,theMEDMesh,CELL_ENTITY);
       if(aNbCells > 0){
-       PCMeshOnEntity aMeshOnCells = aMeshOnEntityMap[CELL_ENTITY];
-       aMeshOnCells->myEntity = VISU::CELL_ENTITY;
-       aMeshOnCells->myMeshName = theMesh->myName;
-       aMeshOnCells->myNbCells = aNbCells;
-       aMeshOnCells->myCellsSize = aCellsSize;
+       
+       TMeshOnEntityMap::iterator aIter = aMeshOnEntityMap.find(CELL_ENTITY);
+       if (aIter != aMeshOnEntityMap.end()){
+         VISU::PCMeshOnEntity aMeshOnCells = aIter->second;
+       
+         aMeshOnCells->myEntity = VISU::CELL_ENTITY;
+         aMeshOnCells->myMeshName = theMesh->myName;
+         aMeshOnCells->myNbCells = aNbCells;
+         aMeshOnCells->myCellsSize = aCellsSize;
+       }
       }
-    }else
+    }else{
       GetCellsSize(aMeshOnEntity->myNbCells,aMeshOnEntity->myCellsSize,theMEDMesh,theEntity);
+    }
   }
   
 }
@@ -471,6 +482,8 @@ VISU_MEDConvertor::Build(SALOME_MED::MED_ptr theMED)
   bool anIsSuccess = false;
   TSObjectByName::TRet aSObjectByNameRet = 
     Find(aMedCompSObj,aStudy,TSObjectByName("MEDMESH"),anIsSuccess);
+  if(MYDEBUG) 
+    MESSAGE("VISU_MEDConvertor::Build - Find ('"<<"MEDMESH"<<"') = "<<anIsSuccess);
   if(anIsSuccess){
     SALOMEDS::SObject_var aMeshesSObj = boost::get<0>(aSObjectByNameRet);
     for(int iMesh = 0; iMesh < aNbMeshes; iMesh++){
@@ -478,6 +491,8 @@ VISU_MEDConvertor::Build(SALOME_MED::MED_ptr theMED)
       CORBA::String_var aMeshName = aMeshNames[iMesh];
       TMeshByName::TRet aMeshByNameRet = 
        Find(aMeshesSObj,aStudy,TMeshByName(aMeshName.in()),anIsSuccess);
+      if(MYDEBUG) 
+       MESSAGE("VISU_MEDConvertor::Build - Find aMeshName('"<<aMeshName.in()<<"') = "<<anIsSuccess);
       if(!anIsSuccess)
        continue;
 
@@ -491,12 +506,17 @@ VISU_MEDConvertor::Build(SALOME_MED::MED_ptr theMED)
       if(MYDEBUG) 
        MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh->myDim);
 
+      std::string aName = aMeshName.in();
+      std::replace(aName.begin(),aName.end(),' ','_');
+
       anIsSuccess = false;
       std::ostringstream aStream;
-      aStream<<"MEDSUPPORTS_OF_"<<aMeshName.in();
+      aStream<<"MEDSUPPORTS_OF_"<<aName;
       std::string aSupportsName(aStream.str());
       TSObjectByName::TRet aSObjectByNameRet = 
        Find(aMeshesSObj,aStudy,TSObjectByName(aSupportsName.c_str()),anIsSuccess);
+      if(MYDEBUG) 
+       MESSAGE("VISU_MEDConvertor::Build - Find aSupportsName('"<<aSupportsName<<"') = "<<anIsSuccess);
       if(!anIsSuccess)
        continue;
 
@@ -609,14 +629,24 @@ VISU_MEDConvertor::Build(SALOME_MED::MED_ptr theMED)
          TGroupMap& aGroupMap = aMesh->myGroupMap;
          PCGroup aGroup = aGroupMap[aSupportName.in()](new TCGroup());
          aGroup->myGroup = aMEDGroup;
+         aGroup->myName = aSupportName.in();
+         aGroup->myMeshName = aMeshName.in();
+         VISU::TFamilyAndEntitySet& aFamilyAndEntitySet = aGroup->myFamilyAndEntitySet;
+
          SALOME_MED::Family_array_var aFamilies = aMEDGroup->getFamilies();
          int iFamilyEnd = aFamilies->length();
          for(int iFamaily = 0; iFamaily < iFamilyEnd; iFamaily++){
            SALOME_MED::FAMILY_var aMEDFamily = aFamilies[iFamaily];
            CORBA::String_var aFamilyName = aMEDFamily->getName();
-           if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"'");
            PFamily aFamily = FindFamily(aMesh,aFamilyName.in());
+           if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"' = "<<bool(aFamily));
            if(aFamily){
+             TFamilyAndEntity aFamilyAndEntity(aFamilyName.in(),aFamily->myEntity);
+             aFamilyAndEntitySet.insert(aFamilyAndEntity);
+
+             aGroup->myNbCells += aFamily->myNbCells;
+             aGroup->myCellsSize += aFamily->myCellsSize;
+
              VISU::TBindGroups& aBindGroups = aFamily->myGroups;
              aBindGroups.insert(aSupportName.in());
            }
@@ -739,14 +769,13 @@ VISU_MEDConvertor::Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator)
     aMesh->myName = aMeshName.in();
     aMesh->myNbPoints = aMEDMesh->getNumberOfNodes();
     aMesh->myMesh = aMEDMesh;
-    if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh->myDim);
+    if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<"'; myDim = "<<aMesh->myDim);
 
     TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
     PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMap[aVEntity](new TCMeshOnEntity());
     aMeshOnEntity->myEntity = aVEntity;
     aMeshOnEntity->myMeshName = aMeshName.in();
     aMeshOnEntity->mySupport = aMEDSupport;
-
     if(aVEntity == NODE_ENTITY){
       PCMeshOnEntity aMeshOnEntity2 = aMeshOnEntityMap[CELL_ENTITY](new TCMeshOnEntity());
       *aMeshOnEntity2 = *aMeshOnEntity;
@@ -759,7 +788,6 @@ VISU_MEDConvertor::Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator)
       GetCellsSize(aMesh,aMEDMesh,NODE_ENTITY);
     }
     GetCellsSize(aMesh,aMEDMesh,aVEntity);
-
     TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
     TFieldMap::iterator aFieldMapIter = aFieldMap.find(aFieldName.in());
     PCField aField;
@@ -777,7 +805,6 @@ VISU_MEDConvertor::Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator)
       aField->myCompNames.resize(aField->myNbComp);
       aField->myUnitNames.resize(aField->myNbComp);
     }
-    
     TValField& aValField = aField->myValField;
     int anId = aMEDField->getIterationNumber();
     PCValForTime aValForTime = aValField[anId](new TCValForTime());
index 6639b6b6476c9a012c6fef0fb2836bd934826440..53950f0b30b83234d544a01267507318e88765b0 100644 (file)
@@ -424,8 +424,11 @@ namespace VISU{
       try{
        anVISUActor = thePrs->CreateActor();
        vf->AddActor(anVISUActor);
-      }catch(std::runtime_error& exc){
-       INFOS(exc.what());
+      }catch(std::exception& exc){
+       if(MYDEBUG) INFOS(exc.what());
+       return NULL;
+      }catch(...){
+       if(MYDEBUG) INFOS("Unknown exception was occured!!!");
        return NULL;
       }
     }