]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To adjust to polygonal and polyedral datas
authorapo <apo@opencascade.com>
Mon, 3 Oct 2005 12:10:04 +0000 (12:10 +0000)
committerapo <apo@opencascade.com>
Mon, 3 Oct 2005 12:10:04 +0000 (12:10 +0000)
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_MedConvertor.cxx

index 94a61b7ed68ca0dcb8090144e8f5ef23060c2108..8b81fe720c4572cf53a32a446afe39078ed4ae6b 100644 (file)
@@ -282,6 +282,9 @@ namespace VISU
     if(aLeft->myGeom != aRight->myGeom)
       return aLeft->myGeom < aRight->myGeom;
 
+    if(aLeft->myStatus != aRight->myStatus)
+      return aLeft->myStatus < aRight->myStatus;
+
     return aLeft->myName < aRight->myName;
   }
 
index 54d2037e9ed16fed1a02a4b4caca4962e833be59..dae994999e4b32136a6b4eff82687e1239e0ccd0 100644 (file)
@@ -173,7 +173,7 @@ namespace
               const MED::TGeom2Profile& theGeom2Profile)
   {
     vtkIdType aVGeom = MEDGeomToVTK(theMGeom);
-    vtkIdType aVNbNodes = VTKGeom2NbNodes(theMGeom);
+    vtkIdType aVNbNodes = VTKGeom2NbNodes(aVGeom);
 
     PMEDSubProfile aSubProfile(new TMEDSubProfile());
     aSubProfile->myGeom = aVGeom;
@@ -260,7 +260,8 @@ namespace
       }
     }
     INITMSG(MYDEBUG,
-           "- aVGeom = "<<aVGeom<<
+           "- aMGeom = "<<theMGeom<<
+           "; aVGeom = "<<aVGeom<<
            "; aName = '"<<aSubProfile->myName<<"'"<<
            "; aStatus = "<<aSubProfile->myStatus<<
            "; aNbCells = "<<aSubProfile->myNbCells<<
@@ -1811,11 +1812,21 @@ LoadProfile(const MED::PWrapper& theMed,
       MED::PElemInfo anElemInfo;
       if(aMEntity == MED::eNOEUD)
        anElemInfo = theMed->GetPNodeInfo(aMeshInfo);
-      else
-       anElemInfo = theMed->GetPCellInfo(aMeshInfo,
-                                         aMEntity, 
-                                         aMGeom);
-      
+      else{
+       switch(aMGeom){
+       case MED::ePOLYGONE: {
+         anElemInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
+         break;
+       }
+       case MED::ePOLYEDRE: {
+         anElemInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
+         break;
+       }
+       default: {
+         anElemInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
+         break;
+       }}
+      }
       aSubProfile->myIsElemNum = anElemInfo->IsElemNum();
       aSubProfile->myElemNum = anElemInfo->myElemNum;
     }
@@ -1861,12 +1872,32 @@ LoadGaussMesh(const MED::PWrapper& theMed,
     const TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
     MED::EGeometrieElement aMGeom = aSubProfile->myMGeom;
 
-    MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,
-                                                   aMEntity, 
-                                                   aMGeom);
-      
-    aGaussSubMesh->myIsElemNum = aCellInfo->IsElemNum();
-    aGaussSubMesh->myElemNum = aCellInfo->myElemNum;
+    MED::PPolygoneInfo aPolygoneInfo;
+    MED::PPolyedreInfo aPolyedreInfo;
+    MED::PCellInfo aCellInfo;
+    MED::PElemInfo anElemInfo;
+
+    switch(aMGeom){
+    case MED::ePOLYGONE: 
+      aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,
+                                              aMEntity,
+                                              aMGeom);
+      anElemInfo = aPolygoneInfo;
+      break;
+    case MED::ePOLYEDRE: 
+      aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,
+                                              aMEntity,
+                                              aMGeom);
+      anElemInfo = aPolyedreInfo;
+      break;
+    default:
+      aCellInfo = theMed->GetPCellInfo(aMeshInfo,
+                                      aMEntity, 
+                                      aMGeom);
+      anElemInfo = aCellInfo;
+    }
+    aGaussSubMesh->myIsElemNum = anElemInfo->IsElemNum();
+    aGaussSubMesh->myElemNum = anElemInfo->myElemNum;
 
     std::string aName;
     MED::TGaussCoord aGaussCoord;
@@ -1903,15 +1934,43 @@ LoadGaussMesh(const MED::PWrapper& theMed,
                                                             aProfileName);
        if(aProfileInfo){
          const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
+         switch(aMGeom){
+         case MED::ePOLYGONE: 
+           anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo,
+                                                 aNodeInfo,
+                                                 aGaussCoord,
+                                                 anElemNum);
+           break;
+         case MED::ePOLYEDRE: 
+           anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo,
+                                                 aNodeInfo,
+                                                 aGaussCoord,
+                                                 anElemNum);
+           break;
+         default:
+           anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo,
+                                                 aNodeInfo,
+                                                 aGaussCoord,
+                                                 anElemNum);
+         }
+       }
+      }else
+       switch(aMGeom){
+       case MED::ePOLYGONE: 
+         anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo,
+                                               aNodeInfo,
+                                               aGaussCoord);
+         break;
+       case MED::ePOLYEDRE: 
+         anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo,
+                                               aNodeInfo,
+                                               aGaussCoord);
+         break;
+       default:
          anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo,
                                                aNodeInfo,
-                                               aGaussCoord,
-                                               anElemNum);
+                                               aGaussCoord);
        }
-      }else
-       anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo,
-                                             aNodeInfo,
-                                             aGaussCoord);
     }
     
     if(anIsGaussCoord3D){