From c8540806a1afd4fc3119e072498661ff311af634 Mon Sep 17 00:00:00 2001 From: apo Date: Tue, 10 Jan 2006 07:21:55 +0000 Subject: [PATCH] Fix for Bug GVIEW10317 Incorrect reading of "maill.3.med" file in Post-Pro module. --- src/CONVERTOR/VISU_Convertor_impl.cxx | 54 ++++++---- src/CONVERTOR/VISU_Convertor_impl.hxx | 3 +- src/CONVERTOR/VISU_MedConvertor.cxx | 145 +++++++++++++++----------- src/VISU_I/VISU_CorbaMedConvertor.cxx | 2 +- src/VISU_I/VISU_Gen_i.cc | 4 +- src/VISU_I/VISU_Gen_i.hh | 2 - 6 files changed, 118 insertions(+), 92 deletions(-) diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index c1ef8027..85032edf 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -59,7 +59,7 @@ static int MYVTKDEBUG = 0; #ifdef _DEBUG_ static int MYDEBUG = 0; static int MYDEBUGWITHFILES = 0; -#define _DEXCEPT_ +//#define _DEXCEPT_ #else static int MYDEBUG = 0; static int MYDEBUGWITHFILES = 0; @@ -832,8 +832,7 @@ namespace VISU TValForTimeImpl ::TValForTimeImpl(): myGaussPtsIDFilter(new TGaussPtsIDFilter()), - myIDMapperFilter(new TIDMapperFilter()), - myNbGauss(1) + myIDMapperFilter(new TIDMapperFilter()) {} const TMeshValue& @@ -857,16 +856,12 @@ namespace VISU TValForTimeImpl ::GetNbGauss(EGeometry theGeom) const { - if(PGaussMeshImpl aGaussMesh = myGaussMesh){ - const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh; - TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.find(theGeom); - if(anIter != aGeom2GaussSubMesh.end()){ - PGaussSubMeshImpl aGaussSubMesh = anIter->second; - PGaussImpl aGauss = aGaussSubMesh->myGauss; - return aGauss->myNbPoints; - } + TGeom2NbGauss::const_iterator anIter = myGeom2NbGauss.find(theGeom); + if(anIter == myGeom2NbGauss.end()){ + //EXCEPTION(runtime_error,"TValForTimeImpl::GetNbGauss - myGeom2NbGauss.find(theGeom) fails"); + return 1; } - return myNbGauss; + return anIter->second; } @@ -1621,24 +1616,37 @@ namespace if(aNbGauss < 1) continue; + const TPointCoords& aCoords = aGaussSubMesh->myPointCoords; + INITMSG(MYDEBUG, "- aEGeom = "<myGeom2NbGauss; + const MED::TGeom2NbGauss& aMGeom2NbGauss = aTimeStampInfo->myGeom2NbGauss; + MED::TGeom2NbGauss::const_iterator anIter = aMGeom2NbGauss.begin(); + for(; anIter != aMGeom2NbGauss.end(); anIter++){ + const MED::EGeometrieElement& aMGeom = anIter->first; + EGeometry aEGeom = MEDGeom2VISU(aMGeom); + TInt aNbGauss = anIter->second; + aVGeom2NbGauss[aEGeom] = aNbGauss; + } } } } @@ -1178,73 +1187,83 @@ VISU_MedConvertor TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPTimeStampInfo()"); INITMSG(MYDEBUG,"- iTimeStamp = "<GetPTimeStampInfo(aFieldInfo, - aMEntity, - aGeom2Size, - iTimeStamp); - - MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo, - aMKey2Profile, - aKey2Gauss); - - const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss(); - - const MED::TTimeStampVal& aTimeStampValRef = aTimeStampVal; - - const MED::TGeom2Value& aGeom2Value = aTimeStampValRef.myGeom2Value; - MED::TGeom2Value::const_iterator anIter = aGeom2Value.begin(); - for(; anIter != aGeom2Value.end(); anIter++){ - const MED::TMeshValue& aMMeshValue = anIter->second; - MED::EGeometrieElement aMGeom = anIter->first; +#ifndef _DEXCEPT_ + try{ +#endif + MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo, + aMEntity, + aGeom2Size, + iTimeStamp); - TInt aNbElem = aMMeshValue.myNbElem; - TInt aNbGauss = aMMeshValue.myNbGauss; + MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo, + aMKey2Profile, + aKey2Gauss); - MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom); - if(aGaussIter == aGeom2Gauss.end()) - aNbGauss = 1; - - INITMSG(MYDEBUG, - "- aMGeom = "<GetMinMax(iComp); @@ -2141,6 +2160,8 @@ LoadGaussMesh(const MED::PWrapper& theMed, "- aEGeom = "<