Salome HOME
Merge from V6_2_BR 23/12/2010
[modules/visu.git] / src / VISU_I / VISU_CorbaMedConvertor.cxx
index 62e1243295236e22b3f105a59957b0b73fe5c9a2..85870069b4ad9aa7f9fee15ac2652775feb84318 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -19,6 +19,7 @@
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  VISU OBJECT : interactive object for VISU entities implementation
 //  File   : VISU_CorbaMedConvertor.cxx
 //  Author : Alexey PETROV
@@ -114,7 +115,7 @@ namespace
   //---------------------------------------------------------------
   int
   GetEntity2Geom(const VISU::TEntity& theEntity, 
-                SALOME_MED::medGeometryElement*& theVector)
+                 SALOME_MED::medGeometryElement*& theVector)
   {
     switch(theEntity){
     case VISU::CELL_ENTITY: 
@@ -342,9 +343,9 @@ namespace
   //---------------------------------------------------------------
   void 
   GetCellsSize(vtkIdType& theNbCells, 
-              vtkIdType& theCellsSize,
-              SALOME_MED::MESH_ptr theMEDMesh,
-              const VISU::TEntity& theVEntity)
+               vtkIdType& theCellsSize,
+               SALOME_MED::MESH_ptr theMEDMesh,
+               const VISU::TEntity& theVEntity)
   {
     theNbCells = theCellsSize = 0;
     if(MYDEBUG) MESSAGE("GetCellsSize - theVEntity = "<<theVEntity);
@@ -354,9 +355,9 @@ namespace
     for(int iGeom = 0; iGeom < iGeomEnd; iGeom++){
       int iNumElemEnd = connInfo->numberOfElements[iGeom];
       if(iNumElemEnd > 0){
-       if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
-       theCellsSize += iNumElemEnd + connInfo->nodalConnectivityLength[iGeom];
-       theNbCells += iNumElemEnd;
+        if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
+        theCellsSize += iNumElemEnd + connInfo->nodalConnectivityLength[iGeom];
+        theNbCells += iNumElemEnd;
       }
     }
   }
@@ -365,8 +366,8 @@ namespace
   //---------------------------------------------------------------
   void 
   GetCellsSize(vtkIdType& theNbCells, 
-              vtkIdType& theCellsSize,
-              SALOME_MED::FAMILY_ptr theMEDFamily)
+               vtkIdType& theCellsSize,
+               SALOME_MED::FAMILY_ptr theMEDFamily)
   {
     theNbCells = theCellsSize = 0;
     SALOME_MED::SUPPORT::supportInfos_var suppInfo=theMEDFamily->getSupportGlobal();
@@ -375,9 +376,9 @@ namespace
     for(int iGeom = 0; iGeom < iGeomEnd; iGeom++) {
       int iNumElemEnd = suppInfo->nbEltTypes[iGeom];
       if(iNumElemEnd > 0){
-       if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
-       theNbCells += iNumElemEnd;
-       theCellsSize += iNumElemEnd + suppInfo->nodalConnectivityLength[iGeom];
+        if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
+        theNbCells += iNumElemEnd;
+        theCellsSize += iNumElemEnd + suppInfo->nodalConnectivityLength[iGeom];
       }
     }
   }
@@ -386,8 +387,8 @@ namespace
   //---------------------------------------------------------------
   void
   GetCellsSize(VISU::PCMesh theMesh, 
-              SALOME_MED::MESH_ptr theMEDMesh, 
-              const VISU::TEntity& theEntity)
+               SALOME_MED::MESH_ptr theMEDMesh, 
+               const VISU::TEntity& theEntity)
   {
     VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
     VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMap[theEntity];
@@ -403,8 +404,8 @@ namespace
   //---------------------------------------------------------------
   VISU::PCMeshOnEntity 
   InitMeshOnEntity(const VISU::PCMesh& theMesh,
-                  const VISU::TEntity& theEntity,
-                  const VISU::PCMeshOnEntity& theMeshOnEntity)
+                   const VISU::TEntity& theEntity,
+                   const VISU::PCMeshOnEntity& theMeshOnEntity)
   {
     VISU::PCMeshOnEntity aMeshOnEntity;
     VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
@@ -425,10 +426,10 @@ namespace
   
   VISU::PCSubProfile
   CrSubProfile(const VISU::PCMesh theMesh,
-              const VISU::PCField theField,
-              const VISU::TCMeshOnEntity& theMeshOnEntity,
-              SALOME_MED::medGeometryElement theMGeom,
-              int theNbElems)
+               const VISU::PCField theField,
+               const VISU::TCMeshOnEntity& theMeshOnEntity,
+               SALOME_MED::medGeometryElement theMGeom,
+               int theNbElems)
   {
     if (MYDEBUG) MESSAGE("CrSubProfile");
     VISU::EGeometry aEGeom = MEDGeom2VISU(theMGeom);
@@ -446,20 +447,20 @@ namespace
       aSubProfile->myStatus = VISU::eRemoveAll;
     else if(aTimeStampIter == aCellsFirstIndex.end() && theMGeom == SALOME_MED::MED_POINT1){
       if(theNbElems > 0){
-       aSubProfile->myName = "";
-       aSubProfile->myStatus = VISU::eAddPart;
-       
-       aSubProfile->myNbCells = theNbElems;
-       aSubProfile->myCellsSize = aSubProfile->myNbCells;
+        aSubProfile->myName = "";
+        aSubProfile->myStatus = VISU::eAddPart;
+        
+        aSubProfile->myNbCells = theNbElems;
+        aSubProfile->myCellsSize = aSubProfile->myNbCells;
       }
     }else{
-       if(theNbElems > 0){
-         aSubProfile->myName = "";
-         aSubProfile->myStatus = VISU::eAddPart;
-         
-         aSubProfile->myNbCells = theNbElems;
-         aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
-       }
+        if(theNbElems > 0){
+          aSubProfile->myName = "";
+          aSubProfile->myStatus = VISU::eAddPart;
+          
+          aSubProfile->myNbCells = theNbElems;
+          aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
+        }
       }
     
     if (MYDEBUG) MESSAGE("CrSubProfile done");
@@ -468,9 +469,9 @@ namespace
 
   VISU::TProfileKey
   GetProfileKey(const VISU::PCMesh theMesh,
-               const VISU::PCField theField,
-               const VISU::PCValForTime theValForTime,
-               const VISU::TCMeshOnEntity& theMeshOnEntity)
+                const VISU::PCField theField,
+                const VISU::PCValForTime theValForTime,
+                const VISU::TCMeshOnEntity& theMeshOnEntity)
   {
     if (MYDEBUG) MESSAGE("GetProfileKey");
 
@@ -483,34 +484,34 @@ namespace
     if(anIter == aFirstIndex.end() && aSupport->getEntity() == SALOME_MED::MED_NODE){
       SALOME_MED::medGeometryElement aMGeom = SALOME_MED::MED_POINT1;
       try{
-       aNbElems = aSupport->getNumberOfElements(SALOME_MED::MED_NONE);
-       if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<"   aNbElems="<<aNbElems);
+        aNbElems = aSupport->getNumberOfElements(SALOME_MED::MED_NONE);
+        if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<"   aNbElems="<<aNbElems);
       }catch(...){
-       MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
+        MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
       }
-       
+        
       VISU::PCSubProfile aSubProfile = CrSubProfile(theMesh,
-                                                   theField,
-                                                   theMeshOnEntity,
-                                                   aMGeom,
-                                                   aNbElems);
+                                                    theField,
+                                                    theMeshOnEntity,
+                                                    aMGeom,
+                                                    aNbElems);
       aProfileKey.insert(aSubProfile);
     }
     
     for(; anIter != aFirstIndex.end(); anIter++){
       SALOME_MED::medGeometryElement aMGeom = anIter->first;
       try{
-       aNbElems = aSupport->getNumberOfElements(aMGeom);
-       if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<"   aNbElems="<<aNbElems);
-      }        catch(...){
-       MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
-       continue;
+        aNbElems = aSupport->getNumberOfElements(aMGeom);
+        if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<"   aNbElems="<<aNbElems);
+      } catch(...){
+        MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
+        continue;
       }
       VISU::PCSubProfile aSubProfile = CrSubProfile(theMesh,
-                                                   theField,
-                                                   theMeshOnEntity,
-                                                   aMGeom,
-                                                   aNbElems);
+                                                    theField,
+                                                    theMeshOnEntity,
+                                                    aMGeom,
+                                                    aNbElems);
       aProfileKey.insert(aSubProfile);
     }
 
@@ -520,18 +521,18 @@ namespace
   
   void
   InitProfile(VISU::PCMesh theMesh,
-             VISU::PCField theField,
-             VISU::PCValForTime theValForTime,
-             VISU::TCMeshOnEntity& theMeshOnEntity)
+              VISU::PCField theField,
+              VISU::PCValForTime theValForTime,
+              VISU::TCMeshOnEntity& theMeshOnEntity)
   {
     if (MYDEBUG) MESSAGE("InitProfile");
     
     VISU::TProfileMap& aProfileMap = theMeshOnEntity.myProfileMap;
 
     VISU::TProfileKey aProfileKey = GetProfileKey(theMesh,
-                                                 theField,
-                                                 theValForTime,
-                                                 theMeshOnEntity);
+                                                  theField,
+                                                  theValForTime,
+                                                  theMeshOnEntity);
     
     VISU::TProfileMap::const_iterator anIter = aProfileMap.find(aProfileKey);
     if(anIter != aProfileMap.end()){
@@ -543,13 +544,13 @@ namespace
       
       VISU::TProfileKey::const_iterator anIter = aProfileKey.begin();
       for(; anIter != aProfileKey.end(); anIter++){
-       VISU::PCSubProfile aSubProfile(*anIter);
-       
-       if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll)
-         aProfile->myIsAll = false;
-       
-       VISU::EGeometry aEGeom = aSubProfile->myGeom;
-       aGeom2SubProfile[aEGeom] = aSubProfile;
+        VISU::PCSubProfile aSubProfile(*anIter);
+        
+        if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll)
+          aProfile->myIsAll = false;
+        
+        VISU::EGeometry aEGeom = aSubProfile->myGeom;
+        aGeom2SubProfile[aEGeom] = aSubProfile;
       }
       
       aProfileMap[aProfileKey] = aProfile;
@@ -560,9 +561,9 @@ namespace
 
   void
   LoadProfile(VISU::PCMesh theMesh,
-             VISU::PCField theField,
-             VISU::PCValForTime theValForTime,
-             VISU::PCMeshOnEntity theMeshOnEntity)
+              VISU::PCField theField,
+              VISU::PCValForTime theValForTime,
+              VISU::PCMeshOnEntity theMeshOnEntity)
   {
     VISU::PCProfile aProfile = theValForTime->myProfile;
     if (MYDEBUG) MESSAGE("LoadProfile aProfile->myIsDone="<<aProfile->myIsDone);
@@ -579,38 +580,38 @@ namespace
       VISU::EGeometry aEGeom = aGeom2SubProfileIter->first;
       SALOME_MED::medGeometryElement aMGeom = VISUGeomToMED(aEGeom);
       VISU::PCSubProfile aSubProfile = aGeom2SubProfileIter->second;
-      SALOME_MED::long_array_var aGeom2ProfileIds;
+      SALOME_TYPES::ListOfLong_var aGeom2ProfileIds;
       std::vector<int> aGeom2Profile;
       if(!aSupport->isOnAllElements()){
-       try{
-         if(aMGeom == SALOME_MED::MED_POINT1)
-           aGeom2ProfileIds = aSupport->getNumberFromFile(SALOME_MED::MED_NONE);
-         else
-           aGeom2ProfileIds = aSupport->getNumberFromFile(aMGeom);
-         int aLen = aGeom2ProfileIds->length();
-         if(MYDEBUG) MESSAGE_BEGIN(" - aMGeom="<<aMGeom<<"; aNbCells="<<aLen);
-         for(int i = 0; i < aLen; i++){
-           int anId = aGeom2ProfileIds[i];
-           aGeom2Profile.push_back(anId);
-           if(MYDEBUG) MESSAGE_ADD(std::endl << "------------------------------->" << anId);
-         }
-         if(MYDEBUG) MESSAGE_END(" ");
-       } catch(...) {
-         continue;
-       }
+        try{
+          if(aMGeom == SALOME_MED::MED_POINT1)
+            aGeom2ProfileIds = aSupport->getNumberFromFile(SALOME_MED::MED_NONE);
+          else
+            aGeom2ProfileIds = aSupport->getNumberFromFile(aMGeom);
+          int aLen = aGeom2ProfileIds->length();
+          if(MYDEBUG) MESSAGE_BEGIN(" - aMGeom="<<aMGeom<<"; aNbCells="<<aLen);
+          for(int i = 0; i < aLen; i++){
+            int anId = aGeom2ProfileIds[i];
+            aGeom2Profile.push_back(anId);
+            if(MYDEBUG) MESSAGE_ADD(std::endl << "------------------------------->" << anId);
+          }
+          if(MYDEBUG) MESSAGE_END(" ");
+        } catch(...) {
+          continue;
+        }
       } else {
-       SALOME_MED::medEntityMesh aMEntity = aSupport->getEntity();
-       int aNbElems = theMesh->myMesh->getNumberOfElements(aMEntity,aMGeom);
-       for(int i = 0; i < aNbElems; i++) 
-         aGeom2Profile.push_back(i+1);
+        SALOME_MED::medEntityMesh aMEntity = aSupport->getEntity();
+        int aNbElems = theMesh->myMesh->getNumberOfElements(aMEntity,aMGeom);
+        for(int i = 0; i < aNbElems; i++) 
+          aGeom2Profile.push_back(i+1);
       }
       if(aGeom2Profile.size()>0){
-       VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
-       int aSize = aGeom2Profile.size();
-       aSubMeshID.resize(aSize);
-       for(int anId = 0; anId < aSize; anId++){
-         aSubMeshID[anId] = aGeom2Profile[anId] - 1;
-       }
+        VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
+        int aSize = aGeom2Profile.size();
+        aSubMeshID.resize(aSize);
+        for(int anId = 0; anId < aSize; anId++){
+          aSubMeshID[anId] = aGeom2Profile[anId] - 1;
+        }
       }
     }
     
@@ -697,7 +698,7 @@ VISU_MEDFieldConvertor
 
   if(MYDEBUG) 
     MESSAGE("VISU_MEDFieldConvertor::Build - aFieldName = '"<<aFieldName<<
-           "'; myId = "<<anId<<"; myTime = "<<aDT);
+            "'; myId = "<<anId<<"; myTime = "<<aDT);
 
   return this;
 }
@@ -741,11 +742,11 @@ namespace
     {
       SALOMEDS::GenericAttribute_var anAttr;
       if(theSObj->FindAttribute(anAttr,"AttributeName")){
-       SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
-       CORBA::String_var aValue = aName->Value();
-       theIsSuccess = (myName == aValue.in());
-       if(theIsSuccess)
-         return TRet(SALOMEDS::SObject::_duplicate(theSObj));
+        SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
+        CORBA::String_var aValue = aName->Value();
+        theIsSuccess = (myName == aValue.in());
+        if(theIsSuccess)
+          return TRet(SALOMEDS::SObject::_duplicate(theSObj));
       }
       return TRet();
     }
@@ -767,13 +768,13 @@ namespace
     {
       CORBA::Object_var anObj = VISU::SObjectToObject(theSObj);
       if(!CORBA::is_nil(anObj)){
-       SALOME_MED::MESH_var aMesh = SALOME_MED::MESH::_narrow(anObj);
-       if(!CORBA::is_nil(aMesh)){
-         CORBA::String_var aName = aMesh->getName();
-         theIsSuccess = (myName == aName.in());
-         if(theIsSuccess)
-           return TRet(aMesh,SALOMEDS::SObject::_duplicate(theSObj));
-       }
+        SALOME_MED::MESH_var aMesh = SALOME_MED::MESH::_narrow(anObj);
+        if(!CORBA::is_nil(aMesh)){
+          CORBA::String_var aName = aMesh->getName();
+          theIsSuccess = (myName == aName.in());
+          if(theIsSuccess)
+            return TRet(aMesh,SALOMEDS::SObject::_duplicate(theSObj));
+        }
       }
       return TRet();
     }
@@ -795,7 +796,7 @@ namespace
       SALOMEDS::SObject_var aSObj = anIter->Value();
       typename TFun::TRet aRet = theFun(aSObj,theIsSuccess);
       if(theIsSuccess)
-       return aRet;
+        return aRet;
     }
     return typename TFun::TRet();
   }
@@ -812,7 +813,7 @@ VISU_MEDConvertor
     return NULL;
 
   CORBA::Long aNbMeshes = theMED->getNumberOfMeshes();
-  SALOME_MED::string_array_var aMeshNames = theMED->getMeshNames();
+  SALOME_TYPES::ListOfString_var aMeshNames = theMED->getMeshNames();
   if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aNbMeshes = "<<aNbMeshes);
 
   SALOMEDS::Study_var aStudy = mySObject->GetStudy();
@@ -829,11 +830,11 @@ VISU_MEDConvertor
       anIsSuccess = false;
       CORBA::String_var aMeshName = aMeshNames[iMesh];
       TMeshByName::TRet aMeshByNameRet = 
-       Find(aMeshesSObj,aStudy,TMeshByName(aMeshName.in()),anIsSuccess);
+        Find(aMeshesSObj,aStudy,TMeshByName(aMeshName.in()),anIsSuccess);
       if(MYDEBUG) 
-       MESSAGE("VISU_MEDConvertor::Build - Find aMeshName('"<<aMeshName.in()<<"') = "<<anIsSuccess);
+        MESSAGE("VISU_MEDConvertor::Build - Find aMeshName('"<<aMeshName.in()<<"') = "<<anIsSuccess);
       if(!anIsSuccess)
-       continue;
+        continue;
 
       VISU::PCMesh aMesh = myMeshMap[aMeshName.in()](new VISU::TCMesh());
       SALOME_MED::MESH_var aMEDMesh = boost::get<0>(aMeshByNameRet);
@@ -844,7 +845,7 @@ VISU_MEDConvertor
       aMesh->myMesh = aMEDMesh;
 
       if(MYDEBUG) 
-       MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh->myDim);
+        MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh->myDim);
 
       std::string aName = aMeshName.in();
       std::replace(aName.begin(),aName.end(),' ','_');
@@ -854,11 +855,11 @@ VISU_MEDConvertor
       aStream<<"MEDSUPPORTS_OF_"<<aName;
       std::string aSupportsName(aStream.str());
       TSObjectByName::TRet aSObjectByNameRet = 
-       Find(aMeshesSObj,aStudy,TSObjectByName(aSupportsName.c_str()),anIsSuccess);
+        Find(aMeshesSObj,aStudy,TSObjectByName(aSupportsName.c_str()),anIsSuccess);
       if(MYDEBUG) 
-       MESSAGE("VISU_MEDConvertor::Build - Find aSupportsName('"<<aSupportsName<<"') = "<<anIsSuccess);
+        MESSAGE("VISU_MEDConvertor::Build - Find aSupportsName('"<<aSupportsName<<"') = "<<anIsSuccess);
       if(!anIsSuccess)
-       continue;
+        continue;
 
       VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
       SALOMEDS::SObject_var aSupportsSObj = boost::get<0>(aSObjectByNameRet);
@@ -867,154 +868,154 @@ VISU_MEDConvertor
       // Fill all MeshOnEntity
       aSupportIterator->InitEx(true);
       for(; aSupportIterator->More(); aSupportIterator->Next()){
-       SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
-       
-       CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
-       if(CORBA::is_nil(aMedSupport)) 
-         continue;
-       
-       SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport); 
-       if(aMEDSupport->_is_nil()) 
-         continue;
-       
-       SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
-       SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
-       VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
-       CORBA::String_var aSupportName = aMEDSupport->getName();
-       
-       if(aMEDSupport->isOnAllElements() && strcmp(aSupportName.in(),"SupportOnAll_MED_") > 0){
-         if(MYDEBUG) 
-           MESSAGE("VISU_MEDConvertor::Build - Support isOnAllElements = '"<<aSupportName<<
-                   "' aVEntity = "<<aVEntity);
-         vtkIdType aNbCells, aCellsSize;
-         //Check, if there is any data on the support?
-         if(aVEntity == VISU::NODE_ENTITY){
-           aMesh->myNbPoints = aMeshOnSupport->getNumberOfNodes();
-           aNbCells = aMesh->myNbPoints;
-           aCellsSize = 2*aMesh->myNbPoints;
-         }else
-           ::GetCellsSize(aNbCells,aCellsSize,aMeshOnSupport,aVEntity);
-         
-         if(aNbCells > 0){
-           if(aMeshOnEntityMap.find(aVEntity) == aMeshOnEntityMap.end()){
-             VISU::PCMeshOnEntity aMeshOnEntity(new VISU::TCMeshOnEntity());
-             aMeshOnEntity->myMeshName = aMeshName.in();
-             aMeshOnEntity->myEntity = aVEntity;
-             aMeshOnEntity->myNbCells = aNbCells;
-             aMeshOnEntity->myCellsSize = aCellsSize;
-             aMeshOnEntity->mySupport = aMEDSupport;
-             aMeshOnEntityMap[aVEntity] = aMeshOnEntity;
-           }
-         }
-       }
+        SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
+        
+        CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
+        if(CORBA::is_nil(aMedSupport)) 
+          continue;
+        
+        SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport); 
+        if(aMEDSupport->_is_nil()) 
+          continue;
+        
+        SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
+        SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
+        VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
+        CORBA::String_var aSupportName = aMEDSupport->getName();
+        
+        if(aMEDSupport->isOnAllElements() && strcmp(aSupportName.in(),"SupportOnAll_MED_") > 0){
+          if(MYDEBUG) 
+            MESSAGE("VISU_MEDConvertor::Build - Support isOnAllElements = '"<<aSupportName<<
+                    "' aVEntity = "<<aVEntity);
+          vtkIdType aNbCells, aCellsSize;
+          //Check, if there is any data on the support?
+          if(aVEntity == VISU::NODE_ENTITY){
+            aMesh->myNbPoints = aMeshOnSupport->getNumberOfNodes();
+            aNbCells = aMesh->myNbPoints;
+            aCellsSize = 2*aMesh->myNbPoints;
+          }else
+            ::GetCellsSize(aNbCells,aCellsSize,aMeshOnSupport,aVEntity);
+          
+          if(aNbCells > 0){
+            if(aMeshOnEntityMap.find(aVEntity) == aMeshOnEntityMap.end()){
+              VISU::PCMeshOnEntity aMeshOnEntity(new VISU::TCMeshOnEntity());
+              aMeshOnEntity->myMeshName = aMeshName.in();
+              aMeshOnEntity->myEntity = aVEntity;
+              aMeshOnEntity->myNbCells = aNbCells;
+              aMeshOnEntity->myCellsSize = aCellsSize;
+              aMeshOnEntity->mySupport = aMEDSupport;
+              aMeshOnEntityMap[aVEntity] = aMeshOnEntity;
+            }
+          }
+        }
       }
 
       // Fill all Family
       aSupportIterator->InitEx(true);
       for(; aSupportIterator->More(); aSupportIterator->Next()){
-       SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
-       
-       CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
-       if(CORBA::is_nil(aMedSupport)) 
-         continue;
-       
-       SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport); 
-       if(aMEDSupport->_is_nil()) 
-         continue;
-       
-       SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
-       SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
-       VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
-       CORBA::String_var aSupportName = aMEDSupport->getName();
-       
-       SALOME_MED::FAMILY_var aMEDFamily = SALOME_MED::FAMILY::_narrow(aMedSupport);
-       if(!aMEDFamily->_is_nil()) {
-         VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(aVEntity);
-         if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
-           continue;
-         VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
-
-         vtkIdType aNbCells = aMeshOnEntity->myNbCells, aCellsSize = aMeshOnEntity->myCellsSize;
-         CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
-         if(!anIsOnAllElements)
-           ::GetCellsSize(aNbCells,aCellsSize,aMEDFamily);
-
-         if(MYDEBUG) 
-           MESSAGE("VISU_MEDConvertor::Build "<<
-                   "- aFamily = '"<<aSupportName<<"'"<<
-                   "; anIsOnAllElements = "<<anIsOnAllElements<<
-                   "; aVEntity = "<<aVEntity<<
-                   "; aNbCells = "<<aNbCells);
-
-         if(aNbCells > 0){
-           VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
-           VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.find(aSupportName.in());
-           if(aFamilyMapIter == aFamilyMap.end()){
-             VISU::PCFamily aFamily(new VISU::TCFamily());
-             aFamily->myEntity = aVEntity;
-             aFamily->myNbCells = aNbCells;
-             aFamily->myCellsSize = aCellsSize;
-             aFamily->myId = aMEDFamily->getIdentifier();
-             aFamily->myName = aSupportName.in();
-             aFamily->myFamily = aMEDFamily;
-             aFamilyMap[aSupportName.in()] = aFamily;
-           }
-         }
-       }
+        SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
+        
+        CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
+        if(CORBA::is_nil(aMedSupport)) 
+          continue;
+        
+        SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport); 
+        if(aMEDSupport->_is_nil()) 
+          continue;
+        
+        SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
+        SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
+        VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
+        CORBA::String_var aSupportName = aMEDSupport->getName();
+        
+        SALOME_MED::FAMILY_var aMEDFamily = SALOME_MED::FAMILY::_narrow(aMedSupport);
+        if(!aMEDFamily->_is_nil()) {
+          VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(aVEntity);
+          if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
+            continue;
+          VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
+
+          vtkIdType aNbCells = aMeshOnEntity->myNbCells, aCellsSize = aMeshOnEntity->myCellsSize;
+          CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
+          if(!anIsOnAllElements)
+            ::GetCellsSize(aNbCells,aCellsSize,aMEDFamily);
+
+          if(MYDEBUG) 
+            MESSAGE("VISU_MEDConvertor::Build "<<
+                    "- aFamily = '"<<aSupportName<<"'"<<
+                    "; anIsOnAllElements = "<<anIsOnAllElements<<
+                    "; aVEntity = "<<aVEntity<<
+                    "; aNbCells = "<<aNbCells);
+
+          if(aNbCells > 0){
+            VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+            VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.find(aSupportName.in());
+            if(aFamilyMapIter == aFamilyMap.end()){
+              VISU::PCFamily aFamily(new VISU::TCFamily());
+              aFamily->myEntity = aVEntity;
+              aFamily->myNbCells = aNbCells;
+              aFamily->myCellsSize = aCellsSize;
+              aFamily->myId = aMEDFamily->getIdentifier();
+              aFamily->myName = aSupportName.in();
+              aFamily->myFamily = aMEDFamily;
+              aFamilyMap[aSupportName.in()] = aFamily;
+            }
+          }
+        }
       }
-       
+        
       // Fill all Groups
       aSupportIterator->InitEx(true);
       for(; aSupportIterator->More(); aSupportIterator->Next()){
-       SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
-       
-       CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
-       if(CORBA::is_nil(aMedSupport)) 
-         continue;
-       
-       SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport); 
-       if(aMEDSupport->_is_nil()) 
-         continue;
-       
-       SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
-       SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
-       VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
-       CORBA::String_var aSupportName = aMEDSupport->getName();
-       
-       SALOME_MED::GROUP_var aMEDGroup = SALOME_MED::GROUP::_narrow(aMedSupport);
-       if(!aMEDGroup->_is_nil()){
-         CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
-
-         if(MYDEBUG) 
-           MESSAGE("VISU_MEDConvertor::Build "<<
-                   "- aGroup = '"<<aSupportName<<"'"<<
-                   "; anIsOnAllElements = "<<anIsOnAllElements<<
-                   "; aVEntity = "<<aVEntity);
-
-         VISU::PCGroup aGroup(new VISU::TCGroup());
-         aGroup->myGroup = aMEDGroup;
-         VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
-         
-         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();
-           TFindFamilyOnEntity aFindFamilyOnEntity = 
-             FindFamilyOnEntity(aMeshName.in(), aVEntity, aFamilyName.in());
-           VISU::PCFamily aFamily = boost::get<2>(aFindFamilyOnEntity);
-           if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"' = "<<bool(aFamily));
-           if(aFamily){
-             aFamilySet.insert(aFamily);
-           }
-         }
-         
-         if(!aFamilySet.empty()){
-           VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
-           aGroupMap[aSupportName.in()] = aGroup;
-         }
-
-       }
+        SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
+        
+        CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
+        if(CORBA::is_nil(aMedSupport)) 
+          continue;
+        
+        SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport); 
+        if(aMEDSupport->_is_nil()) 
+          continue;
+        
+        SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
+        SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
+        VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
+        CORBA::String_var aSupportName = aMEDSupport->getName();
+        
+        SALOME_MED::GROUP_var aMEDGroup = SALOME_MED::GROUP::_narrow(aMedSupport);
+        if(!aMEDGroup->_is_nil()){
+          CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
+
+          if(MYDEBUG) 
+            MESSAGE("VISU_MEDConvertor::Build "<<
+                    "- aGroup = '"<<aSupportName<<"'"<<
+                    "; anIsOnAllElements = "<<anIsOnAllElements<<
+                    "; aVEntity = "<<aVEntity);
+
+          VISU::PCGroup aGroup(new VISU::TCGroup());
+          aGroup->myGroup = aMEDGroup;
+          VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
+          
+          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();
+            TFindFamilyOnEntity aFindFamilyOnEntity = 
+              FindFamilyOnEntity(aMeshName.in(), aVEntity, aFamilyName.in());
+            VISU::PCFamily aFamily = boost::get<2>(aFindFamilyOnEntity);
+            if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"' = "<<bool(aFamily));
+            if(aFamily){
+              aFamilySet.insert(VISU::TEnity2Family(aVEntity, aFamily));
+            }
+          }
+          
+          if(!aFamilySet.empty()){
+            VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
+            aGroupMap[aSupportName.in()] = aGroup;
+          }
+
+        }
       }
     }
   }
@@ -1030,54 +1031,54 @@ VISU_MEDConvertor
       if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aFieldName = '"<<GetSObjectName(aFieldSObj)<<"'");
       SALOMEDS::ChildIterator_var aTimeStampIterator = aStudy->NewChildIterator(aFieldSObj);
       for(; aTimeStampIterator->More(); aTimeStampIterator->Next()){
-       SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value();
-       if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<<GetSObjectName(aTimeStampSObj)<<"'");
-       CORBA::Object_var aMedField = VISU::SObjectToObject(aTimeStampSObj);
-       if(CORBA::is_nil(aMedField)) 
-         continue;
-
-       SALOME_MED::FIELD_var aMEDField = SALOME_MED::FIELD::_narrow(aMedField);
-       if(aMEDField->_is_nil()) 
-         continue;
-
-       SALOME_MED::SUPPORT_var aMEDSupport = aMEDField->getSupport();
-       if(aMEDSupport->_is_nil()) 
-         continue;
-
-       SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
-       VISU::TEntity anEntity = MEDEntityToVTK(aMEntity);
-       SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh();
-       if(aMEDMesh->_is_nil()) 
-         continue;
-
-       CORBA::String_var aMeshName = aMEDMesh->getName();
-       CORBA::String_var aFieldName = aMEDField->getName();
-       
-       VISU::TMeshMap::iterator aMeshMapIter = myMeshMap.find(aMeshName.in());
-       if(aMeshMapIter == myMeshMap.end())
-         continue;
-
-       VISU::PCMesh aMesh = aMeshMapIter->second;
-       VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
-       VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
-       if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
-         continue;
-
-       VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
-       VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
-       VISU::TFieldMap::iterator aFieldMapIter = aFieldMap.find(aFieldName.in());
-       VISU::PCField aField;
-       if(aFieldMapIter == aFieldMap.end()){
-         aField = aFieldMap[aFieldName.in()](new VISU::TCField());
-         aField->myId = iField;
-         aField->myName = aFieldName.in();
-         aField->myEntity = anEntity;
-         aField->myMeshName = aMeshName.in();
-         aField->myDataSize = aMeshOnEntity->myNbCells * aField->myNbComp;
-
-         vtkIdType aDataType = VTK_DOUBLE;
-         SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
-         if(aFieldDouble->_is_nil()) {
+        SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value();
+        if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<<GetSObjectName(aTimeStampSObj)<<"'");
+        CORBA::Object_var aMedField = VISU::SObjectToObject(aTimeStampSObj);
+        if(CORBA::is_nil(aMedField)) 
+          continue;
+
+        SALOME_MED::FIELD_var aMEDField = SALOME_MED::FIELD::_narrow(aMedField);
+        if(aMEDField->_is_nil()) 
+          continue;
+
+        SALOME_MED::SUPPORT_var aMEDSupport = aMEDField->getSupport();
+        if(aMEDSupport->_is_nil()) 
+          continue;
+
+        SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
+        VISU::TEntity anEntity = MEDEntityToVTK(aMEntity);
+        SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh();
+        if(aMEDMesh->_is_nil()) 
+          continue;
+
+        CORBA::String_var aMeshName = aMEDMesh->getName();
+        CORBA::String_var aFieldName = aMEDField->getName();
+        
+        VISU::TMeshMap::iterator aMeshMapIter = myMeshMap.find(aMeshName.in());
+        if(aMeshMapIter == myMeshMap.end())
+          continue;
+
+        VISU::PCMesh aMesh = aMeshMapIter->second;
+        VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+        VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
+        if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
+          continue;
+
+        VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
+        VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+        VISU::TFieldMap::iterator aFieldMapIter = aFieldMap.find(aFieldName.in());
+        VISU::PCField aField;
+        if(aFieldMapIter == aFieldMap.end()){
+          aField = aFieldMap[aFieldName.in()](new VISU::TCField());
+          aField->myId = iField;
+          aField->myName = aFieldName.in();
+          aField->myEntity = anEntity;
+          aField->myMeshName = aMeshName.in();
+          aField->myDataSize = aMeshOnEntity->myNbCells * aField->myNbComp;
+
+          vtkIdType aDataType = VTK_DOUBLE;
+          SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
+          if(aFieldDouble->_is_nil()) {
             // PAL18313: Mandriva 64 porting: CRASH at creating presentation on "Import Structure".
             if (sizeof(long) == 4 ) // Size of CORBA::Long is always 4 (see CORBA_basetypes.h)
               aDataType = VTK_LONG;
@@ -1088,23 +1089,23 @@ VISU_MEDConvertor
               continue;
             }
           }
-         aField->Init(aMEDField->getNumberOfComponents(), aDataType);
-
-         if(MYDEBUG) 
-           MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<<aMeshOnEntity->myNbCells);
-       }else
-         aField = aFieldMapIter->second;
-
-       VISU::TValField& aValField = aField->myValField;
-       int anId = aMEDField->getIterationNumber();
-       VISU::PCValForTime aValForTime = aValField[anId](new VISU::TCValForTime());
-       aValForTime->myId = anId;
-       CORBA::Double aDT = aMEDField->getTime();
-       aValForTime->myTime = VISU::TTime(aDT,"");
-       aValForTime->myField = aMEDField;
-       if(MYDEBUG) 
-         MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<
-                 "'; myEntity = "<<anEntity<<"; myTime = "<<aDT);
+          aField->Init(aMEDField->getNumberOfComponents(), aDataType);
+
+          if(MYDEBUG) 
+            MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<<aMeshOnEntity->myNbCells);
+        }else
+          aField = aFieldMapIter->second;
+
+        VISU::TValField& aValField = aField->myValField;
+        int anId = aMEDField->getIterationNumber();
+        VISU::PCValForTime aValForTime = aValField[anId](new VISU::TCValForTime());
+        aValForTime->myId = anId;
+        CORBA::Double aDT = aMEDField->getTime();
+        aValForTime->myTime = VISU::TTime(aDT,"");
+        aValForTime->myField = aMEDField;
+        if(MYDEBUG) 
+          MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<
+                  "'; myEntity = "<<anEntity<<"; myTime = "<<aDT);
       }      
     }
   }
@@ -1154,9 +1155,9 @@ VISU_MEDConvertor
       myMeshMap[aMeshName.in()] = aMesh;
 
       if(MYDEBUG) 
-       MESSAGE("VISU_MEDConvertor::Build "<<
-               "- aMeshName = '"<<aMeshName<<"'"<<
-               "; aDim = "<<aMesh->myDim);
+        MESSAGE("VISU_MEDConvertor::Build "<<
+                "- aMeshName = '"<<aMeshName<<"'"<<
+                "; aDim = "<<aMesh->myDim);
     }else
       aMesh = aMeshMapIter->second;
 
@@ -1207,7 +1208,7 @@ VISU_MEDConvertor
       aFieldMap[aFieldName.in()] = aField;
 
       if(MYDEBUG) 
-       MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<<aMeshOnEntity->myNbCells);
+        MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<<aMeshOnEntity->myNbCells);
     }else
       aField = aFieldMapIter->second;
 
@@ -1220,10 +1221,10 @@ VISU_MEDConvertor
     aValForTime->myField = aMEDField;
     if(MYDEBUG) 
       MESSAGE("VISU_MEDConvertor::Build "<<
-             "- aMeshName = '"<<aMeshName<<"'"<<
-             "; myEntity = "<<aVEntity<<
-             "; myTime = "<<aDT<<
-             "; anId = "<<anId);
+              "- aMeshName = '"<<aMeshName<<"'"<<
+              "; myEntity = "<<aVEntity<<
+              "; myTime = "<<aDT<<
+              "; anId = "<<anId);
   }
   return this; 
 }
@@ -1233,7 +1234,7 @@ VISU_MEDConvertor
 int
 VISU_MEDConvertor
 ::LoadMeshOnEntity(VISU::PMeshImpl theMesh,
-                  VISU::PMeshOnEntityImpl theMeshOnEntity)
+                   VISU::PMeshOnEntityImpl theMeshOnEntity)
 {
   int anIsUpdated = LoadPoints(theMesh);
   const VISU::TEntity& aVEntity = theMeshOnEntity->myEntity;
@@ -1248,8 +1249,8 @@ VISU_MEDConvertor
 int
 VISU_MEDConvertor
 ::LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
-                    VISU::PMeshOnEntityImpl theMeshOnEntity, 
-                    VISU::PFamilyImpl theFamily)
+                     VISU::PMeshOnEntityImpl theMeshOnEntity, 
+                     VISU::PFamilyImpl theFamily)
 {
   int anIsUpdated = LoadPoints(theMesh);
   const VISU::TEntity& anEntity = theMeshOnEntity->myEntity;
@@ -1268,13 +1269,13 @@ VISU_MEDConvertor
 int 
 VISU_MEDConvertor
 ::LoadMeshOnGroup(VISU::PMeshImpl theMesh, 
-                 const VISU::TFamilySet& theFamilySet)
+                  const VISU::TFamilySet& theFamilySet)
 {
   //Main part of code
   int anIsUpdated = LoadPoints(theMesh);
   VISU::TFamilySet::const_iterator aFamilyIter = theFamilySet.begin();
   for(; aFamilyIter != theFamilySet.end(); aFamilyIter++){
-    VISU::PCFamily aFamily = *aFamilyIter;
+    VISU::PCFamily aFamily = (*aFamilyIter).second;
     const VISU::TEntity& aVEntity = aFamily->myEntity;
     VISU::PCMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
     if(aVEntity == VISU::NODE_ENTITY){
@@ -1293,9 +1294,9 @@ VISU_MEDConvertor
 int 
 VISU_MEDConvertor
 ::LoadValForTimeOnMesh(VISU::PMeshImpl theMesh, 
-                      VISU::PMeshOnEntityImpl theMeshOnEntity, 
-                      VISU::PFieldImpl theField, 
-                      VISU::PValForTimeImpl theValForTime)
+                       VISU::PMeshOnEntityImpl theMeshOnEntity, 
+                       VISU::PFieldImpl theField, 
+                       VISU::PValForTimeImpl theValForTime)
 {
   //Main part of code
   int anIsUpdated = LoadPoints(theMesh);
@@ -1330,7 +1331,7 @@ VISU_MEDConvertor
   if(aNbElem <= 0) 
     throw std::runtime_error("LoadPoints >> There is no points in the mesh !!!");
 
-  SALOME_MED::double_array_var aCCoord = aMedMesh->getCoordinates(SALOME_MED::MED_FULL_INTERLACE);
+  SALOME_TYPES::ListOfDouble_var aCCoord = aMedMesh->getCoordinates(SALOME_MED::MED_FULL_INTERLACE);
   VISU::TCMEDCoordHolder* aCoordHolder = new VISU::TCMEDCoordHolder();
   aCoordHolder->Init(aNbElem, aDim, aCCoord);
 
@@ -1361,7 +1362,7 @@ VISU_MEDConvertor
 int 
 VISU_MEDConvertor
 ::LoadPointsOnFamily(VISU::PCMesh theMesh, 
-                    VISU::PCFamily theFamily)
+                     VISU::PCFamily theFamily)
 {
   VISU::PCMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[VISU::NODE_ENTITY];
 
@@ -1375,15 +1376,15 @@ VISU_MEDConvertor
   
   if(!anIsOnAllElements){
     SALOME_MED::medGeometryElement_array_var aGeom = aMedFamily->getTypes();
-    SALOME_MED::long_array_var aCellNumForType = aMedFamily->getNumber(aGeom[0]);
+    SALOME_TYPES::ListOfLong_var aCellNumForType = aMedFamily->getNumber(aGeom[0]);
     int aSize = aNbElem;
     aNbElem = aCellNumForType->length();
     for(int iElem = 0; iElem < aNbElem; iElem++){
       int anID = aCellNumForType[iElem] - 1;
       if(0 > anID || anID >= aSize){
-       static QString aString;
-       aString.sprintf("LoadPointsOnFamily - aSize(%d) <= aCellNumForType[%d] = %d < 0",aSize,iElem,anID);
-       throw std::runtime_error((const char*)aString.toLatin1());
+        static QString aString;
+        aString.sprintf("LoadPointsOnFamily - aSize(%d) <= aCellNumForType[%d] = %d < 0",aSize,iElem,anID);
+        throw std::runtime_error((const char*)aString.toLatin1());
       }
       aSubMeshID.push_back(anID);
     }
@@ -1418,18 +1419,18 @@ namespace
                            SALOME_MED::medEntityMesh theEntity) 
     {
       {
-       SALOME::SenderInt_var aSender = 
-         theMesh->getSenderForPolygonsConnectivity(SALOME_MED::MED_NODAL, theEntity);
-       long int aSize;
-       int* aValuePtr = ReceiverFactory::getValue(aSender.in(), aSize);
-       myConn.assign(aValuePtr, aValuePtr + aSize);
+        SALOME::SenderInt_var aSender = 
+          theMesh->getSenderForPolygonsConnectivity(SALOME_MED::MED_NODAL, theEntity);
+        long int aSize;
+        int* aValuePtr = ReceiverFactory::getValue(aSender.in(), aSize);
+        myConn.assign(aValuePtr, aValuePtr + aSize);
       }
       {
-       SALOME::SenderInt_var aSender = 
-         theMesh->getSenderForPolygonsConnectivityIndex(SALOME_MED::MED_NODAL, theEntity);
-       long int aSize;
-       int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
-       myConnIndex.assign(aValuePtr, aValuePtr + aSize);
+        SALOME::SenderInt_var aSender = 
+          theMesh->getSenderForPolygonsConnectivityIndex(SALOME_MED::MED_NODAL, theEntity);
+        long int aSize;
+        int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
+        myConnIndex.assign(aValuePtr, aValuePtr + aSize);
       }
     }
 
@@ -1466,31 +1467,31 @@ namespace
     MEDPolyhedraConnectivity(SALOME_MED::MESH_var theMesh)
     {
       {
-       SALOME::SenderInt_var aSender = 
-         theMesh->getSenderForPolyhedronConnectivity(SALOME_MED::MED_NODAL);
-       long int aSize;
-       int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
-       myConn.assign(aValuePtr, aValuePtr + aSize);
+        SALOME::SenderInt_var aSender = 
+          theMesh->getSenderForPolyhedronConnectivity(SALOME_MED::MED_NODAL);
+        long int aSize;
+        int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
+        myConn.assign(aValuePtr, aValuePtr + aSize);
       }
       {
-       SALOME::SenderInt_var aSender = 
-         theMesh->getSenderForPolyhedronIndex(SALOME_MED::MED_NODAL);
-       long int aSize;
-       int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
-       myConnIndex.assign(aValuePtr, aValuePtr + aSize);
+        SALOME::SenderInt_var aSender = 
+          theMesh->getSenderForPolyhedronIndex(SALOME_MED::MED_NODAL);
+        long int aSize;
+        int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
+        myConnIndex.assign(aValuePtr, aValuePtr + aSize);
       }
       {
-       SALOME::SenderInt_var aSender = 
-         theMesh->getSenderForPolyhedronFacesIndex();
-       long int aSize;
-       int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
-       myFaceIndex.assign(aValuePtr, aValuePtr + aSize);
+        SALOME::SenderInt_var aSender = 
+          theMesh->getSenderForPolyhedronFacesIndex();
+        long int aSize;
+        int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
+        myFaceIndex.assign(aValuePtr, aValuePtr + aSize);
       }
     }
 
     int
     GetUniqueConn(int theId, 
-                 TConnSet& theConnSet) const 
+                  TConnSet& theConnSet) const 
     {
       theConnSet.clear();
       int aStartFaceId = myConnIndex[theId] - 1;
@@ -1514,7 +1515,7 @@ namespace
       TConnSet aConnSet;
       int aCellSize = 0;
       for(int anElemId = 0; anElemId < GetNbElem(); anElemId++)
-       aCellSize += GetUniqueConn(anElemId, aConnSet);
+        aCellSize += GetUniqueConn(anElemId, aConnSet);
       return aCellSize;
     }
   };
@@ -1524,7 +1525,7 @@ namespace
 int 
 VISU_MEDConvertor
 ::LoadCellsOnEntity(VISU::PCMesh theMesh,
-                   VISU::PCMeshOnEntity theMeshOnEntity)
+                    VISU::PCMeshOnEntity theMeshOnEntity)
 {
   if(theMeshOnEntity->myIsDone) 
     return 0;
@@ -1601,11 +1602,11 @@ VISU_MEDConvertor
       int aVNbNodes = VISUGeom2NbNodes(aEGeom);
       int aNbElem = anInfo->numberOfElements[iGeom];
       if (aNbElem > 0) {
-        SALOME_MED::long_array_var aConn = 
+        SALOME_TYPES::ListOfLong_var aConn = 
           aMedMesh->getConnectivity(SALOME_MED::MED_FULL_INTERLACE,
-                                   SALOME_MED::MED_NODAL,
-                                   aMEntity,
-                                   aMGeom);
+                                    SALOME_MED::MED_NODAL,
+                                    aMEntity,
+                                    aMGeom);
         VISU::PSubMeshImpl aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TCSubMesh());
 
         aSubMesh->myNbCells = aNbElem;
@@ -1732,8 +1733,8 @@ VISU_MEDConvertor
 int 
 VISU_MEDConvertor
 ::LoadCellsOnFamily(VISU::PCMesh theMesh,
-                   VISU::PCMeshOnEntity theMeshOnEntity, 
-                   VISU::PCFamily theFamily)
+                    VISU::PCMeshOnEntity theMeshOnEntity, 
+                    VISU::PCFamily theFamily)
 {
   if(theFamily->myIsDone) 
     return 0;
@@ -1746,7 +1747,7 @@ VISU_MEDConvertor
     if(MYDEBUG) MESSAGE("LoadCellsOnFamily - iGeomEnd = "<<iGeomEnd);
     for(int iGeom = 0; iGeom < iGeomEnd; iGeom++){
       SALOME_MED::medGeometryElement aMGeom = aGeoms[iGeom];
-      SALOME_MED::long_array_var aCellNumForType = aMedFamily->getNumber(aMGeom);
+      SALOME_TYPES::ListOfLong_var aCellNumForType = aMedFamily->getNumber(aMGeom);
       VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
 
       int aNbElem = aCellNumForType->length();
@@ -1755,20 +1756,20 @@ VISU_MEDConvertor
       VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[aEGeom]; 
       
       if(MYDEBUG) 
-       MESSAGE("LoadCellsOnFamily "<<
-               "- aMGeom = "<<aMGeom<<
-               "; aNbElem = "<<aNbElem<<
-               "; aSize = "<<aSize<<
-               "; aCounter = "<<aCounter);
+        MESSAGE("LoadCellsOnFamily "<<
+                "- aMGeom = "<<aMGeom<<
+                "; aNbElem = "<<aNbElem<<
+                "; aSize = "<<aSize<<
+                "; aCounter = "<<aCounter);
       
       for(int iElem = 0; iElem < aNbElem; iElem++){
-       int anID = aCellNumForType[iElem] - aCounter - 1;
-       if(0 > anID || anID >= aSize){
-         static QString aString;
-         aString.sprintf("LoadCellsOnFamily - aNbElem(%d) <= aCellNumForType[%d] = %d < 0 !!!",aNbElem,iElem,anID);
-         throw std::runtime_error((const char*)aString.toLatin1());
-       }
-       aSubMeshID.push_back(anID);
+        int anID = aCellNumForType[iElem] - aCounter - 1;
+        if(0 > anID || anID >= aSize){
+          static QString aString;
+          aString.sprintf("LoadCellsOnFamily - aNbElem(%d) <= aCellNumForType[%d] = %d < 0 !!!",aNbElem,iElem,anID);
+          throw std::runtime_error((const char*)aString.toLatin1());
+        }
+        aSubMeshID.push_back(anID);
       }
     }
   }else{
@@ -1781,7 +1782,7 @@ VISU_MEDConvertor
       VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[aEGeom];
       int iNumElemEnd = aCell2Connect.size();
       for(int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++)
-       aSubMeshID.push_back(iNumElem);
+        aSubMeshID.push_back(iNumElem);
     }
   }
   
@@ -1792,13 +1793,13 @@ VISU_MEDConvertor
 
 
 template<class TValueType,
-        class TContainerType> 
+         class TContainerType> 
 void 
 ImportField(TContainerType& theContainer, 
-           VISU::PCMesh theMesh,
-           VISU::PCField theField,
-           VISU::PCValForTime theValForTime,
-           VISU::PCMeshOnEntity theMeshOnEntity)
+            VISU::PCMesh theMesh,
+            VISU::PCField theField,
+            VISU::PCValForTime theValForTime,
+            VISU::PCMeshOnEntity theMeshOnEntity)
 {
   typedef VISU::TTCMEDMeshValue<TValueType, TContainerType> TVMeshValue;
   vtkIdType aNbComp = theField->myNbComp;
@@ -1824,18 +1825,18 @@ ImportField(TContainerType& theContainer,
       const VISU::TCellsFirstIndex& aCellsFirstIndex = theMeshOnEntity->myCellsFirstIndex;
       VISU::TCellsFirstIndex::const_iterator aCellsFirstIndexIter = aCellsFirstIndex.find(aMGeom);
       if(aCellsFirstIndexIter != aCellsFirstIndex.end()){
-       const VISU::TIndexAndSize& aIndexAndSize = aCellsFirstIndexIter->second;
-       if(MYDEBUG) 
-         MESSAGE("ImportField - aMGeom = "<<aMGeom<<
-                 "; aIndexAndSize = {"<<aIndexAndSize.first<<
-                 ","<<aIndexAndSize.second<<"}");
-
-       vtkIdType aNbElem = aIndexAndSize.second;
-       vtkIdType aStart = aIndexAndSize.first * aNbComp;
-       VISU::PMeshValue& aVMeshValue = theValForTime->GetMeshValue(aEGeom);
-       TVMeshValue* aMeshValue = new TVMeshValue();
-       aMeshValue->Init(aNbElem, aNbGauss, aNbComp, theContainer, aStart);
-       aVMeshValue.reset(aMeshValue);
+        const VISU::TIndexAndSize& aIndexAndSize = aCellsFirstIndexIter->second;
+        if(MYDEBUG) 
+          MESSAGE("ImportField - aMGeom = "<<aMGeom<<
+                  "; aIndexAndSize = {"<<aIndexAndSize.first<<
+                  ","<<aIndexAndSize.second<<"}");
+
+        vtkIdType aNbElem = aIndexAndSize.second;
+        vtkIdType aStart = aIndexAndSize.first * aNbComp;
+        VISU::PMeshValue& aVMeshValue = theValForTime->GetMeshValue(aEGeom);
+        TVMeshValue* aMeshValue = new TVMeshValue();
+        aMeshValue->Init(aNbElem, aNbGauss, aNbComp, theContainer, aStart);
+        aVMeshValue.reset(aMeshValue);
       }
     }
   }
@@ -1844,9 +1845,9 @@ ImportField(TContainerType& theContainer,
 int
 VISU_MEDConvertor
 ::LoadField(VISU::PCMesh theMesh,
-           VISU::PCMeshOnEntity theMeshOnEntity,
-           VISU::PField theField, 
-           VISU::PCValForTime theValForTime)
+            VISU::PCMeshOnEntity theMeshOnEntity,
+            VISU::PField theField, 
+            VISU::PCValForTime theValForTime)
 {
   MESSAGE("VISU_MEDConvertor::LoadField");
   //Check on loading already done
@@ -1866,24 +1867,24 @@ VISU_MEDConvertor
   
   SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
   if(!aFieldDouble->_is_nil()){
-    SALOME_MED::double_array_var anArray = aFieldDouble->getValue(SALOME_MED::MED_FULL_INTERLACE);
+    SALOME_TYPES::ListOfDouble_var anArray = aFieldDouble->getValue(SALOME_MED::MED_FULL_INTERLACE);
     if(MYDEBUG) MESSAGE("VISU_MEDConvertor::LoadField - There is FIELDDOUBLE = "<<anArray->length());
     ImportField<CORBA::Double>(anArray,
-                              theMesh,
-                              theField,
-                              theValForTime,
-                              theMeshOnEntity);
+                               theMesh,
+                               theField,
+                               theValForTime,
+                               theMeshOnEntity);
   }
 
   SALOME_MED::FIELDINT_ptr aFieldInt = SALOME_MED::FIELDINT::_narrow(aMEDField);
   if(!aFieldInt->_is_nil()){
-    SALOME_MED::long_array_var anArray = aFieldInt->getValue(SALOME_MED::MED_FULL_INTERLACE);
+    SALOME_TYPES::ListOfLong_var anArray = aFieldInt->getValue(SALOME_MED::MED_FULL_INTERLACE);
     if(MYDEBUG) MESSAGE("VISU_MEDConvertor::LoadField - There is FIELDINT = "<<anArray->length());
     ImportField<CORBA::Long>(anArray,
-                            theMesh,
-                            theField,
-                            theValForTime,
-                            theMeshOnEntity);
+                             theMesh,
+                             theField,
+                             theValForTime,
+                             theMeshOnEntity);
   }
 
   anUnstructuredGridIDMapper->myIsVTKDone = true;