Salome HOME
Fix on [Bug PAL7837] PAL-POST-018 regression: it is impossible to create a presentati...
authorapo <apo@opencascade.com>
Wed, 26 Jan 2005 15:15:02 +0000 (15:15 +0000)
committerapo <apo@opencascade.com>
Wed, 26 Jan 2005 15:15:02 +0000 (15:15 +0000)
src/MEDWrapper/Base/MED_Common.hxx
src/MEDWrapper/Base/MED_Structures.cxx
src/MEDWrapper/Base/MED_TStructures.hxx
src/MEDWrapper/V2_1/MED_V2_1_Wrapper.cxx

index 02f992ea12b5892dbad99eb16c902429079764ca..b3b5d9fa81a676318129d2e66a2c703b394d2cb2 100644 (file)
@@ -162,19 +162,23 @@ namespace MED{
 
   const TEntity2GeomSet& GetEntity2GeomSet();
 
-  template<int EVersion>
+  template<int>
+
   TInt GetNbConn(EGeometrieElement typmai,
+                EEntiteMaillage typent,
                 TInt mdim);
   
   template<>
   TInt GetNbConn<eV2_1>(EGeometrieElement typmai,
+                       EEntiteMaillage typent,
                        TInt mdim);
 
   template<>
   TInt GetNbConn<eV2_2>(EGeometrieElement typmai,
+                       EEntiteMaillage typent,
                        TInt mdim);
 
-  TInt GetNbConnectivities(EGeometrieElement typmai);
+  TInt GetNbNodes(EGeometrieElement typmai);
 
   struct TNameInfo;
   typedef SharedPtr<TNameInfo> PNameInfo;
index 24185816fa74f228e0b50e13a7d7be6b91cae7e1..b96bf75230d83a3b42fd67443d1da275b8219449 100644 (file)
@@ -24,37 +24,38 @@ using namespace MED;
 
 namespace MED{
 
-  TInt GetNbConnectivities(EGeometrieElement typmai)
+  TInt GetNbNodes(EGeometrieElement typmai)
   {
-    TInt taille = typmai%100;
-    return taille;
+    return typmai%100;
   }
 
   template<>
   TInt GetNbConn<eV2_1>(EGeometrieElement typmai,
+                       EEntiteMaillage typent,
                        TInt mdim)
   {
-    TInt edim = typmai / 100;
     TInt nsup = 0;
 
-    if (mdim  == 2 || mdim == 3)
-      if (edim == 1)
-       nsup = 1;
-    
-    if (mdim == 3)
-      if (edim == 2)
-       nsup = 1;
-    
-    TInt taille = nsup+typmai%100;
-    return taille;
+    if(typent == eMAILLE){
+      TInt edim = typmai / 100;
+      if(mdim  == 2 || mdim == 3)
+       if(edim == 1)
+         nsup = 1;
+      
+      if(mdim == 3)
+       if (edim == 2)
+         nsup = 1;
+    }
+
+    return nsup + typmai%100;
   }
 
   template<>
   TInt GetNbConn<eV2_2>(EGeometrieElement typmai,
+                       EEntiteMaillage typent,
                        TInt mdim)
   {
-    TInt taille = typmai%100;
-    return taille;
+    return typmai%100;
   }
 
   std::string GetString(TInt theId, TInt theStep, 
@@ -127,13 +128,13 @@ void TCellInfo::SetConn(TInt theElemId, TInt theConnId, TInt theVal){
 TConstConnSlice 
 TCellInfo::GetConnSlice(TInt theElemId) const
 {
-  return TConstConnSlice(myConn,std::slice(GetConnDim()*theElemId,GetNbConnectivities(myTGeom),1));
+  return TConstConnSlice(myConn,std::slice(GetConnDim()*theElemId,GetNbNodes(myTGeom),1));
 }
 
 TConnSlice 
 TCellInfo::GetConnSlice(TInt theElemId)
 {
-  return TConnSlice(myConn,std::slice(GetConnDim()*theElemId,GetNbConnectivities(myTGeom),1));
+  return TConnSlice(myConn,std::slice(GetConnDim()*theElemId,GetNbNodes(myTGeom),1));
 }
 
 //---------------------------------------------------------------
index 15319fe7e72c105332ab4269c4fa656654d05766..b2062b04f9092cb2bb7ab001e304bbd2fa913705 100644 (file)
@@ -540,8 +540,8 @@ namespace MED{
       myTGeom = theInfo->GetGeom();
       myTConn  = theInfo->GetConn();
       
-      TInt aConnDim = GetNbConnectivities(myTGeom);
-      myConn.resize(myNbElem*GetNbConn<nV>(myTGeom,myMeshInfo->myDim));
+      TInt aConnDim = GetNbNodes(myTGeom);
+      myConn.resize(myNbElem*GetNbConn<nV>(myTGeom,myTEntity,myMeshInfo->myDim));
       for(TInt anElemId = 0; anElemId < myNbElem; anElemId++){
        for(TInt anConnId = 0; anConnId < aConnDim; anConnId++){
          SetConn(anElemId,anConnId,theInfo->GetConn(anElemId,anConnId));
@@ -564,7 +564,7 @@ namespace MED{
       myTEntity = theTEntity;
       myTGeom = theTGeom;
       myTConn  = theTConn;
-      myConn.resize(theNbElem*GetNbConn<nV>(theTGeom,theMeshInfo->myDim));
+      myConn.resize(theNbElem*GetNbConn<nV>(theTGeom,myTEntity,theMeshInfo->myDim));
     }
     
     TTCellInfo(const PMeshInfo& theMeshInfo, 
@@ -584,9 +584,9 @@ namespace MED{
       myTGeom = theTGeom;
       myTConn  = theTConn;
 
-      TInt aConnDim = GetNbConnectivities(myTGeom);
+      TInt aConnDim = GetNbNodes(myTGeom);
       myNbElem = theConnectivities.size() / aConnDim;
-      myConn.resize(myNbElem*GetNbConn<nV>(myTGeom,myMeshInfo->myDim));
+      myConn.resize(myNbElem*GetNbConn<nV>(myTGeom,myTEntity,myMeshInfo->myDim));
       for(TInt anElemId = 0; anElemId < myNbElem; anElemId++){
        for(TInt anConnId = 0; anConnId < aConnDim; anConnId++){
          SetConn(anElemId,anConnId,theConnectivities[anElemId*aConnDim+anConnId]);
@@ -596,7 +596,7 @@ namespace MED{
     }
 
     virtual TInt GetConnDim() const { 
-      return GetNbConn<nV>(myTGeom,myMeshInfo->myDim);
+      return GetNbConn<nV>(myTGeom,myTEntity,myMeshInfo->myDim);
     }
 
   };
index a406c0d4b4952f9d511a92904463eccc313df1d7..bb7adae425ec969908d7bd428c0aa52db16410b7 100644 (file)
@@ -509,6 +509,7 @@ namespace MED{
                                  anEntity,
                                  aGeom,
                                  aConn);
+
       if(theErr) 
        *theErr = aRet;
       else if(aRet < 0)