]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To introduce new data structure (TMeshValue) that is responsible for result data...
authorapo <apo@opencascade.com>
Thu, 28 Jul 2005 11:08:12 +0000 (11:08 +0000)
committerapo <apo@opencascade.com>
Thu, 28 Jul 2005 11:08:12 +0000 (11:08 +0000)
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_Convertor_impl.hxx
src/CONVERTOR/VISU_MedConvertor.cxx
src/VISU_I/VISU_CorbaMedConvertor.cxx
src/VISU_I/VISU_CorbaMedConvertor.hxx

index 95381c6da36da1adf547996f5f0138c9f06e6843..72c0b92213263c9889be07df7f9f832f0cbee7f9 100644 (file)
@@ -235,8 +235,98 @@ namespace VISU
     return make_pair(aFamily->myNbCells,aFamily->myCellsSize);
   }
   
+  
+  //---------------------------------------------------------------
+  void
+  TMeshValue
+  ::Init(vtkIdType theNbElem,
+        vtkIdType theNbGauss,
+        vtkIdType theNbComp)
+  {
+    myNbElem = theNbElem;
+    myNbGauss = theNbGauss;
+    myNbComp = theNbComp;
+    
+    myStep = theNbComp*theNbGauss;
+    
+    myValue.resize(theNbElem*myStep);
+  }
+
+  TCValueSliceArr 
+  TMeshValue
+  ::GetGaussValueSliceArr(vtkIdType theElemId) const
+  {
+    TCValueSliceArr aValueSliceArr(myNbGauss);
+    vtkIdType anId = theElemId*myStep;
+    for(vtkIdType aGaussId = 0; aGaussId < myNbGauss; aGaussId++){
+      aValueSliceArr[aGaussId] =
+       TCValueSlice(myValue,std::slice(anId,myNbComp,1));
+      anId += myNbComp;
+    }
+    return aValueSliceArr;
+  }
+
+  TValueSliceArr 
+  TMeshValue
+  ::GetGaussValueSliceArr(vtkIdType theElemId)
+  {
+    TValueSliceArr aValueSliceArr(myNbGauss);
+    vtkIdType anId = theElemId*myStep;
+    for(vtkIdType aGaussId = 0; aGaussId < myNbGauss; aGaussId++){
+      aValueSliceArr[aGaussId] =
+       TValueSlice(myValue,std::slice(anId,myNbComp,1));
+      anId += myNbComp;
+    }
+    return aValueSliceArr;
+  }
+
+  TCValueSliceArr 
+  TMeshValue
+  ::GetCompValueSliceArr(vtkIdType theElemId) const
+  {
+    TCValueSliceArr aValueSliceArr(myNbComp);
+    vtkIdType anId = theElemId*myStep;
+    for(vtkIdType aCompId = 0; aCompId < myNbComp; aCompId++){
+      aValueSliceArr[aCompId] =
+       TCValueSlice(myValue,std::slice(anId,myNbGauss,myNbGauss));
+      anId += 1;
+    }
+    return aValueSliceArr;
+  }
+
+  TValueSliceArr 
+  TMeshValue
+  ::GetCompValueSliceArr(vtkIdType theElemId)
+  {
+    TValueSliceArr aValueSliceArr(myNbComp);
+    vtkIdType anId = theElemId*myStep;
+    for(vtkIdType aCompId = 0; aCompId < myNbComp; aCompId++){
+      aValueSliceArr[aCompId] =
+       TValueSlice(myValue,std::slice(anId,myNbGauss,myNbGauss));
+      anId += 1;
+    }
+    return aValueSliceArr;
+  }
+
 
   //---------------------------------------------------------------
+  const TMeshValue& 
+  TValForTimeImpl
+  ::GetMeshValue(vtkIdType theGeom) const
+  {
+    TGeom2Value::const_iterator anIter = myGeom2Value.find(theGeom);
+    if(anIter == myGeom2Value.end())
+      EXCEPTION(runtime_error,"TValForTimeImpl::GetMeshValue - myGeom2Value.find(theGeom) fails");
+    return anIter->second;
+  }
+  
+  TMeshValue& 
+  TValForTimeImpl
+  ::GetMeshValue(vtkIdType theGeom)
+  {
+    return myGeom2Value[theGeom];
+  }
+
   int
   TValForTimeImpl
   ::GetNbGauss(vtkIdType theGeom) const
@@ -601,92 +691,68 @@ namespace
     //theFloatArray->DebugOn();
     theFloatArray->SetNumberOfTuples(theNumberOfTuples);
     theFloatArray->SetName(theFieldName.c_str());
-    int aNbComp = theField->myNbComp;
 
-    const VISU::TValForCells& aValForCells = theValForTime->myValForCells;
-    VISU::TValForCells::const_iterator anIter = aValForCells.begin();
-    for(int aTupleId = 0; anIter != aValForCells.end(); anIter++) {
+    TGeom2Value& aGeom2Value = theValForTime->myGeom2Value;
+    TGeom2Value::const_iterator anIter = aGeom2Value.begin();
+    for(int aTupleId = 0; anIter != aGeom2Value.end(); anIter++){
       int aGeom = anIter->first;
-      const VISU::TValForCellsWithType& anArray = anIter->second;
-
-      int aNbGauss = theValForTime->GetNbGauss(aGeom);
-      int aStep = aNbComp*aNbGauss;
-      int aNbElem = anArray.size()/aStep;
+      const TMeshValue& aMeshValue = anIter->second;
 
+      int aNbElem = aMeshValue.myNbElem;
+      int aNbGauss = aMeshValue.myNbGauss;
+      int aNbComp = aMeshValue.myNbComp;
+      
       INITMSG(MYDEBUG,"GetTimeStampOnProfile2 - aGeom = "<<aGeom<<
              "; aNbElem = "<<aNbElem<<
              "; aNbComp = "<<aNbComp<<
              "; aNbGauss = "<<aNbGauss<<
              endl);
 
+      if(aNbComp == 4)
+       aNbComp = 2;
+
       switch(aNbComp){
       case 1:
        for(int iElem = 0; iElem < aNbElem; iElem++){
+         float aValue[] = {0.0, 0.0, 0.0};
+         TCValueSliceArr aValueSliceArr = aMeshValue.GetCompValueSliceArr(iElem);
          for(int iComp = 0; iComp < aNbComp; iComp++){
-           float aValue = 0;
-           int aFirstId = iElem*aStep + iComp*aNbGauss;
-           if(aNbGauss > 0){
-             for(int iGauss = 0, anId = aFirstId; iGauss < aNbGauss; iGauss++, anId++)
-               aValue += anArray.at(anId);
-             aValue /= aNbGauss;
-           }else
-             aValue = anArray.at(aFirstId);
-
-           theFloatArray->SetTuple1(aTupleId++,aValue);
+           const TCValueSlice& aValueSlice = aValueSliceArr[iComp];
+           for(int iGauss = 0; iGauss < aNbGauss; iGauss++){
+             aValue[iComp] += aValueSlice[iGauss];
+           }
+           aValue[iComp] /= aNbGauss;
          }
+         theFloatArray->SetTuple1(aTupleId++,aValue[0]);
        }
        break;
       case 2:
        for(int iElem = 0; iElem < aNbElem; iElem++){
-         float aValue[2] = {0.0, 0.0};
+         float aValue[] = {0.0, 0.0, 0.0};
+         TCValueSliceArr aValueSliceArr = aMeshValue.GetCompValueSliceArr(iElem);
          for(int iComp = 0; iComp < aNbComp; iComp++){
-           int aFirstId = iElem*aStep + iComp*aNbGauss;
-           if(aNbGauss > 0){
-             for(int iGauss = 0, anId = aFirstId; iGauss < aNbGauss; iGauss++, anId++)
-               aValue[iComp] += anArray[anId];
-             aValue[iComp] /= aNbGauss;
-           }else
-             aValue[iComp] = anArray[aFirstId];
-
-         }
-         theFloatArray->SetTuple3(aTupleId++,aValue[0],aValue[1],0.0);
-       }
-       break;
-      case 4:
-       for(int iElem = 0; iElem < aNbElem; iElem++){
-         float aValue[2] = {0.0, 0.0};
-         for(int iComp = 0; iComp < 2; iComp++){
-           int aFirstId = iElem*aStep + iComp*aNbGauss;
-           if(aNbGauss > 0){
-             for(int iGauss = 0, anId = aFirstId; iGauss < aNbGauss; iGauss++, anId++)
-               aValue[iComp] += anArray[anId];
-             aValue[iComp] /= aNbGauss;
-           }else
-             aValue[iComp] = anArray[aFirstId];
-
+           const TCValueSlice& aValueSlice = aValueSliceArr[iComp];
+           for(int iGauss = 0; iGauss < aNbGauss; iGauss++){
+             aValue[iComp] += aValueSlice[iGauss];
+           }
+           aValue[iComp] /= aNbGauss;
          }
          theFloatArray->SetTuple3(aTupleId++,aValue[0],aValue[1],0.0);
        }
        break;
       default:
-       if(aNbComp > 0)
-         for(int iElem = 0; iElem < aNbElem; iElem++){
-           float aValue[3] = {0.0, 0.0, 0.0};
-           for(int iComp = 0; iComp < 3; iComp++){
-             int aFirstId = iElem*aStep + iComp*aNbGauss;
-             if(aNbGauss > 0){
-               for(int iGauss = 0, anId = aFirstId; iGauss < aNbGauss; iGauss++, anId++)
-                 aValue[iComp] += anArray[anId];
-               aValue[iComp] /= aNbGauss;
-             }else
-               aValue[iComp] = anArray[aFirstId];
-             
+       for(int iElem = 0; iElem < aNbElem; iElem++){
+         float aValue[] = {0.0, 0.0, 0.0};
+         TCValueSliceArr aValueSliceArr = aMeshValue.GetCompValueSliceArr(iElem);
+         for(int iComp = 0; iComp < aNbComp; iComp++){
+           const TCValueSlice& aValueSlice = aValueSliceArr[iComp];
+           for(int iGauss = 0; iGauss < aNbGauss; iGauss++){
+             aValue[iComp] += aValueSlice[iGauss];
            }
-           theFloatArray->SetTuple3(aTupleId++,aValue[0],aValue[1],aValue[2]);
+           aValue[iComp] /= aNbGauss;
          }
-       else
-         EXCEPTION(runtime_error,"GetTimeStampOnProfile2 - There is no an algorithm for representation of the field !!!");
-       break;
+         theFloatArray->SetTuple3(aTupleId++,aValue[0],aValue[1],aValue[2]);
+       }
       }
     }
   }
index ceb2b99e4a5554654b209151949b328faa7c22a3..8a6f88c4ee00bdce1de87f06f80fda830e60c017 100644 (file)
@@ -243,12 +243,53 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  typedef std::vector<float> TValForCellsWithType;
-  typedef std::map<vtkIdType,TValForCellsWithType> TValForCells;
+  typedef std::vector<float> TValue;
+  typedef TSlice<TValue> TValueSlice;
+  typedef TCSlice<TValue> TCValueSlice;
+
+  typedef std::vector<TCValueSlice> TCValueSliceArr;
+  typedef std::vector<TValueSlice> TValueSliceArr;
+
+  struct TMeshValue
+  {
+    TValue myValue;
+
+    vtkIdType myNbElem;
+    vtkIdType myNbComp;
+    vtkIdType myNbGauss;
+    vtkIdType myStep;
+
+    void
+    Init(vtkIdType theNbElem,
+        vtkIdType theNbGauss,
+        vtkIdType theNbComp);
+
+    TCValueSliceArr
+    GetGaussValueSliceArr(vtkIdType theElemId) const;
+
+    TValueSliceArr 
+    GetGaussValueSliceArr(vtkIdType theElemId);
+
+    TCValueSliceArr
+    GetCompValueSliceArr(vtkIdType theElemId) const;
+
+    TValueSliceArr 
+    GetCompValueSliceArr(vtkIdType theElemId);
+  };
+  
+
+  //---------------------------------------------------------------
+  typedef std::map<vtkIdType,TMeshValue> TGeom2Value;
 
   struct TValForTimeImpl: virtual TValForTime, virtual TSource
   {
-    TValForCells myValForCells;
+    TGeom2Value myGeom2Value;
+
+    const TMeshValue& 
+    GetMeshValue(vtkIdType theGeom) const;
+
+    TMeshValue& 
+    GetMeshValue(vtkIdType theGeom);
 
     int myNbGauss;
 
index c48b9233e35c133d48588615cd1d3fe543a18db9..0b6f084f74cd7abb038be661cb4bfe32b003b782 100644 (file)
 #define _EDF_NODE_IDS_
 
 using namespace std;
-using namespace MED;
 using namespace VISU;
 
+using MED::TInt;
+using MED::TFloat;
+using MED::EBooleen;
+
 #ifdef _DEBUG_
 static int MYDEBUG = 1;
 static int MY_FAMILY_DEBUG = 0;
@@ -54,11 +57,6 @@ static int MY_GROUP_DEBUG = 0;
 
 namespace
 {
-
-  using namespace MED;
-  using namespace VISU;
-  
-
   //---------------------------------------------------------------
   int
   MEDGeom2NbNodes(MED::EGeometrieElement theMEDGeomType)
@@ -72,23 +70,23 @@ namespace
   MEDGeomToVTK(MED::EGeometrieElement theMEDGeomType)
   { 
     switch(theMEDGeomType){
-    case ePOINT1: return VTK_VERTEX;
-    case eSEG2: return VTK_LINE;
-    case eSEG3: return VTK_LINE;
-    case eTRIA3: return VTK_TRIANGLE;
-    case eTRIA6: return VTK_TRIANGLE;
-    case eQUAD4: return VTK_QUAD;
-    case eQUAD8: return VTK_QUAD;
-    case eTETRA4: return VTK_TETRA;
-    case eTETRA10: return VTK_TETRA;
-    case eHEXA8: return VTK_HEXAHEDRON;
-    case eHEXA20: return VTK_HEXAHEDRON;
-    case ePENTA6: return VTK_WEDGE;
-    case ePENTA15: return VTK_WEDGE;
-    case ePYRA5: return VTK_PYRAMID;
-    case ePYRA13: return VTK_PYRAMID;
-    case ePOLYGONE: return VTK_POLYGON;
-    case ePOLYEDRE: return VTK_CONVEX_POINT_SET;
+    case MED::ePOINT1: return VTK_VERTEX;
+    case MED::eSEG2: return VTK_LINE;
+    case MED::eSEG3: return VTK_LINE;
+    case MED::eTRIA3: return VTK_TRIANGLE;
+    case MED::eTRIA6: return VTK_TRIANGLE;
+    case MED::eQUAD4: return VTK_QUAD;
+    case MED::eQUAD8: return VTK_QUAD;
+    case MED::eTETRA4: return VTK_TETRA;
+    case MED::eTETRA10: return VTK_TETRA;
+    case MED::eHEXA8: return VTK_HEXAHEDRON;
+    case MED::eHEXA20: return VTK_HEXAHEDRON;
+    case MED::ePENTA6: return VTK_WEDGE;
+    case MED::ePENTA15: return VTK_WEDGE;
+    case MED::ePYRA5: return VTK_PYRAMID;
+    case MED::ePYRA13: return VTK_PYRAMID;
+    case MED::ePOLYGONE: return VTK_POLYGON;
+    case MED::ePOLYEDRE: return VTK_CONVEX_POINT_SET;
     }
     return -1;
   }
@@ -99,18 +97,18 @@ namespace
   VTKGeomToMED(int theVTKGeomType)
   { 
     switch(theVTKGeomType){
-    case VTK_VERTEX: return ePOINT1;
-    case VTK_LINE: return eSEG2;
-    case VTK_TRIANGLE: return eTRIA3;
-    case VTK_QUAD: return eQUAD4;
-    case VTK_TETRA: return eTETRA4;
-    case VTK_HEXAHEDRON: return eHEXA8;
-    case VTK_WEDGE: return ePENTA6;
-    case VTK_PYRAMID: return ePYRA5;
-    case VTK_POLYGON: return ePOLYGONE;
-    case VTK_CONVEX_POINT_SET: return ePOLYEDRE;
+    case VTK_VERTEX: return MED::ePOINT1;
+    case VTK_LINE: return MED::eSEG2;
+    case VTK_TRIANGLE: return MED::eTRIA3;
+    case VTK_QUAD: return MED::eQUAD4;
+    case VTK_TETRA: return MED::eTETRA4;
+    case VTK_HEXAHEDRON: return MED::eHEXA8;
+    case VTK_WEDGE: return MED::ePENTA6;
+    case VTK_PYRAMID: return MED::ePYRA5;
+    case VTK_POLYGON: return MED::ePOLYGONE;
+    case VTK_CONVEX_POINT_SET: return MED::ePOLYEDRE;
     }
-    return EGeometrieElement(-1);
+    return MED::EGeometrieElement(-1);
   }
 
 
@@ -119,10 +117,10 @@ namespace
   MEDEntityToVTK(MED::EEntiteMaillage theMEDEntity)
   {
     switch(theMEDEntity){
-    case eNOEUD: return NODE_ENTITY;
-    case eARETE: return EDGE_ENTITY;
-    case eFACE: return FACE_ENTITY;
-    case eMAILLE: return CELL_ENTITY;
+    case MED::eNOEUD: return NODE_ENTITY;
+    case MED::eARETE: return EDGE_ENTITY;
+    case MED::eFACE: return FACE_ENTITY;
+    case MED::eMAILLE: return CELL_ENTITY;
     }
     return TEntity(-1);
   }
@@ -133,10 +131,10 @@ namespace
   VTKEntityToMED(TEntity theVTKEntity)
   {
     switch(theVTKEntity){
-    case NODE_ENTITY: return eNOEUD;
-    case EDGE_ENTITY: return eARETE;
-    case FACE_ENTITY: return eFACE;
-    case CELL_ENTITY: return eMAILLE;
+    case NODE_ENTITY: return MED::eNOEUD;
+    case EDGE_ENTITY: return MED::eARETE;
+    case FACE_ENTITY: return MED::eFACE;
+    case CELL_ENTITY: return MED::eMAILLE;
     }
     return MED::EEntiteMaillage(-1);
   }
@@ -155,14 +153,14 @@ namespace
     aSubProfile->myGeom = aVGeom;
     aSubProfile->myStatus = eAddAll;
 
-    TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(theMGeom);
+    MED::TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(theMGeom);
     if(aTimeStampIter == theGeom2Size.end())
       aSubProfile->myStatus = eRemoveAll;
     else{
       aSubProfile->myNbCells = aTimeStampIter->second;
-      TGeom2Profile::const_iterator aProfileIter = theGeom2Profile.find(theMGeom);
+      MED::TGeom2Profile::const_iterator aProfileIter = theGeom2Profile.find(theMGeom);
       if(aProfileIter != theGeom2Profile.end()){
-       PProfileInfo aProfileInfo = aProfileIter->second;
+       MED::PProfileInfo aProfileInfo = aProfileIter->second;
 
        aSubProfile->myNbCells = aProfileInfo->myElemNum.size();
        aSubProfile->myName = aProfileInfo->GetName();
@@ -194,12 +192,12 @@ namespace
     INITMSG(MYDEBUG,"GetProfileKey"<<endl);
     
     TProfileKey aProfileKey;
-    const TGeom2Profile& aGeom2Profile = theTimeStampVal.GetGeom2Profile();
+    const MED::TGeom2Profile& aGeom2Profile = theTimeStampVal.GetGeom2Profile();
 
-    const TGeom2Size& aGeom2Size = theMeshOnEntity.myGeom2Size;
-    TGeom2Size::const_iterator anIter = aGeom2Size.begin();
+    const MED::TGeom2Size& aGeom2Size = theMeshOnEntity.myGeom2Size;
+    MED::TGeom2Size::const_iterator anIter = aGeom2Size.begin();
     for(; anIter != aGeom2Size.end(); anIter++){
-      EGeometrieElement aMGeom = anIter->first;
+      MED::EGeometrieElement aMGeom = anIter->first;
       PSubProfile aSubProfile = CrSubProfile(aMGeom,theGeom2Size,aGeom2Profile);
       aProfileKey.insert(aSubProfile);
     }
@@ -261,14 +259,14 @@ namespace
     TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
 
     TGaussKey aGaussKey;
-    const TGeom2Profile& aGeom2Profile = theTimeStampVal.GetGeom2Profile();
-    const TTimeStampInfo& aTimeStampInfo = theTimeStampVal.GetTimeStampInfo();
-    const TGeom2Gauss& aGeom2Gauss = aTimeStampInfo.GetGeom2Gauss();
+    const MED::TGeom2Profile& aGeom2Profile = theTimeStampVal.GetGeom2Profile();
+    const MED::TTimeStampInfo& aTimeStampInfo = theTimeStampVal.GetTimeStampInfo();
+    const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo.GetGeom2Gauss();
 
-    const TGeom2Size& aGeom2Size = theMeshOnEntity.myGeom2Size;
-    TGeom2Size::const_iterator anIter = aGeom2Size.begin();
+    const MED::TGeom2Size& aGeom2Size = theMeshOnEntity.myGeom2Size;
+    MED::TGeom2Size::const_iterator anIter = aGeom2Size.begin();
     for(; anIter != aGeom2Size.end(); anIter++){
-      EGeometrieElement aMGeom = anIter->first;
+      MED::EGeometrieElement aMGeom = anIter->first;
       vtkIdType aVGeom = MEDGeomToVTK(aMGeom);
 
       TGeom2SubProfile::iterator anIter2 = aGeom2SubProfile.find(aVGeom);
@@ -277,9 +275,9 @@ namespace
        continue;
       }
 
-      TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(aMGeom);
+      MED::TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(aMGeom);
       if(aTimeStampIter != theGeom2Size.end()){
-       TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
+       MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
        if(aGaussIter != aGeom2Gauss.end()){
          PMEDGaussSubMesh aGaussSubMesh(new TMEDGaussSubMesh());
          
@@ -291,7 +289,7 @@ namespace
          aGaussSubMesh->myGauss = aGauss;
          aGauss->myGeom = aVGeom;
 
-         PGaussInfo aGaussInfo = aGaussIter->second;
+         MED::PGaussInfo aGaussInfo = aGaussIter->second;
          aGauss->myGaussInfo = aGaussInfo;
 
          std::string aName = aGaussInfo->GetName();
@@ -395,10 +393,10 @@ VISU_Convertor*
 VISU_MedConvertor
 ::Build()
 {
-  PWrapper aMed = CrWrapper(myFileInfo.absFilePath().latin1());
+  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
 
-  TKey2Gauss aKey2Gauss = GetKey2Gauss(aMed);
-  TMKey2Profile aMKey2Profile = GetMKey2Profile(aMed);
+  MED::TKey2Gauss aKey2Gauss = MED::GetKey2Gauss(aMed);
+  MED::TMKey2Profile aMKey2Profile = MED::GetMKey2Profile(aMed);
 
   TInt aNbMeshes = aMed->GetNbMeshes();
   TMeshMap& aMeshMap = myMeshMap;
@@ -408,13 +406,13 @@ VISU_MedConvertor
 
   for(TInt iMesh = 1; iMesh <= aNbMeshes; iMesh++){
     try{
-      PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
+      MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
       
-      PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
+      MED::PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
       
       MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo);
       
-      TElemGroup aElemGroup = GetElemsByEntity(aMed,aMeshInfo,aEntityInfo);
+      MED::TElemGroup aElemGroup = MED::GetElemsByEntity(aMed,aMeshInfo,aEntityInfo);
       
       // creating TMesh structure and TMeshOnEntityMap
       typedef map<TInt,TInt> TFamilyCounterMap;
@@ -439,7 +437,7 @@ VISU_MedConvertor
       TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
       MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin();
       for(; anEntityIter != aEntityInfo.end(); anEntityIter++){
-       const EEntiteMaillage& aMEntity = anEntityIter->first;
+       const MED::EEntiteMaillage& aMEntity = anEntityIter->first;
        const MED::TGeom2Size& aGeom2Size = anEntityIter->second;
        
        TEntity aVEntity = MEDEntityToVTK(aMEntity);
@@ -452,7 +450,7 @@ VISU_MedConvertor
                "; aVEntity = "<<aVEntity<<
                endl);
        
-       if(aMEntity == eNOEUD){
+       if(aMEntity == MED::eNOEUD){
          aMeshOnEntity->myNbCells = aMesh->myNbPoints;
          aMeshOnEntity->myCellsSize = 2*aMesh->myNbPoints;
          
@@ -473,14 +471,14 @@ VISU_MedConvertor
          aMeshOnEntity->myNbCells = 0;
          aMeshOnEntity->myCellsSize = 0;
          for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
-           const EGeometrieElement& aMGeom = aGeom2SizeIter->first;
+           const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
            
            switch(aMGeom){
-           case ePOLYGONE: {
-             PPolygoneInfo aPolygoneInfo = aMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
+           case MED::ePOLYGONE: {
+             MED::PPolygoneInfo aPolygoneInfo = aMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
              TInt aNbElem = aPolygoneInfo->GetNbElem();
-             TElemNum aConn  = aPolygoneInfo->GetConnectivite();
-             TElemNum aIndex = aPolygoneInfo->GetIndex();
+             MED::TElemNum aConn  = aPolygoneInfo->GetConnectivite();
+             MED::TElemNum aIndex = aPolygoneInfo->GetIndex();
              TInt aNbIndex = aIndex.size();
              TInt aNbConn  = aConn.size();
              
@@ -506,11 +504,11 @@ VISU_MedConvertor
              }
              break;
            }
-           case ePOLYEDRE: {
-             PPolyedreInfo aPolyedreInfo = aMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
+           case MED::ePOLYEDRE: {
+             MED::PPolyedreInfo aPolyedreInfo = aMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
              TInt aNbElem = aPolyedreInfo->GetNbElem();
-             TElemNum aConn  = aPolyedreInfo->GetConnectivite();
-             TElemNum aIndex = aPolyedreInfo->GetIndex();
+             MED::TElemNum aConn  = aPolyedreInfo->GetConnectivite();
+             MED::TElemNum aIndex = aPolyedreInfo->GetIndex();
              TInt aNbIndex = aIndex.size();
              TInt aNbConn  = aConn.size();
              
@@ -539,7 +537,7 @@ VISU_MedConvertor
            default: {
              vtkIdType aVGeom = MEDGeomToVTK(aMGeom);
              int aVNbNodes = VTKGeom2NbNodes(aVGeom);
-             PCellInfo aCellInfo = aMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
+             MED::PCellInfo aCellInfo = aMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
              TInt aNbElem = aCellInfo->GetNbElem();
              aMeshOnEntity->myNbCells += aNbElem;
              aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
@@ -566,12 +564,12 @@ VISU_MedConvertor
       TInt aNbFields = aMed->GetNbFields(); 
       BEGMSG(MYDEBUG,"TField: aNbFields = "<<aNbFields<<"\n");
       for(TInt iField = 1; iField <= aNbFields; iField++){
-       PFieldInfo aFieldInfo = aMed->GetPFieldInfo(aMeshInfo,iField);
+       MED::PFieldInfo aFieldInfo = aMed->GetPFieldInfo(aMeshInfo,iField);
        TInt aNbComp = aFieldInfo->GetNbComp();
-       const string& aFieldName = aFieldInfo->GetName();
+       const std::string& aFieldName = aFieldInfo->GetName();
        
        MED::TGeom2Size aGeom2Size;
-       EEntiteMaillage aMEntity;
+       MED::EEntiteMaillage aMEntity;
        TInt aNbTimeStamps = aMed->GetNbTimeStamps(aFieldInfo,
                                                   aEntityInfo,
                                                   aMEntity,
@@ -604,15 +602,15 @@ VISU_MedConvertor
        }
        
        for(TInt iTimeStamp = 1; iTimeStamp <= aNbTimeStamps; iTimeStamp++){
-         PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
-                                                                 aMEntity,
-                                                                 aGeom2Size,
-                                                                 iTimeStamp);
+         MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
+                                                                      aMEntity,
+                                                                      aGeom2Size,
+                                                                      iTimeStamp);
          TFloat aDt = aTimeStampInfo->GetDt();
-         const string& anUnitDt = aTimeStampInfo->GetUnitDt();
-         PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo,
-                                                              aMKey2Profile,
-                                                              aKey2Gauss);
+         const std::string& anUnitDt = aTimeStampInfo->GetUnitDt();
+         MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo,
+                                                                   aMKey2Profile,
+                                                                   aKey2Gauss);
          TValField& aValField = aField->myValField;
          PMEDValForTime aValForTime = aValField[iTimeStamp](new TMEDValForTime());
          aValForTime->myId = iTimeStamp;
@@ -632,25 +630,25 @@ VISU_MedConvertor
 
       continue;
 
-      TFamilyGroup aFamilyGroup = GetFamilies(aMed,aMeshInfo);
-      TFamilyByEntity aFamilyByEntity = GetFamiliesByEntity(aMed,aElemGroup,aFamilyGroup);
-      TFamilyByEntity::const_iterator aFamilyByEntityIter = aFamilyByEntity.begin();
+      MED::TFamilyGroup aFamilyGroup = MED::GetFamilies(aMed,aMeshInfo);
+      MED::TFamilyByEntity aFamilyByEntity = MED::GetFamiliesByEntity(aMed,aElemGroup,aFamilyGroup);
+      MED::TFamilyByEntity::const_iterator aFamilyByEntityIter = aFamilyByEntity.begin();
       BEGMSG(MY_FAMILY_DEBUG,"TFamilyByEntity:\n");
       for(; aFamilyByEntityIter != aFamilyByEntity.end(); aFamilyByEntityIter++){
-       const EEntiteMaillage& aMEntity = aFamilyByEntityIter->first;
-       const TFamilyGroup& aFamilyGroup = aFamilyByEntityIter->second;
+       const MED::EEntiteMaillage& aMEntity = aFamilyByEntityIter->first;
+       const MED::TFamilyGroup& aFamilyGroup = aFamilyByEntityIter->second;
        
        TEntity aVEntity = MEDEntityToVTK(aMEntity);
-       VISU::PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity];
-       VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+       PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity];
+       TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
        
        if(aFamilyGroup.empty())
          continue;
        
        INITMSG(MY_FAMILY_DEBUG,"aMEntity = "<<aMEntity<<"; aVEntity = "<<aVEntity<<"\n");
-       TFamilyGroup::const_iterator aFamilyGroupIter = aFamilyGroup.begin();
+       MED::TFamilyGroup::const_iterator aFamilyGroupIter = aFamilyGroup.begin();
        for(; aFamilyGroupIter != aFamilyGroup.end(); aFamilyGroupIter++){
-         const PFamilyInfo& aFamilyInfo = *aFamilyGroupIter;
+         const MED::PFamilyInfo& aFamilyInfo = *aFamilyGroupIter;
          if (aFamilyInfo->GetId() == 0) 
            continue;
          
@@ -682,22 +680,22 @@ VISU_MedConvertor
       }
       
       BEGMSG(MY_GROUP_DEBUG,"TGroup:\n");
-      VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
-      TGroupInfo aGroupInfo = GetFamiliesByGroup(aFamilyGroup);
-      TGroupInfo::const_iterator aGroupInfoIter = aGroupInfo.begin();
-      for(;aGroupInfoIter != aGroupInfo.end(); aGroupInfoIter++){
-       const string& aGroupName = aGroupInfoIter->first;
-       const TFamilyGroup& aFamilyGroup = aGroupInfoIter->second;
+      TGroupMap& aGroupMap = aMesh->myGroupMap;
+      MED::TGroupInfo aGroupInfo = GetFamiliesByGroup(aFamilyGroup);
+      MED::TGroupInfo::const_iterator aGroupInfoIter = aGroupInfo.begin();
+      for(; aGroupInfoIter != aGroupInfo.end(); aGroupInfoIter++){
+       const std::string& aGroupName = aGroupInfoIter->first;
+       const MED::TFamilyGroup& aFamilyGroup = aGroupInfoIter->second;
        PMEDGroup aGroup(new TMEDGroup());
        aGroup->myName = aGroupName;
        aGroup->myMeshName = aMesh->myName;
        
        INITMSG(MY_GROUP_DEBUG,"aGroup->myName = '"<<aGroup->myName<<"'\n");
        
-       TFamilyGroup::const_iterator aFamilyIter = aFamilyGroup.begin();
+       MED::TFamilyGroup::const_iterator aFamilyIter = aFamilyGroup.begin();
        for(; aFamilyIter != aFamilyGroup.end(); aFamilyIter++){
-         const PFamilyInfo& aFamilyInfo = *aFamilyIter;
-         const string& aFamilyName = aFamilyInfo->GetName();
+         const MED::PFamilyInfo& aFamilyInfo = *aFamilyIter;
+         const std::string& aFamilyName = aFamilyInfo->GetName();
          
          TEntity aVEntity = TEntity(-1);
          PMEDFamily aFamily;
@@ -710,7 +708,7 @@ VISU_MedConvertor
            const TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
            TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
            for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
-             const string& aName = aFamilyMapIter->first;
+             const std::string& aName = aFamilyMapIter->first;
              aFamily = aFamilyMapIter->second;
              if(aName == aFamilyName){
                aVEntity = aFamily->myEntity;
@@ -756,12 +754,12 @@ VISU_MedConvertor
 ::LoadMeshOnEntity(VISU::PMeshOnEntityImpl theMeshOnEntity, 
                   const string& theFamilyName)
 {
-  PWrapper aMed = CrWrapper(myFileInfo.absFilePath().latin1());
-  const string& aMeshName = theMeshOnEntity->myMeshName;
-  const VISU::TEntity& anEntity = theMeshOnEntity->myEntity;
+  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
+  const std::string& aMeshName = theMeshOnEntity->myMeshName;
+  const TEntity& anEntity = theMeshOnEntity->myEntity;
   PMeshImpl aMesh = myMeshMap[aMeshName];
   int isPointsUpdated;
-  if(anEntity == VISU::NODE_ENTITY) 
+  if(anEntity == NODE_ENTITY) 
     isPointsUpdated = LoadPoints(aMed,aMesh,theFamilyName);
   else
     isPointsUpdated = LoadPoints(aMed,aMesh);
@@ -777,14 +775,14 @@ VISU_MedConvertor
 ::LoadMeshOnGroup(VISU::PMeshImpl theMesh, 
                  const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
 {
-  PWrapper aMed = CrWrapper(myFileInfo.absFilePath().latin1());
+  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
   int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
-  VISU::TFamilyAndEntitySet::const_iterator aFamilyAndEntitySetIter = theFamilyAndEntitySet.begin();
+  TFamilyAndEntitySet::const_iterator aFamilyAndEntitySetIter = theFamilyAndEntitySet.begin();
   for(; aFamilyAndEntitySetIter != theFamilyAndEntitySet.end(); aFamilyAndEntitySetIter++){
-    const string& aFamilyName = aFamilyAndEntitySetIter->first;
-    const VISU::TEntity& anEntity = aFamilyAndEntitySetIter->second;
-    const VISU::PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity];
-    if(anEntity == VISU::NODE_ENTITY){
+    const std::string& aFamilyName = aFamilyAndEntitySetIter->first;
+    const TEntity& anEntity = aFamilyAndEntitySetIter->second;
+    const PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity];
+    if(anEntity == NODE_ENTITY){
       isPointsUpdated += LoadPoints(aMed,theMesh,aFamilyName);
       isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,aMeshOnEntity);
     }else{
@@ -805,7 +803,7 @@ VISU_MedConvertor
                  VISU::PFieldImpl theField, 
                  VISU::PValForTimeImpl theValForTime)
 {
-  PWrapper aMed = CrWrapper(myFileInfo.absFilePath().latin1());
+  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
   int isPointsUpdated = LoadPoints(aMed,theMesh);
   int isCellsOnEntityUpdated = LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
   int isFieldUpdated = LoadField(aMed,theMesh,theMeshOnEntity,theField,theValForTime);
@@ -823,8 +821,8 @@ VISU_MedConvertor
 {
   try{
     //Check on existing family
-    VISU::PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[VISU::NODE_ENTITY];
-    aMeshOnEntity->myEntity = VISU::NODE_ENTITY;
+    PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[VISU::NODE_ENTITY];
+    aMeshOnEntity->myEntity = NODE_ENTITY;
     aMeshOnEntity->myMeshName = theMesh->myName;
     PMEDFamily aFamily = GetFamily(aMeshOnEntity,theFamilyName);
 
@@ -839,7 +837,7 @@ VISU_MedConvertor
            "; theFamilyName = '"<<theFamilyName<<"'\n");
 
     //Main part of code
-    PNodeInfo aNodeInfo = theMed->GetPNodeInfo(theMesh->myMeshInfo);
+    MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(theMesh->myMeshInfo);
     TInt aNbElem = aNodeInfo->GetNbElem();
 
     if(!theMesh->myIsMEDDone){
@@ -852,12 +850,12 @@ VISU_MedConvertor
        aCoords.GetName(iDim) = aNodeInfo->GetCoordName(iDim);
       
       for(int iElem = 0; iElem < aNbElem; iElem++){
-       VISU::TCoordSlice aCoordSlice = aCoords.GetCoordSlice(iElem);
+       TCoordSlice aCoordSlice = aCoords.GetCoordSlice(iElem);
        for(int iDim = 0; iDim < aDim; iDim++)
          aCoordSlice[iDim] = aNodeInfo->GetNodeCoord(iElem,iDim);
       }
 
-      VISU::TCell2Connect& aConnForCellType = aMeshOnEntity->myGeom2Cell2Connect[VTK_VERTEX];
+      TCell2Connect& aConnForCellType = aMeshOnEntity->myGeom2Cell2Connect[VTK_VERTEX];
       aConnForCellType.resize(aNbElem);
       for (int iElem = 0; iElem < aNbElem; iElem++)
        aConnForCellType[iElem] = VISU::TConnect(1,iElem);
@@ -868,7 +866,7 @@ VISU_MedConvertor
     if(aFamily){
       if(!aFamily->myIsMEDDone){
        if(aNbElem > 0){
-         VISU::TSubMeshID& aSubMeshID = aFamily->myGeom2SubMeshID[VTK_VERTEX];
+         TSubMeshID& aSubMeshID = aFamily->myGeom2SubMeshID[VTK_VERTEX];
          for (int iElem = 0; iElem < aNbElem; iElem++) 
            if(aNodeInfo->GetFamNum(iElem) == aFamily->myId)
              aSubMeshID.push_back(iElem);
@@ -910,16 +908,16 @@ VISU_MedConvertor
     INITMSG(MYDEBUG,"LoadCellsOnEntity - theFamilyName = '"<<theFamilyName<<"'\n");
     BEGMSG(MYDEBUG,"LoadCellsOnEntity - isCellsLoaded = "<<isCellsLoaded<<"; isFamilyPresent = "<<bool(aFamily)<<endl);
 
-    const VISU::TEntity& aVEntity = theMeshOnEntity->myEntity;
-    const EEntiteMaillage& aMEntity = VTKEntityToMED(aVEntity);
+    const TEntity& aVEntity = theMeshOnEntity->myEntity;
+    const MED::EEntiteMaillage& aMEntity = VTKEntityToMED(aVEntity);
 
-    const PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
-    PNodeInfo aNodeInfo = theMed->GetPNodeInfo(aMeshInfo);
+    const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
+    MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(aMeshInfo);
     TInt aNbPoints = aNodeInfo->GetNbElem();
 
     std::map<TInt,TInt> aNodeIdMap;
 #ifdef _EDF_NODE_IDS_
-    EBooleen anIsNodeNum = eFAUX;
+    EBooleen anIsNodeNum = MED::eFAUX;
 #else
     EBooleen anIsNodeNum = aNodeInfo->IsElemNum();
     if(anIsNodeNum){
@@ -934,22 +932,22 @@ VISU_MedConvertor
     TGeom2Cell2Connect& aGeom2Cell2Connect = theMeshOnEntity->myGeom2Cell2Connect;
 
     for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
-      const EGeometrieElement& aMGeom = aGeom2SizeIter->first;
+      const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
       int aVGeom = MEDGeomToVTK(aMGeom);
       INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
       switch(aMGeom){
-      case ePOLYGONE: {
-       PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
+      case MED::ePOLYGONE: {
+       MED::PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
        TInt aNbElem = aPolygoneInfo->GetNbElem();
        
        if(!isCellsLoaded){
          TCell2Connect& aCell2Connect = aGeom2Cell2Connect[aVGeom];
          aCell2Connect.resize(aNbElem);
 
-         const TElemNum& aIndex = aPolygoneInfo->GetIndex();
-         const TElemNum& aConnect = aPolygoneInfo->GetConnectivite();
+         const MED::TElemNum& aIndex = aPolygoneInfo->GetIndex();
+         const MED::TElemNum& aConnect = aPolygoneInfo->GetConnectivite();
 
-         for (int iElem = 0; iElem < aNbElem; iElem++) {
+         for(int iElem = 0; iElem < aNbElem; iElem++) {
            TConnect& anArray = aCell2Connect[iElem];
            int aNbConn = aPolygoneInfo->GetNbConn(iElem);
            anArray.resize(aNbConn);
@@ -965,17 +963,17 @@ VISU_MedConvertor
        }
        break;
       }
-      case ePOLYEDRE: {
-       PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
+      case MED::ePOLYEDRE: {
+       MED::PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
        TInt aNbElem = aPolyedreInfo->GetNbElem();
        
        if(!isCellsLoaded){
          TCell2Connect& aCell2Connect = aGeom2Cell2Connect[aVGeom];
          aCell2Connect.resize(aNbElem);
          
-         const TElemNum& aConnect = aPolyedreInfo->GetConnectivite();
-         const TElemNum& aFaces = aPolyedreInfo->GetFaces();
-         const TElemNum& aIndex = aPolyedreInfo->GetIndex();
+         const MED::TElemNum& aConnect = aPolyedreInfo->GetConnectivite();
+         const MED::TElemNum& aFaces = aPolyedreInfo->GetFaces();
+         const MED::TElemNum& aIndex = aPolyedreInfo->GetIndex();
          
          for(int iElem = 0; iElem < aNbElem; iElem++){
            typedef set<TInt> TConnectSet;
@@ -1011,18 +1009,18 @@ VISU_MedConvertor
       default: {
        int aVNbNodes = VTKGeom2NbNodes(aVGeom);
        
-       PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
+       MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
        TInt aNbElem = aCellInfo->GetNbElem();
        
        if(!isCellsLoaded){
-         VISU::TCell2Connect& aConnForCellType = aGeom2Cell2Connect[aVGeom];
+         TCell2Connect& aConnForCellType = aGeom2Cell2Connect[aVGeom];
          aConnForCellType.resize(aNbElem);
          
          int aMNbNodes = MEDGeom2NbNodes(aMGeom);
          vector<TInt> aConnect(aMNbNodes);
          
          for (int iElem = 0; iElem < aNbElem; iElem++) {
-           VISU::TConnect& anArray = aConnForCellType[iElem];
+           TConnect& anArray = aConnForCellType[iElem];
            anArray.resize(aVNbNodes);
            
            if(anIsNodeNum){
@@ -1036,15 +1034,15 @@ VISU_MedConvertor
            }
            
            switch(aMGeom){
-           case eTETRA4:
-           case eTETRA10:
+           case MED::eTETRA4:
+           case MED::eTETRA10:
              anArray[0] = aConnect[0];
              anArray[1] = aConnect[1];
              anArray[2] = aConnect[3];  
              anArray[3] = aConnect[2];  
              break;
-           case ePYRA5:
-           case ePYRA13:
+           case MED::ePYRA5:
+           case MED::ePYRA13:
              anArray[0] = aConnect[0];
              anArray[1] = aConnect[3];  
              anArray[2] = aConnect[2];
@@ -1066,7 +1064,7 @@ VISU_MedConvertor
        }
        //Filling aFamily Geom2SubMeshID
        if(aFamily){
-         VISU::TSubMeshID& aSubMeshID = aFamily->myGeom2SubMeshID[aVGeom];
+         TSubMeshID& aSubMeshID = aFamily->myGeom2SubMeshID[aVGeom];
          for(int iElem = 0; iElem < aNbElem; iElem++) 
            if(aCellInfo->GetFamNum(iElem) == aFamily->myId)
              aSubMeshID.push_back(iElem);
@@ -1099,8 +1097,8 @@ LoadProfile(MED::TTimeStampVal& theTimeStampVal,
     return;
 
   const TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
-  const TGeom2Profile& aGeom2Profile = theTimeStampVal.GetGeom2Profile();
-  TGeom2Profile::const_iterator anIter = aGeom2Profile.begin();
+  const MED::TGeom2Profile& aGeom2Profile = theTimeStampVal.GetGeom2Profile();
+  MED::TGeom2Profile::const_iterator anIter = aGeom2Profile.begin();
   for(; anIter != aGeom2Profile.end(); anIter++){
     MED::PProfileInfo aProfileInfo = anIter->second;
     MED::EGeometrieElement aMGeom = anIter->first;
@@ -1145,16 +1143,16 @@ LoadGaussMesh(const MED::PWrapper& theMed,
   if(aGaussMesh->myIsMEDDone)
     return;
 
-  const PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
-  PNodeInfo aNodeInfo = theMed->GetPNodeInfo(aMeshInfo);
+  const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
+  MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(aMeshInfo);
 
   TEntity aVEntity = theMeshOnEntity.myEntity;
-  EEntiteMaillage aMEntity = VTKEntityToMED(aVEntity);
+  MED::EEntiteMaillage aMEntity = VTKEntityToMED(aVEntity);
 
   const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
-  const TTimeStampInfo& aTimeStampInfo = theTimeStampVal.GetTimeStampInfo();
-  const TGeom2Gauss& aGeom2Gauss = aTimeStampInfo.GetGeom2Gauss();
-  TGeom2Gauss::const_iterator anIter = aGeom2Gauss.begin();
+  const MED::TTimeStampInfo& aTimeStampInfo = theTimeStampVal.GetTimeStampInfo();
+  const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo.GetGeom2Gauss();
+  MED::TGeom2Gauss::const_iterator anIter = aGeom2Gauss.begin();
   for(; anIter != aGeom2Gauss.end(); anIter++){
     MED::PGaussInfo aGaussInfo = anIter->second;
     MED::EGeometrieElement aMGeom = anIter->first;
@@ -1198,10 +1196,10 @@ LoadGaussMesh(const MED::PWrapper& theMed,
          vtkIdType aNbCells = aNbElem*aNbGauss;
          aCoords.Init(aNbCells,aDim);
          for(TInt anElemId = 0, aNodeId = 0; anElemId < aNbElem; anElemId++){
-           TCoordSliceArr aCoordSliceArr = aGaussCoord.GetCoordSliceArr(anElemId);
+           MED::TCoordSliceArr aCoordSliceArr = aGaussCoord.GetCoordSliceArr(anElemId);
            for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++, aNodeId++){
-             VISU::TCoordSlice aSlice = aCoords.GetCoordSlice(aNodeId);
              MED::TCoordSlice aCoordSlice = aCoordSliceArr[aGaussId];
+             TCoordSlice aSlice = aCoords.GetCoordSlice(aNodeId);
              for(TInt aDimId = 0; aDimId < aDim; aDimId++)
                aSlice[aDimId] = aCoordSlice[aDimId];
            }
@@ -1245,27 +1243,27 @@ VISU_MedConvertor
 
   //Main part of code
   const std::string& aMeshName = theMeshOnEntity->myMeshName;
-  const PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
-  PFieldInfo aFieldInfo = theMed->GetPFieldInfo(aMeshInfo,
-                                               theField->myId);
+  const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
+  MED::PFieldInfo aFieldInfo = theMed->GetPFieldInfo(aMeshInfo,
+                                                    theField->myId);
 
   MED::TGeom2Size aGeom2Size;
-  EEntiteMaillage aMEntity;
+  MED::EEntiteMaillage aMEntity;
   theMed->GetNbTimeStamps(aFieldInfo,
                          theMesh->myEntityInfo,
                          aMEntity,
                          aGeom2Size);
 
-  PTimeStampInfo aTimeStampInfo = 
+  MED::PTimeStampInfo aTimeStampInfo = 
     theMed->GetPTimeStampInfo(aFieldInfo,
                              aMEntity,
                              aGeom2Size,
                              theValForTime->myId);
 
-  TKey2Gauss aKey2Gauss = GetKey2Gauss(*theMed);
-  TMKey2Profile aMKey2Profile = GetMKey2Profile(*theMed);
+  MED::TKey2Gauss aKey2Gauss = GetKey2Gauss(*theMed);
+  MED::TMKey2Profile aMKey2Profile = GetMKey2Profile(*theMed);
 
-  PTimeStampVal aTimeStampVal = 
+  MED::PTimeStampVal aTimeStampVal = 
     theMed->GetPTimeStampVal(aTimeStampInfo,
                             aMKey2Profile,
                             aKey2Gauss);
@@ -1283,7 +1281,7 @@ VISU_MedConvertor
   PMEDProfile aProfile = theValForTime->myProfile;
   TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
 
-  const TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss();
+  const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss();
   TInt aNbComp = theField->myNbComp;
 
   INITMSGA(MYDEBUG,0,
@@ -1311,14 +1309,20 @@ VISU_MedConvertor
              "; aNbElem = "<<aNbElem<<
              "; aNbGauss = "<<aNbGauss<<
              endl);
+      
+      TMeshValue& aVMeshValue = theValForTime->GetMeshValue(aVGeom);
+      aVMeshValue.Init(aNbElem,aNbGauss,aNbComp);
 
-      TValForCellsWithType& anArray = theValForTime->myValForCells[aVGeom];
       MED::EGeometrieElement aMGeom = VTKGeomToMED(aVGeom);
-      anArray.resize(aNbComp*aNbElem*aNbGauss);
-      for(TInt iElem = 0, anId = 0; iElem < aNbElem; iElem++){
-       for(TInt iComp = 0; iComp < aNbComp; iComp++){
-         for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++, anId++){
-           anArray[anId] = aTimeStampVal->GetVal(aMGeom,iElem,iComp,iGauss);
+      const MED::TMeshValue& aMMeshValue = aTimeStampVal->GetMeshValue(aMGeom);
+      for(TInt iElem = 0; iElem < aNbElem; iElem++){
+       TValueSliceArr aVValueSliceArr = aVMeshValue.GetGaussValueSliceArr(iElem);
+       MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetValueSliceArr(iElem);
+       for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+         TValueSlice& aVValueSlice = aVValueSliceArr[iGauss];
+         const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
+         for(TInt iComp = 0; iComp < aNbComp; iComp++){
+           aVValueSlice[iComp] = aMValueSlice[iComp];
          }
        }
       }
index e8ad9995ff9c9323d99be0ee83fdce87c4293862..f25b41ee7a6f8633ea0952212394e1f9e9b250c6 100644 (file)
@@ -1156,17 +1156,27 @@ ImportField(TArray& theArray,
            VISU::PCValForTime theValForTime,
            VISU::PCMeshOnEntity theMeshOnEntity)
 {
+  int aNbComp = theField->myNbComp;
   if(theField->myEntity == NODE_ENTITY){
-    TValForCellsWithType& aValForCellsWithType = 
-      theValForTime->myValForCells[VTK_VERTEX];
-
+    int aVGeom = VTK_VERTEX;
+    int aNbGauss = theValForTime->GetNbGauss(aVGeom);
     const TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
     int aNbPoints = aCoords.GetNbPoints();
-    int iNumElemEnd = aNbPoints*theField->myNbComp;
-    if(MYDEBUG) MESSAGE("ImportField - iNumElemEnd = "<<iNumElemEnd);
-    aValForCellsWithType.resize(iNumElemEnd);
-    for (int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++) 
-      aValForCellsWithType[iNumElem] = theArray[iNumElem];
+    int aNbElem = aNbPoints*aNbComp;
+
+    if(MYDEBUG) MESSAGE("ImportField - aNbElem = "<<aNbElem);
+
+    TMeshValue& aMeshValue = theValForTime->GetMeshValue(VTK_VERTEX);
+    aMeshValue.Init(aNbElem,aNbGauss,aNbComp);
+    for(int iElem = 0, anId = 0; iElem < aNbElem; iElem++){
+      TValueSliceArr aValueSliceArr = aMeshValue.GetGaussValueSliceArr(iElem);
+      for(int iGauss = 0; iGauss < aNbGauss; iGauss++){
+       TValueSlice& aValueSlice = aValueSliceArr[iGauss];
+       for(int iComp = 0; iComp < aNbComp; iComp++){
+         aValueSlice[iComp] = theArray[anId++];
+       }
+      }
+    }
   }else{
     SALOME_MED::medGeometryElement* aGeomElems;
     const TEntity& aVEntity = theField->myEntity;
@@ -1174,20 +1184,28 @@ ImportField(TArray& theArray,
     for(int iGeom = 0; iGeom < iGeomEnd; iGeom++){
       SALOME_MED::medGeometryElement aGeom = aGeomElems[iGeom];
       int aVGeom = MEDGeomToVTK(aGeom);
+      int aNbGauss = theValForTime->GetNbGauss(aVGeom);
       const TCMeshOnEntity::TCellsFirstIndex& aCellsFirstIndex = theMeshOnEntity->myCellsFirstIndex;
       TCMeshOnEntity::TCellsFirstIndex::const_iterator aCellsFirstIndexIter = aCellsFirstIndex.find(aGeom);
       if(aCellsFirstIndexIter != aCellsFirstIndex.end()){
        const TCMeshOnEntity::TIndexAndSize& aIndexAndSize = aCellsFirstIndexIter->second;
-       int iNumElemEnd = aIndexAndSize.second;
        if(MYDEBUG) 
          MESSAGE("ImportField - aGeom = "<<aGeom<<
                  "; aIndexAndSize = {"<<aIndexAndSize.first<<
                  ","<<aIndexAndSize.second<<"}");
-       TValForCellsWithType& aValForCellsWithType = theValForTime->myValForCells[aVGeom];
-       aValForCellsWithType.resize(iNumElemEnd*theField->myNbComp);
-       for(int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++)
-         for(int k = 0, kj = iNumElem*theField->myNbComp; k < theField->myNbComp; k++)
-           aValForCellsWithType[kj+k] = theArray[aIndexAndSize.first*theField->myNbComp+kj+k];
+
+       int aNbElem = aIndexAndSize.second;
+       int aStart = aIndexAndSize.first*aNbComp;
+       TMeshValue& aMeshValue = theValForTime->GetMeshValue(aVGeom);
+       aMeshValue.Init(aNbElem,aNbGauss,aNbComp);
+       for(int iElem = 0, anId = 0; iElem < aNbElem; iElem++, anId += aNbComp){
+         TValueSliceArr aValueSliceArr = aMeshValue.GetGaussValueSliceArr(iElem);
+         for(int iGauss = 0; iGauss < aNbGauss; iGauss++){
+           TValueSlice& aValueSlice = aValueSliceArr[iGauss];
+           for(int iComp = 0; iComp < aNbComp; iComp++)
+             aValueSlice[iComp] = theArray[aStart+anId+iComp];
+         }
+       }
       }
     }
   }
@@ -1201,9 +1219,9 @@ VISU_MEDConvertor::LoadField(VISU::PCMesh theMesh,
                             VISU::PCValForTime theValForTime)
 {
   //Check on loading already done
-  if(!theValForTime->myValForCells.empty()
+  if(theValForTime->myIsCDone
     return 0;
+  
   SALOME_MED::FIELD_var aMEDField = theValForTime->myField;
   SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
   if(!aFieldDouble->_is_nil()){
index bbf41cefaae5f51871c175b3c05043b66bf836ee..7f119bedcd2cc3f33bc4b342385d6c21bf56ee81 100644 (file)
@@ -89,7 +89,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TCValForTime: virtual TValForTimeImpl
+  struct TCValForTime: virtual TValForTimeImpl, virtual TIsCDone
   {
     SALOME_MED::FIELD_var myField;
   };