]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To do that TVTKIsDone data structure can be used as on VISU_Converter_impl level...
authorapo <apo@opencascade.com>
Mon, 1 Aug 2005 06:19:10 +0000 (06:19 +0000)
committerapo <apo@opencascade.com>
Mon, 1 Aug 2005 06:19:10 +0000 (06:19 +0000)
src/CONVERTOR/VISUConvertor.cxx
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_Convertor_impl.hxx
src/CONVERTOR/VISU_MedConvertor.cxx
src/CONVERTOR/VISU_MedConvertor.hxx
src/VISU_I/VISU_CorbaMedConvertor.cxx
src/VISU_I/VISU_CorbaMedConvertor.hxx

index c784c4b174b0fc93f05b8bbb197162abf40e6072..daf53e9484f4e10b5f0920d93f8cf42ecd24403c 100644 (file)
@@ -43,7 +43,7 @@ static int MYDEBUG = 1;
 static int MYDEBUG = 0;
 #endif
 
-//#define _DEXCEPT_
+#define _DEXCEPT_
 
 void parseFile(const char* theFileName) {
 #ifndef _DEXCEPT_
index 15662ff88d4d109766427917e07e0adbae2374a4..2601aa61fde5322a0e741429a5330f43f6bbe684 100644 (file)
@@ -70,7 +70,8 @@ namespace VISU
 {
   //---------------------------------------------------------------
   TIsVTKDone::TIsVTKDone(): 
-    myIsVTKDone(false)
+    myIsVTKDone(false),
+    myIsDone(false)
   {}
 
 
@@ -1082,10 +1083,13 @@ namespace
     PGaussImpl aGauss = theGaussSubMesh->myGauss;
     INITMSG(MYDEBUG,"GetGaussSubMesh - aGeom = "<<aGauss->myGeom<<endl);
     
+    if(!theGaussSubMesh->myIsDone)
+      return;
+    
     if(theGaussSubMesh->myIsVTKDone)
       return;
     
-    TVTKSource& aSource = theGaussSubMesh->mySource;
+   TVTKSource& aSource = theGaussSubMesh->mySource;
     GetSource(aSource,theGaussSubMesh,theMeshOnEntity);
     INITMSGA(MYDEBUG,0,"GetNumberOfPoints - "<<aSource->GetNumberOfPoints()<<endl);
     BEGMSG(MYDEBUG,"GetNumberOfCells - "<<aSource->GetNumberOfCells()<<endl);
index 8a6f88c4ee00bdce1de87f06f80fda830e60c017..133e15ba34e76b3a45523a4c43f2d59f92a14ee5 100644 (file)
@@ -38,6 +38,7 @@ namespace VISU
   struct TIsVTKDone: virtual TBaseStructure
   {
     TIsVTKDone();
+    bool myIsDone;
     bool myIsVTKDone;
   };
 
index cc6aa53b455ab9e135d2370d1d82bdd417e68d9f..4296266d33585a18a598a9c0628130e7561cfb53 100644 (file)
@@ -820,20 +820,20 @@ VISU_MedConvertor
     PMEDFamily aFamily = GetFamily(aMeshOnEntity,theFamilyName);
 
     //Check on loading already done
-    if(theMesh->myIsMEDDone)
+    if(theMesh->myIsDone)
       if(!aFamily) 
        return 0;
-      else if(!aFamily->myIsMEDDone) 
+      else if(!aFamily->myIsDone) 
        return 0;
 
-    INITMSG(MYDEBUG,"LoadPoints - theMesh->myIsMEDDone = "<<theMesh->myIsMEDDone<<
+    INITMSG(MYDEBUG,"LoadPoints - theMesh->myIsDone = "<<theMesh->myIsDone<<
            "; theFamilyName = '"<<theFamilyName<<"'\n");
 
     //Main part of code
     MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(theMesh->myMeshInfo);
     TInt aNbElem = aNodeInfo->GetNbElem();
 
-    if(!theMesh->myIsMEDDone){
+    if(!theMesh->myIsDone){
       TInt aDim = theMesh->myDim;
 
       TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
@@ -854,18 +854,18 @@ VISU_MedConvertor
       for (int iElem = 0; iElem < aNbElem; iElem++)
        aConnForCellType[iElem] = VISU::TConnect(1,iElem);
       
-      theMesh->myIsMEDDone = true;
+      theMesh->myIsDone = true;
     }
 
     if(aFamily){
-      if(!aFamily->myIsMEDDone){
+      if(!aFamily->myIsDone){
        if(aNbElem > 0){
          TSubMeshID& aSubMeshID = aFamily->myGeom2SubMeshID[VTK_VERTEX];
          for (int iElem = 0; iElem < aNbElem; iElem++) 
            if(aNodeInfo->GetFamNum(iElem) == aFamily->myId)
              aSubMeshID.push_back(iElem);
        }
-       aFamily->myIsMEDDone = true;
+       aFamily->myIsDone = true;
       }
     }
 
@@ -1090,7 +1090,7 @@ LoadProfile(MED::TTimeStampVal& theTimeStampVal,
   INITMSG(MYDEBUG,"LoadProfile"<<endl);
 
   PMEDProfile aProfile = theValForTime.myProfile;
-  if(aProfile->myIsMEDDone)
+  if(aProfile->myIsDone)
     return;
 
   const TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
@@ -1121,7 +1121,7 @@ LoadProfile(MED::TTimeStampVal& theTimeStampVal,
     }
   }
 
-  aProfile->myIsMEDDone = true;
+  aProfile->myIsDone = true;
 }
 
 
@@ -1136,7 +1136,7 @@ LoadGaussMesh(const MED::PWrapper& theMed,
   INITMSG(MYDEBUG,"LoadGaussMesh"<<endl);
 
   PMEDGaussMesh aGaussMesh = theValForTime.myGaussMesh;
-  if(aGaussMesh->myIsMEDDone)
+  if(aGaussMesh->myIsDone)
     return;
 
   const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
@@ -1158,6 +1158,9 @@ LoadGaussMesh(const MED::PWrapper& theMed,
     if(anIter2 != aGeom2GaussSubMesh.end()){
       PMEDGaussSubMesh aGaussSubMesh = anIter2->second;
 
+      if(aGaussSubMesh->myIsDone)
+       continue;
+
       PMEDGauss aGauss = aGaussSubMesh->myGauss;
       MED::PGaussInfo aGaussInfo = aGauss->myGaussInfo;
       
@@ -1200,7 +1203,9 @@ LoadGaussMesh(const MED::PWrapper& theMed,
                aSlice[aDimId] = aCoordSlice[aDimId];
            }
          }
-
+         
+         aGaussSubMesh->myIsDone = true;;
+         
          INITMSG(MYDEBUG,
                  "- aVGeom = "<<aVGeom<<
                  "; aName = '"<<aGaussInfo->GetName()<<"'"<<
@@ -1208,6 +1213,7 @@ LoadGaussMesh(const MED::PWrapper& theMed,
                  "; aNbCells = "<<aNbCells<<
                  endl);
        }
+
       }else{
 
        INITMSG(MYDEBUG,
@@ -1218,7 +1224,7 @@ LoadGaussMesh(const MED::PWrapper& theMed,
     }
   }
   
-  aGaussMesh->myIsMEDDone = true;
+  aGaussMesh->myIsDone = true;
 }
 
 
@@ -1234,7 +1240,7 @@ VISU_MedConvertor
   INITMSG(MYDEBUG,"LoadField"<<endl);
 
   //Check on loading already done
-  if(theValForTime->myIsMEDDone) 
+  if(theValForTime->myIsDone) 
     return 0;
 
   //Main part of code
@@ -1325,7 +1331,7 @@ VISU_MedConvertor
     }
   }
 
-  theValForTime->myIsMEDDone = true;
+  theValForTime->myIsDone = true;
 
   return 1; 
 }
index ffa3c24c83aa79084e3c1ccb0f1a1c42e011165c..87cf1c85759bf75142c4c47f9df199da5cb12fa9 100644 (file)
 namespace VISU
 {
   //---------------------------------------------------------------
-  struct TIsMEDDone: virtual TBaseStructure
-  {
-    bool myIsMEDDone;
-    TIsMEDDone(): 
-      myIsMEDDone(false)
-    {}
-  };
-
-  
-  //---------------------------------------------------------------
-  struct TMEDMesh: virtual TMeshImpl, virtual TIsMEDDone
+  struct TMEDMesh: virtual TMeshImpl
   {
     MED::PMeshInfo myMeshInfo;
     MED::TEntityInfo myEntityInfo;
@@ -45,7 +35,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TMEDProfile: virtual TProfileImpl, virtual TIsMEDDone
+  struct TMEDProfile: virtual TProfileImpl
   {};
   typedef SharedPtr<TMEDProfile> PMEDProfile;
 
@@ -65,7 +55,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TMEDGaussMesh: virtual TGaussMeshImpl, virtual TIsMEDDone
+  struct TMEDGaussMesh: virtual TGaussMeshImpl
   {};
   typedef SharedPtr<TMEDGaussMesh> PMEDGaussMesh;
 
@@ -79,7 +69,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TMEDFamily: virtual TFamilyImpl, virtual TIsMEDDone
+  struct TMEDFamily: virtual TFamilyImpl
   {};
   typedef SharedPtr<TMEDFamily> PMEDFamily;
   
@@ -97,7 +87,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TMEDValForTime: virtual TValForTimeImpl, virtual TIsMEDDone
+  struct TMEDValForTime: virtual TValForTimeImpl
   {};
   typedef SharedPtr<TMEDValForTime> PMEDValForTime;
 
index f25b41ee7a6f8633ea0952212394e1f9e9b250c6..38c471b2bee6c9ba2faf6b5ac62f5c032f67e89d 100644 (file)
@@ -942,10 +942,10 @@ VISU_MEDConvertor::LoadPoints(VISU::PCMesh theMesh,
   PCFamily aFamily = GetFamily(aMeshOnEntity,theFamilyName);
 
   //Check on loading already done
-  if(theMesh->myIsCDone) 
+  if(theMesh->myIsDone) 
     if(!aFamily) 
       return 0;
-    else if(!aFamily->myIsCDone) 
+    else if(!aFamily->myIsDone) 
       return 0;
 
   if(MYDEBUG) 
@@ -962,7 +962,7 @@ VISU_MEDConvertor::LoadPoints(VISU::PCMesh theMesh,
     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);
-  if(!theMesh->myIsCDone){
+  if(!theMesh->myIsDone){
     for(int iElem = 0, anId = 0; iElem < aNbElem; iElem++){
       VISU::TCoordSlice aCoordSlice = aCoords.GetCoordSlice(iElem);
       for(int iDim = 0; iDim < aDim; iDim++)
@@ -976,11 +976,11 @@ VISU_MEDConvertor::LoadPoints(VISU::PCMesh theMesh,
     for(int iElem = 0; iElem < aNbElem; iElem++)
       aCell2Connect[iElem] = TConnect(1,iElem);
     
-    theMesh->myIsCDone = true;
+    theMesh->myIsDone = true;
   }
 
   if(aFamily){
-    if(!aFamily->myIsCDone){
+    if(!aFamily->myIsDone){
       if(MYDEBUG) MESSAGE("LoadPoints - Filling aFamily Geom2SubMeshID");
 
       SALOME_MED::FAMILY_var aMedFamily = aFamily->myFamily;
@@ -1007,7 +1007,7 @@ VISU_MEDConvertor::LoadPoints(VISU::PCMesh theMesh,
        }
       }
 
-      aFamily->myIsCDone = true;
+      aFamily->myIsDone = true;
     }
   }
 
@@ -1219,7 +1219,7 @@ VISU_MEDConvertor::LoadField(VISU::PCMesh theMesh,
                             VISU::PCValForTime theValForTime)
 {
   //Check on loading already done
-  if(theValForTime->myIsCDone) 
+  if(theValForTime->myIsDone) 
     return 0;
   
   SALOME_MED::FIELD_var aMEDField = theValForTime->myField;
@@ -1235,5 +1235,8 @@ VISU_MEDConvertor::LoadField(VISU::PCMesh theMesh,
     if(MYDEBUG) MESSAGE("VISU_MEDConvertor::LoadField - There is FIELDINT = "<<anArray->length());
     ::ImportField(anArray,theMesh,theField,theValForTime,theMeshOnEntity);
   }
+
+  theValForTime->myIsDone = true;
+
   return 1;
 }
index 7f119bedcd2cc3f33bc4b342385d6c21bf56ee81..376eff77c3b0c31f813ad37cd079c89326cf2cfd 100644 (file)
 namespace VISU
 {
   //---------------------------------------------------------------
-  struct TIsCDone: virtual TBaseStructure
-  {
-    bool myIsCDone;
-    TIsCDone(): 
-      myIsCDone(false)
-    {}
-  };
-
-  
-  //---------------------------------------------------------------
-  struct TCMesh: virtual TMeshImpl, virtual TIsCDone
+  struct TCMesh: virtual TMeshImpl
   {
     SALOME_MED::MESH_var myMesh;
   };
@@ -56,7 +46,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TCMeshOnEntity: virtual TMeshOnEntityImpl, virtual TIsCDone
+  struct TCMeshOnEntity: virtual TMeshOnEntityImpl
   {
     SALOME_MED::SUPPORT_var mySupport;
     typedef std::pair<int,int> TIndexAndSize;
@@ -67,7 +57,7 @@ namespace VISU
   
 
   //---------------------------------------------------------------
-  struct TCFamily: virtual TFamilyImpl, virtual TIsCDone
+  struct TCFamily: virtual TFamilyImpl
   {
     SALOME_MED::FAMILY_var myFamily;
   };
@@ -89,7 +79,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TCValForTime: virtual TValForTimeImpl, virtual TIsCDone
+  struct TCValForTime: virtual TValForTimeImpl
   {
     SALOME_MED::FIELD_var myField;
   };