From: apo Date: Thu, 2 Feb 2006 12:57:34 +0000 (+0000) Subject: Fix for Bug IPAL11452 X-Git-Tag: mergeto_trunk_07Feb06~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c7750dd3f8d547d0a166746a2a354a137c4a20d2;p=modules%2Fvisu.git Fix for Bug IPAL11452 REGRESS of the presentations on groups after explore MED (we should call LoadCellsOnEntity before calling the LoadCellsOnFamily) --- diff --git a/src/VISU_I/VISU_CorbaMedConvertor.cxx b/src/VISU_I/VISU_CorbaMedConvertor.cxx index 629ba8fa..b1dc814b 100644 --- a/src/VISU_I/VISU_CorbaMedConvertor.cxx +++ b/src/VISU_I/VISU_CorbaMedConvertor.cxx @@ -901,16 +901,12 @@ VISU_MEDConvertor ::LoadMeshOnEntity(VISU::PMeshImpl theMesh, VISU::PMeshOnEntityImpl theMeshOnEntity) { + int anIsUpdated = LoadPoints(theMesh); const TEntity& aVEntity = theMeshOnEntity->myEntity; - int isPointsUpdated = 0, isCellsOnEntityUpdated = 0; - if(aVEntity == NODE_ENTITY) - isPointsUpdated += LoadPoints(theMesh); - else{ - isPointsUpdated += LoadPoints(theMesh); - isCellsOnEntityUpdated += LoadCellsOnEntity(theMesh,theMeshOnEntity); - } + if(aVEntity != NODE_ENTITY) + anIsUpdated |= LoadCellsOnEntity(theMesh,theMeshOnEntity); - return (isPointsUpdated || isCellsOnEntityUpdated); + return anIsUpdated; } @@ -921,16 +917,16 @@ VISU_MEDConvertor VISU::PMeshOnEntityImpl theMeshOnEntity, VISU::PFamilyImpl theFamily) { + int anIsUpdated = LoadPoints(theMesh); const TEntity& anEntity = theMeshOnEntity->myEntity; - int isPointsUpdated = 0, isCellsOnEntityUpdated = 0; if(anEntity == NODE_ENTITY){ - isPointsUpdated += LoadPointsOnFamily(theMesh,theFamily); + anIsUpdated |= LoadPointsOnFamily(theMesh,theFamily); }else{ - isPointsUpdated += LoadPoints(theMesh); - isCellsOnEntityUpdated += LoadCellsOnFamily(theMesh,theMeshOnEntity,theFamily); + anIsUpdated |= LoadCellsOnEntity(theMesh,theMeshOnEntity); + anIsUpdated |= LoadCellsOnFamily(theMesh,theMeshOnEntity,theFamily); } - return (isPointsUpdated || isCellsOnEntityUpdated); + return anIsUpdated; } @@ -941,23 +937,21 @@ VISU_MEDConvertor const VISU::TFamilySet& theFamilySet) { //Main part of code - int isPointsUpdated = 0; - int isCellsOnEntityUpdated = 0; + int anIsUpdated = LoadPoints(theMesh); TFamilySet::const_iterator aFamilyIter = theFamilySet.begin(); for(; aFamilyIter != theFamilySet.end(); aFamilyIter++){ PCFamily aFamily = *aFamilyIter; const VISU::TEntity& aVEntity = aFamily->myEntity; PCMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity]; if(aVEntity == VISU::NODE_ENTITY){ - isPointsUpdated += LoadPointsOnFamily(theMesh,aFamily); - isCellsOnEntityUpdated += LoadCellsOnEntity(theMesh,aMeshOnEntity); + anIsUpdated |= LoadPointsOnFamily(theMesh,aFamily); }else{ - isPointsUpdated += LoadPoints(theMesh); - isCellsOnEntityUpdated += LoadCellsOnFamily(theMesh,aMeshOnEntity,aFamily); + anIsUpdated |= LoadCellsOnEntity(theMesh,aMeshOnEntity); + anIsUpdated |= LoadCellsOnFamily(theMesh,aMeshOnEntity,aFamily); } } - return (isPointsUpdated || isCellsOnEntityUpdated); + return anIsUpdated; } @@ -970,11 +964,14 @@ VISU_MEDConvertor VISU::PValForTimeImpl theValForTime) { //Main part of code - int isPointsUpdated = LoadPoints(theMesh); - int isCellsOnEntityUpdated = LoadCellsOnEntity(theMesh,theMeshOnEntity); - int isFieldUpdated = LoadField(theMesh,theMeshOnEntity,theField,theValForTime); + int anIsUpdated = LoadPoints(theMesh); + const TEntity& aVEntity = theMeshOnEntity->myEntity; + if(aVEntity != NODE_ENTITY) + anIsUpdated |= LoadCellsOnEntity(theMesh,theMeshOnEntity); + + anIsUpdated |= LoadField(theMesh,theMeshOnEntity,theField,theValForTime); - return (isPointsUpdated || isCellsOnEntityUpdated || isFieldUpdated); + return anIsUpdated; } @@ -1047,16 +1044,16 @@ VISU_MEDConvertor if(!anIsOnAllElements){ SALOME_MED::medGeometryElement_array_var aGeom = aMedFamily->getTypes(); SALOME_MED::long_array_var aCellNumForType = aMedFamily->getNumber(aGeom[0]); - int aMaxElemId = aNbElem; + int aSize = aNbElem; aNbElem = aCellNumForType->length(); for(int iElem = 0; iElem < aNbElem; iElem++){ - int aTmp = aCellNumForType[iElem]-1; - if(0 > aTmp || aTmp >= aMaxElemId){ + int anID = aCellNumForType[iElem] - 1; + if(0 > anID || anID >= aSize){ static QString aString; - aString.sprintf("LoadPointsOnFamily - aMaxElemId(%d) <= aCellNumForType[%d]=%d < 0",aMaxElemId,iElem,aTmp); + aString.sprintf("LoadPointsOnFamily - aSize(%d) <= aCellNumForType[%d] = %d < 0",aSize,iElem,anID); throw std::runtime_error(aString.latin1()); } - aSubMeshID.push_back(aTmp); + aSubMeshID.push_back(anID); } }else{ for(int iElem = 0; iElem < aNbElem; iElem++){ @@ -1180,13 +1177,14 @@ VISU_MEDConvertor for (int k = 0; k < aVNbNodes; k++) if(anArray[k] < 0 || aNbPoints <= anArray[k]){ static QString aString; - aString.sprintf("ImportCells >> aNbPoints(%d) <= anArray[%d][%d]=%d < 0 !!!",aNbPoints,iElem,k,anArray[k]); + aString.sprintf("LoadCellsOnEntity >> aNbPoints(%d) <= anArray[%d][%d]=%d < 0 !!!",aNbPoints,iElem,k,anArray[k]); throw std::runtime_error(aString.latin1()); } aCell2Connect.push_back(anArray); } //Workaround for MED Component data structure int aSize = aCell2Connect.size(); + if(MYDEBUG) MESSAGE("LoadCellsOnEntity - aCounter = "<> iNumElemEndTmp(%d) <= aCellNumForType[%d]=%d < 0 !!!",iNumElemEndTmp,iNumElem,tmp); + aString.sprintf("LoadCellsOnFamily - aNbElem(%d) <= aCellNumForType[%d] = %d < 0 !!!",aNbElem,iElem,anID); throw std::runtime_error(aString.latin1()); } - aSubMeshID.push_back(tmp); + aSubMeshID.push_back(anID); } } }else{