From: jfa Date: Tue, 1 Nov 2005 12:59:24 +0000 (+0000) Subject: Fix for bug 10434: Lost fields reading the med file maill.3.med X-Git-Tag: V3_1_0a3~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6ac0298ef3e4d5461be3610fe8089817557a6f44;p=modules%2Fvisu.git Fix for bug 10434: Lost fields reading the med file maill.3.med --- diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index bc9e31d1..5c47189b 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -157,8 +157,8 @@ VISU_Convertor* VISU_MedConvertor::Build() { MSG(MYDEBUG,"VISU_MedConvertor::Build()"); INITMSG(MYDEBUG,"GetNbMeshes() = "<GetPMeshInfo(iMesh); PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo); @@ -424,11 +424,13 @@ VISU_Convertor* VISU_MedConvertor::Build() { TInt aNbComp = aFieldInfo->GetNbComp(); const string& aFieldName = aFieldInfo->GetName(); + MED::TErr anErr; MED::TGeom aTGeom; EEntiteMaillage aMEntity; - TInt aNbTimeStamps = aMed->GetNbTimeStamps(aFieldInfo,aEntityInfo,aMEntity,aTGeom); - if (aNbTimeStamps<1) + TInt aNbTimeStamps = aMed->GetNbTimeStamps(aFieldInfo,aEntityInfo,aMEntity,aTGeom,&anErr); + if (anErr < 0 || aNbTimeStamps < 1) continue; + TEntity aVEntity = MEDEntityToVTK(aMEntity); VISU::PMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity]; TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; @@ -457,10 +459,14 @@ VISU_Convertor* VISU_MedConvertor::Build() { PTimeStampInfo aTimeStamp = aMed->GetPTimeStampInfo(aFieldInfo, aMEntity, aTGeom, - iTimeStamp); + iTimeStamp, + &anErr); + if (anErr < 0) + continue; + TFloat aDt = aTimeStamp->GetDt(); const string& anUnitDt = aTimeStamp->GetUnitDt(); - PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStamp); + PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStamp,&anErr); TValField& aValField = aField->myValField; PMEDValForTime aValForTime = aValField[iTimeStamp](new TMEDValForTime()); aValForTime->myId = iTimeStamp; @@ -477,6 +483,7 @@ VISU_Convertor* VISU_MedConvertor::Build() { } catch(...){ EXCEPTION(runtime_error,"Unknown exception !!!"); } + } return this; } diff --git a/src/VISU_I/VISU_Gen_i.hh b/src/VISU_I/VISU_Gen_i.hh index abaac0a6..240b6bea 100644 --- a/src/VISU_I/VISU_Gen_i.hh +++ b/src/VISU_I/VISU_Gen_i.hh @@ -69,8 +69,10 @@ namespace VISU{ if(Result_i* pResult = dynamic_cast(GetServant(theResult).in())){ if(TPrs3d_i::IsPossible(pResult,theMeshName,theEntity,theFieldName,int(theIteration))){ aPresent = new TPrs3d_i(pResult,theAddToStudy); - if(aPresent->Create(theMeshName,theEntity,theFieldName,int(theIteration)) == NULL) + if(aPresent->Create(theMeshName,theEntity,theFieldName,int(theIteration)) == NULL){ aPresent->_remove_ref(); + aPresent = NULL; + } } } return aPresent;