From: apo Date: Tue, 25 Jan 2005 06:35:10 +0000 (+0000) Subject: [Bug PAL7784] New: REGR: wrong Export-Import Mesh in med X-Git-Tag: V2_2_0b1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=473dd8f02aa04f3bf8971d764c595db66405d73c;p=modules%2Fkernel.git [Bug PAL7784] New: REGR: wrong Export-Import Mesh in med --- diff --git a/src/MEDWrapper/Base/MED_Algorithm.cxx b/src/MEDWrapper/Base/MED_Algorithm.cxx index fb9e24fa3..a1a42ed96 100644 --- a/src/MEDWrapper/Base/MED_Algorithm.cxx +++ b/src/MEDWrapper/Base/MED_Algorithm.cxx @@ -159,9 +159,8 @@ namespace MED{ INITMSG(MYDEBUG,"GetNbFields() = "<GetNbComp(); - string aName = aFieldInfo->GetName(); - INITMSG(MYDEBUG,"aFieldName = '"<0){ + if(aNbElem > 0){ anInfo[eNOEUD][ePOINT1] = aNbElem; const TEntity2GeomSet& anEntity2GeomSet = GetEntity2GeomSet(); TEntity2GeomSet::const_iterator anIter = anEntity2GeomSet.begin(); @@ -442,10 +442,9 @@ namespace MED{ TGeomSet::const_iterator anIterEnd2 = aGeomSet.end(); for(; anIter2 != anIterEnd2; anIter2++){ const EGeometrieElement& aGeom = *anIter2; - TInt aNb = GetNbCells(theMeshInfo,anEntity,aGeom,theTConn,theErr); - if(aNb>0){ - anInfo[anEntity][aGeom] = aNb; - } + aNbElem = GetNbCells(theMeshInfo,anEntity,aGeom,theTConn,theErr); + if(aNbElem > 0) + anInfo[anEntity][aGeom] = aNbElem; } } } @@ -466,9 +465,9 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = const_cast(theMeshInfo); - med_entite_maillage& anEntity = static_cast(theTEntity); - med_geometrie_element& aGeom = static_cast(theTGeom); - med_connectivite& aConn = static_cast(theTConn); + med_entite_maillage anEntity = med_entite_maillage(theTEntity); + med_geometrie_element aGeom = med_geometrie_element(theTGeom); + med_connectivite aConn = med_connectivite(theTConn); return MEDnEntMaa(myFile->Id(), &aMeshInfo.myName[0], diff --git a/src/MEDWrapper/V2_2/MED_V2_2_Wrapper.cxx b/src/MEDWrapper/V2_2/MED_V2_2_Wrapper.cxx index 4585c08d0..60d40d48e 100644 --- a/src/MEDWrapper/V2_2/MED_V2_2_Wrapper.cxx +++ b/src/MEDWrapper/V2_2/MED_V2_2_Wrapper.cxx @@ -720,10 +720,11 @@ namespace MED{ TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); - if(theErr && !*theErr) + if(theErr && *theErr < 0) return anInfo; - if(TInt aNbElem = GetNbNodes(theMeshInfo)){ + TInt aNbElem = GetNbNodes(theMeshInfo); + if(aNbElem > 0){ anInfo[eNOEUD][ePOINT1] = aNbElem; const TEntity2GeomSet& anEntity2GeomSet = GetEntity2GeomSet(); TEntity2GeomSet::const_iterator anIter = anEntity2GeomSet.begin(); @@ -735,10 +736,9 @@ namespace MED{ TGeomSet::const_iterator anIterEnd2 = aGeomSet.end(); for(; anIter2 != anIterEnd2; anIter2++){ const EGeometrieElement& aGeom = *anIter2; - TInt aNb = GetNbCells(theMeshInfo,anEntity,aGeom,theTConn,theErr); - if(aNb>0){ - anInfo[anEntity][aGeom] = aNb; - } + aNbElem = GetNbCells(theMeshInfo,anEntity,aGeom,theTConn,theErr); + if(aNbElem > 0) + anInfo[anEntity][aGeom] = aNbElem; } } } @@ -759,9 +759,9 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = const_cast(theMeshInfo); - med_entite_maillage& anEntity = static_cast(theTEntity); - med_geometrie_element& aGeom = static_cast(theTGeom); - med_connectivite& aConn = static_cast(theTConn); + med_entite_maillage anEntity = med_entite_maillage(theTEntity); + med_geometrie_element aGeom = med_geometrie_element(theTGeom); + med_connectivite aConn = med_connectivite(theTConn); return MEDnEntMaa(myFile->Id(), &aMeshInfo.myName[0],