]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To simplify TPolyedreInfo
authorapo <apo@opencascade.com>
Fri, 29 Jul 2005 09:58:37 +0000 (09:58 +0000)
committerapo <apo@opencascade.com>
Fri, 29 Jul 2005 09:58:37 +0000 (09:58 +0000)
 a) remove unnecessary attributes of the structure
 b) provide corresponding slice interfaces for accessing to the Polyedre connectivities

src/CONVERTOR/VISU_MedConvertor.cxx

index a4a8d2d770380c2e1f20e9882bb3173c2c31b333..cc6aa53b455ab9e135d2370d1d82bdd417e68d9f 100644 (file)
@@ -500,29 +500,27 @@ VISU_MedConvertor
            case MED::ePOLYEDRE: {
              MED::PPolyedreInfo aPolyedreInfo = aMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
              TInt aNbElem = aPolyedreInfo->GetNbElem();
-             MED::TElemNum aConn  = aPolyedreInfo->GetConnectivite();
-             MED::TElemNum aIndex = aPolyedreInfo->GetIndex();
-             TInt aNbIndex = aIndex.size();
-             TInt aNbConn  = aConn.size();
-             
-             aMeshOnEntity->myNbCells += aNbElem;
-             
-             for (int ii = 0; ii<aNbElem ; ii++){
-               int aNbConnii = aPolyedreInfo->GetNbConn(ii);
-               aMeshOnEntity->myCellsSize += aNbConnii;
-             }
 
              INITMSG(MYDEBUG,
                      "- aMGeom = "<<aMGeom<<
                      "; aNbElem = "<<aNbElem<<
-                     "; aNbConn= "<<aNbConn<<
                      endl);
              
-             for(TInt iElem = 0; iElem < aNbElem; iElem++){
-               TInt aFamId = aPolyedreInfo->GetFamNum(iElem);
+             aMeshOnEntity->myNbCells += aNbElem;
+             for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+               MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(anElemId);
+               TInt aNbFaces = aConnSliceArr.size();
+               TInt aCellSize = 0;
+               for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+                 MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+                 TInt aNbConn = aConnSlice.size();
+                 aCellSize += aNbConn;
+               }
+               aMeshOnEntity->myCellsSize += aCellSize;
+               TInt aFamId = aPolyedreInfo->GetFamNum(anElemId);
                if(aFamId != 0){
                  aFamilyNbCellsCounterMap[aFamId] += 1;
-                 aFamilyCellsSizeCounterMap[aFamId] += aPolyedreInfo->GetNbConn(iElem) + 1;
+                 aFamilyCellsSizeCounterMap[aFamId] += aCellSize + 1;
                }
              }
              break;
@@ -969,30 +967,26 @@ VISU_MedConvertor
          TCell2Connect& aCell2Connect = aGeom2Cell2Connect[aVGeom];
          aCell2Connect.resize(aNbElem);
          
-         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++){
+         for(TInt iElem = 0; iElem < aNbElem; iElem++){
+           MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
+           TConnect& anArray = aCell2Connect[iElem];
            typedef set<TInt> TConnectSet;
            TConnectSet aConnectSet;
-           TConnect& anArray = aCell2Connect[iElem];
-           
-           int aInd1 = aIndex[iElem]-1;
-           int aInd2 = aIndex[iElem+1]-2;
-           
-           for(int i = aInd1; i <= aInd2; i++){
-             for(int j = aFaces[i]-1; j < aFaces[i+1]-1; j++){
-               aConnectSet.insert(aConnect[j]);
+           TInt aNbFaces = aConnSliceArr.size();
+           for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+             MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+             TInt aNbConn = aConnSlice.size();
+             for(TInt iConn = 0; iConn < aNbConn; iConn++){
+               aConnectSet.insert(aConnSlice[iConn]);
              }
            }
-           
+         
            int aNbConn = aConnectSet.size();
            anArray.resize(aNbConn);
-           TConnectSet::iterator aIter = aConnectSet.begin();
-           for(int i = 0; aIter != aConnectSet.end(); aIter++, i++){
-             TInt anId = *aIter;
-             anArray[i] = anId-1;
+           TConnectSet::iterator anIter = aConnectSet.begin();
+           for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){
+             TInt anId = *anIter;
+             anArray[i] = anId - 1;
            }
          }
        }