Fix for Bug IPAL11676 - Performance regression of 'generate frames' in animation

This commit is contained in:
apo 2006-02-27 13:09:57 +00:00
parent 483e31c576
commit 9f6201b116

View File

@ -41,6 +41,7 @@
#ifdef _DEBUG_ #ifdef _DEBUG_
static int MYDEBUG = 0; static int MYDEBUG = 0;
//#define _DEXCEPT_
#else #else
static int MYDEBUG = 0; static int MYDEBUG = 0;
#endif #endif
@ -69,10 +70,12 @@ DriverMED_R_SMESHDS_Mesh
::Perform() ::Perform()
{ {
Status aResult = DRS_FAIL; Status aResult = DRS_FAIL;
#ifndef _DEXCEPT_
try{ try{
#endif
myFamilies.clear(); myFamilies.clear();
if(MYDEBUG) MESSAGE("Perform - myFile : "<<myFile); if(MYDEBUG) MESSAGE("Perform - myFile : "<<myFile);
PWrapper aMed = CrWrapper(myFile); PWrapper aMed = CrWrapper(myFile,true);
aResult = DRS_EMPTY; aResult = DRS_EMPTY;
if(TInt aNbMeshes = aMed->GetNbMeshes()){ if(TInt aNbMeshes = aMed->GetNbMeshes()){
@ -195,7 +198,9 @@ DriverMED_R_SMESHDS_Mesh
SMDS_MeshElement* anElement = NULL; SMDS_MeshElement* anElement = NULL;
TInt aFamNum = aPolygoneInfo->GetFamNum(iElem); TInt aFamNum = aPolygoneInfo->GetFamNum(iElem);
#ifndef _DEXCEPT_
try{ try{
#endif
if(anIsElemNum){ if(anIsElemNum){
TInt anElemId = aPolygoneInfo->GetElemNum(iElem); TInt anElemId = aPolygoneInfo->GetElemNum(iElem);
anElement = myMesh->AddPolygonalFaceWithID(aNodeIds,anElemId); anElement = myMesh->AddPolygonalFaceWithID(aNodeIds,anElemId);
@ -207,12 +212,13 @@ DriverMED_R_SMESHDS_Mesh
anElement = myMesh->AddPolygonalFace(aNodes); anElement = myMesh->AddPolygonalFace(aNodes);
isRenum = anIsElemNum; isRenum = anIsElemNum;
} }
#ifndef _DEXCEPT_
}catch(const std::exception& exc){ }catch(const std::exception& exc){
aResult = DRS_FAIL; aResult = DRS_FAIL;
}catch (...){ }catch (...){
aResult = DRS_FAIL; aResult = DRS_FAIL;
} }
#endif
if(!anElement){ if(!anElement){
aResult = DRS_WARN_SKIP_ELEM; aResult = DRS_WARN_SKIP_ELEM;
}else{ }else{
@ -265,7 +271,9 @@ DriverMED_R_SMESHDS_Mesh
SMDS_MeshElement* anElement = NULL; SMDS_MeshElement* anElement = NULL;
TInt aFamNum = aPolyedreInfo->GetFamNum(iElem); TInt aFamNum = aPolyedreInfo->GetFamNum(iElem);
#ifndef _DEXCEPT_
try{ try{
#endif
if(anIsElemNum){ if(anIsElemNum){
TInt anElemId = aPolyedreInfo->GetElemNum(iElem); TInt anElemId = aPolyedreInfo->GetElemNum(iElem);
anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId); anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId);
@ -277,12 +285,13 @@ DriverMED_R_SMESHDS_Mesh
anElement = myMesh->AddPolyhedralVolume(aNodes,aQuantities); anElement = myMesh->AddPolyhedralVolume(aNodes,aQuantities);
isRenum = anIsElemNum; isRenum = anIsElemNum;
} }
#ifndef _DEXCEPT_
}catch(const std::exception& exc){ }catch(const std::exception& exc){
aResult = DRS_FAIL; aResult = DRS_FAIL;
}catch(...){ }catch(...){
aResult = DRS_FAIL; aResult = DRS_FAIL;
} }
#endif
if(!anElement){ if(!anElement){
aResult = DRS_WARN_SKIP_ELEM; aResult = DRS_WARN_SKIP_ELEM;
}else{ }else{
@ -344,7 +353,9 @@ DriverMED_R_SMESHDS_Mesh
TNodeIds aNodeIds(aNbNodes); TNodeIds aNodeIds(aNbNodes);
bool anIsValidConnect = false; bool anIsValidConnect = false;
TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem); TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
#ifndef _DEXCEPT_
try{ try{
#endif
#ifdef _EDF_NODE_IDS_ #ifdef _EDF_NODE_IDS_
if(anIsNodeNum) if(anIsNodeNum)
for(int iNode = 0; iNode < aNbNodes; iNode++) for(int iNode = 0; iNode < aNbNodes; iNode++)
@ -357,6 +368,7 @@ DriverMED_R_SMESHDS_Mesh
aNodeIds[iNode] = aConnSlice[iNode]; aNodeIds[iNode] = aConnSlice[iNode];
#endif #endif
anIsValidConnect = true; anIsValidConnect = true;
#ifndef _DEXCEPT_
}catch(const std::exception& exc){ }catch(const std::exception& exc){
//INFOS("Follow exception was cought:\n\t"<<exc.what()); //INFOS("Follow exception was cought:\n\t"<<exc.what());
aResult = DRS_FAIL; aResult = DRS_FAIL;
@ -364,14 +376,16 @@ DriverMED_R_SMESHDS_Mesh
//INFOS("Unknown exception was cought !!!"); //INFOS("Unknown exception was cought !!!");
aResult = DRS_FAIL; aResult = DRS_FAIL;
} }
#endif
if(!anIsValidConnect) if(!anIsValidConnect)
continue; continue;
bool isRenum = false; bool isRenum = false;
SMDS_MeshElement* anElement = NULL; SMDS_MeshElement* anElement = NULL;
TInt aFamNum = aCellInfo->GetFamNum(iElem); TInt aFamNum = aCellInfo->GetFamNum(iElem);
#ifndef _DEXCEPT_
try{ try{
#endif
//MESSAGE("Try to create element # " << iElem << " with id = " //MESSAGE("Try to create element # " << iElem << " with id = "
// << aCellInfo->GetElemNum(iElem)); // << aCellInfo->GetElemNum(iElem));
switch(aGeom){ switch(aGeom){
@ -504,6 +518,7 @@ DriverMED_R_SMESHDS_Mesh
} }
break; break;
} }
#ifndef _DEXCEPT_
}catch(const std::exception& exc){ }catch(const std::exception& exc){
//INFOS("Follow exception was cought:\n\t"<<exc.what()); //INFOS("Follow exception was cought:\n\t"<<exc.what());
aResult = DRS_FAIL; aResult = DRS_FAIL;
@ -511,7 +526,7 @@ DriverMED_R_SMESHDS_Mesh
//INFOS("Unknown exception was cought !!!"); //INFOS("Unknown exception was cought !!!");
aResult = DRS_FAIL; aResult = DRS_FAIL;
} }
#endif
if (!anElement) { if (!anElement) {
aResult = DRS_WARN_SKIP_ELEM; aResult = DRS_WARN_SKIP_ELEM;
} }
@ -534,6 +549,7 @@ DriverMED_R_SMESHDS_Mesh
} }
} }
} }
#ifndef _DEXCEPT_
}catch(const std::exception& exc){ }catch(const std::exception& exc){
INFOS("Follow exception was cought:\n\t"<<exc.what()); INFOS("Follow exception was cought:\n\t"<<exc.what());
aResult = DRS_FAIL; aResult = DRS_FAIL;
@ -541,6 +557,7 @@ DriverMED_R_SMESHDS_Mesh
INFOS("Unknown exception was cought !!!"); INFOS("Unknown exception was cought !!!");
aResult = DRS_FAIL; aResult = DRS_FAIL;
} }
#endif
if(MYDEBUG) MESSAGE("Perform - aResult status = "<<aResult); if(MYDEBUG) MESSAGE("Perform - aResult status = "<<aResult);
return aResult; return aResult;
} }