]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To introduce ID's mapping
authorapo <apo@opencascade.com>
Mon, 29 Aug 2005 07:16:59 +0000 (07:16 +0000)
committerapo <apo@opencascade.com>
Mon, 29 Aug 2005 07:16:59 +0000 (07:16 +0000)
src/CONVERTOR/VISUConvertor.cxx
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_MedConvertor.cxx

index 3e0d804ad9040d556acf235215b5d118f8bee9e6..34c4de0b3a739756721e764291492a64e7378e13 100644 (file)
@@ -83,24 +83,10 @@ void parseFile(const char* theFileName)
          VISU::TValField::const_iterator aValFieldIter = aValField.begin();
          for(; aValFieldIter != aValField.end(); aValFieldIter++){
            int aTimeStamp = aValFieldIter->first;
-           //
-           vtkUnstructuredGrid *aOut;
-           //int aNbNodes, aNbCells, i;
-           //VISU::TGaussPointID aID;
-           //
-           aOut=aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
-
-           //aNbNodes=aOut->GetNumberOfPoints();
-           //aNbCells=aOut->GetNumberOfCells();
-           //printf("aNbNodes =%d\n", aNbNodes);
-           //printf("aNbCells =%d\n", aNbCells);
-           //
-           //VISU::PGaussMesh pGaussMesh=aCon->GetGaussMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
-           //
-           //for (i=0; i<aNbCells; ++i) {
-           //  aID=pGaussMesh->GetObjId(i);
-           // }
-           //
+           if(anEntity != VISU::NODE_ENTITY)
+             aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
+           else
+             aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
            //goto OK;
          }
        }
@@ -113,15 +99,7 @@ void parseFile(const char* theFileName)
        aCon->GetMeshOnEntity(aMeshName,anEntity);
       }
 
-      continue;
-
-      //Importing groups
-      const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
-      VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
-      for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
-       const string& aGroupName = aGroupMapIter->first;
-       aCon->GetMeshOnGroup(aMeshName,aGroupName);
-      }
+      //continue;
 
       //Import families
       aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
@@ -137,6 +115,14 @@ void parseFile(const char* theFileName)
        }
       }
 
+      //Importing groups
+      const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
+      VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
+      for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
+       const string& aGroupName = aGroupMapIter->first;
+       aCon->GetMeshOnGroup(aMeshName,aGroupName);
+      }
+
     }
     MSG(MYDEBUG,"OK");
 #ifndef _DEXCEPT_
index 65973f9f43cec3908befed78e451b8f63841ddef..5183abf49bc9d00c4d6c676f272acbecee3753ad 100644 (file)
@@ -58,8 +58,8 @@ static float ERR_SIZE_CALC = 1.00;
 static int MYVTKDEBUG = 0;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
-static int MYDEBUGWITHFILES = 1;
+static int MYDEBUG = 0;
+static int MYDEBUGWITHFILES = 0;
 #else
 static int MYDEBUG = 0;
 static int MYDEBUGWITHFILES = 0;
@@ -747,7 +747,7 @@ namespace
       for(; aGeom2Cell2ConnectIter != aGeom2Cell2Connect.end(); aGeom2Cell2ConnectIter++){
        const VISU::TCell2Connect& anArray = aGeom2Cell2ConnectIter->second;
        vtkIdType aGeom = aGeom2Cell2ConnectIter->first;
-       INITMSG(MYDEBUG,"aGeom = "<<aGeom<<"; anArray.size() = "<<anArray.size());
+       INITMSG(MYDEBUG,"aGeom = "<<aGeom<<"; anArray.size() = "<<anArray.size()<<"\n");
 
        const VISU::TGeom2SubMeshID& aGeom2SubMeshID = aFamily->myGeom2SubMeshID;
        if(aGeom2SubMeshID.empty()) 
@@ -756,7 +756,7 @@ namespace
        VISU::TGeom2SubMeshID::const_iterator aGeom2SubMeshIDIter = aGeom2SubMeshID.find(aGeom);
        if(aGeom2SubMeshIDIter != aGeom2SubMeshID.end()){
          const VISU::TSubMeshID& aSubMeshID = aGeom2SubMeshIDIter->second;
-         INITMSG(MYDEBUG,"aSubMeshID.size() = "<<aSubMeshID.size());
+         INITMSG(MYDEBUG,"aSubMeshID.size() = "<<aSubMeshID.size()<<"\n");
          VISU::TSubMeshID::const_iterator aSubMeshIDIter = aSubMeshID.begin();
          for(; aSubMeshIDIter != aSubMeshID.end(); aSubMeshIDIter++, i++){
            PrintCells(i,aConnectivity,anArray[*aSubMeshIDIter]);
@@ -1291,8 +1291,9 @@ VISU_Convertor_impl
   }
 
   //Main part of code
+#ifndef _DEXCEPT_
   try{
-
+#endif
     if(!(*anIsInitialized)){
       if(MYVTKDEBUG) aSource->DebugOn();
 
@@ -1322,10 +1323,11 @@ VISU_Convertor_impl
       BEGMSG(MYVTKDEBUG,"GetCellLinks() = "<<float(aSource->GetCellLinks()->GetActualMemorySize()*1000)<<endl);
       BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<float(aSource->GetActualMemorySize()*1000)<<endl);
     }
-
+#ifndef _DEXCEPT_
   }catch(...){
     throw;
   }
+#endif
 
   return aSource.GetPointer();
 }
@@ -1351,7 +1353,9 @@ VISU_Convertor_impl
 
   //Main part of code
   const TVTKSource& aSource = aGroup->GetSource();
+#ifndef _DEXCEPT_
   try{
+#endif
     if(!aGroup->myIsVTKDone){
       LoadMeshOnGroup(aMesh,aFamilyAndEntitySet);
       GetPoints(aSource,aMesh);
@@ -1367,10 +1371,11 @@ VISU_Convertor_impl
        VISU::WriteToFile(aSource.GetPointer(),aFileName);
       }
     }
-
+#ifndef _DEXCEPT_
   }catch(...){
     throw;
   }
+#endif
 
   return aSource.GetPointer();
 }
index 330547231a8df48a87a1caeff78935e9177905d6..633fd38d724c9ce187190fb287552b82a2421335 100644 (file)
@@ -47,10 +47,10 @@ using MED::TFloat;
 using MED::EBooleen;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
 static int MYVALUEDEBUG = 0;
-static int MY_FAMILY_DEBUG = 1;
-static int MY_GROUP_DEBUG = 1;
+static int MY_FAMILY_DEBUG = 0;
+static int MY_GROUP_DEBUG = 0;
 #else
 static int MYDEBUG = 0;
 static int MYVALUEDEBUG = 0;
@@ -885,12 +885,14 @@ VISU_MedConvertor
   const std::string& aMeshName = theMeshOnEntity->myMeshName;
   const TEntity& anEntity = theMeshOnEntity->myEntity;
   PMeshImpl aMesh = myMeshMap[aMeshName];
-  int isPointsUpdated;
-  if(anEntity == NODE_ENTITY) 
-    isPointsUpdated = LoadPoints(aMed,aMesh,theFamilyName);
-  else
-    isPointsUpdated = LoadPoints(aMed,aMesh);
-  int isCellsOnEntityUpdated = LoadCellsOnEntity(aMed,aMesh,theMeshOnEntity,theFamilyName);
+
+  int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
+  if(anEntity == NODE_ENTITY){
+    isPointsUpdated += LoadPoints(aMed,aMesh,theFamilyName);
+  }else{
+    isPointsUpdated += LoadPoints(aMed,aMesh);
+    isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,aMesh,theMeshOnEntity,theFamilyName);
+  }
 
   return (isPointsUpdated || isCellsOnEntityUpdated);
 }
@@ -911,7 +913,6 @@ VISU_MedConvertor
     const PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity];
     if(anEntity == NODE_ENTITY){
       isPointsUpdated += LoadPoints(aMed,theMesh,aFamilyName);
-      isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,aMeshOnEntity);
     }else{
       isPointsUpdated += LoadPoints(aMed,theMesh);
       isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,aMeshOnEntity,aFamilyName);
@@ -931,8 +932,12 @@ VISU_MedConvertor
                       VISU::PValForTimeImpl theValForTime)
 {
   MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
-  int isPointsUpdated = LoadPoints(aMed,theMesh);
-  int isCellsOnEntityUpdated = LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
+
+  const TEntity& anEntity = theMeshOnEntity->myEntity;
+  int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
+  isPointsUpdated += LoadPoints(aMed,theMesh);
+  if(anEntity != NODE_ENTITY)
+    isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
   int isFieldUpdated = LoadValForTimeOnMesh(aMed,theMesh,theMeshOnEntity,theField,theValForTime);
   
   return (isPointsUpdated || isCellsOnEntityUpdated || isFieldUpdated);
@@ -948,8 +953,11 @@ VISU_MedConvertor
                           VISU::PValForTimeImpl theValForTime)
 {
   MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
-  int isPointsUpdated = LoadPoints(aMed,theMesh);
-  int isCellsOnEntityUpdated = LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
+
+  const TEntity& anEntity = theMeshOnEntity->myEntity;
+  int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
+  if(anEntity != NODE_ENTITY)
+    isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
   int isFieldUpdated = LoadValForTimeOnGaussPts(aMed,theMesh,theMeshOnEntity,theField,theValForTime);
   
   return (isPointsUpdated || isCellsOnEntityUpdated || isFieldUpdated);
@@ -974,7 +982,7 @@ VISU_MedConvertor
     if(theMesh->myIsDone)
       if(!aFamily) 
        return 0;
-      else if(!aFamily->myIsDone) 
+      else if(aFamily->myIsDone) 
        return 0;
 
     INITMSG(MYDEBUG,"LoadPoints - theMesh->myIsDone = "<<theMesh->myIsDone<<
@@ -1278,7 +1286,6 @@ LoadProfile(const MED::PWrapper& theMed,
   }
   {
     const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
-    MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(aMeshInfo);
     
     TEntity aVEntity = theMeshOnEntity.myEntity;
     MED::EEntiteMaillage aMEntity = VTKEntityToMED(aVEntity);
@@ -1288,13 +1295,17 @@ LoadProfile(const MED::PWrapper& theMed,
     for(; anIter != aGeom2SubProfile.end(); anIter++){
       const PMEDSubProfile& aSubProfile = anIter->second;
       MED::EGeometrieElement aMGeom = aSubProfile->myMGeom;
-      MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,
-                                                     aMEntity, 
-                                                     aMGeom);
+      MED::PElemInfo anElemInfo;
+      if(aMEntity == MED::eNOEUD)
+       anElemInfo = theMed->GetPNodeInfo(aMeshInfo);
+      else
+       anElemInfo = theMed->GetPCellInfo(aMeshInfo,
+                                         aMEntity, 
+                                         aMGeom);
       
-      aSubProfile->myIsElemNum = aCellInfo->IsElemNum();
+      aSubProfile->myIsElemNum = anElemInfo->IsElemNum();
       if(aSubProfile->myIsElemNum)
-       aSubProfile->myElemNum = aCellInfo->myElemNum;
+       aSubProfile->myElemNum = anElemInfo->myElemNum;
 
       aSubProfile->myNamedPointCoords = theMesh->myNamedPointCoords;
     }