From: akl Date: Fri, 14 Sep 2007 15:54:52 +0000 (+0000) Subject: NPAL16752 (SIGSEGV on cutpanes, cutlines, plot3D on cronoshexa.med file): X-Git-Tag: T_24092007~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=22ae70665f18de761bc37dbfe809feadc03aa7c4;p=modules%2Fvisu.git NPAL16752 (SIGSEGV on cutpanes, cutlines, plot3D on cronoshexa.med file): Throw user's exception instead of SIGSEGV. --- diff --git a/src/VISU_I/VISU_CutLines_i.cc b/src/VISU_I/VISU_CutLines_i.cc index 46132a1d..a74ed566 100644 --- a/src/VISU_I/VISU_CutLines_i.cc +++ b/src/VISU_I/VISU_CutLines_i.cc @@ -51,7 +51,12 @@ static int MYDEBUG = 0; int VISU::CutLines_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, int theIteration, int isMemoryCheck) { - return TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck); + if(!TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck)) + return 0; + if(!TSuperClass::IsCompatibleCellTypes(theResult,theMeshName,theEntity,theFieldName,theIteration)) + THROW_SALOME_CORBA_EXCEPTION("It is impossible to build presentation of this type,\nbecause of the source mesh contains not acceptable mesh elements!", + SALOME::INTERNAL_ERROR); + return 1; } int VISU::CutLines_i::myNbPresent = 0; diff --git a/src/VISU_I/VISU_CutPlanes_i.cc b/src/VISU_I/VISU_CutPlanes_i.cc index a23d15bf..684f7f3d 100644 --- a/src/VISU_I/VISU_CutPlanes_i.cc +++ b/src/VISU_I/VISU_CutPlanes_i.cc @@ -44,7 +44,12 @@ static int MYDEBUG = 0; int VISU::CutPlanes_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, int theIteration, int isMemoryCheck) { - return TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck); + if(!TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck)) + return 0; + if(!TSuperClass::IsCompatibleCellTypes(theResult,theMeshName,theEntity,theFieldName,theIteration)) + THROW_SALOME_CORBA_EXCEPTION("It is impossible to build presentation of this type,\nbecause of the source mesh contains not acceptable mesh elements!", + SALOME::INTERNAL_ERROR); + return 1; } diff --git a/src/VISU_I/VISU_Plot3D_i.cc b/src/VISU_I/VISU_Plot3D_i.cc index 396b3c97..94001b87 100644 --- a/src/VISU_I/VISU_Plot3D_i.cc +++ b/src/VISU_I/VISU_Plot3D_i.cc @@ -40,8 +40,12 @@ static int MYDEBUG = 0; int VISU::Plot3D_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, int theIteration, int isMemoryCheck) { - return TSuperClass::IsPossible - (theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck); + if(!TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck)) + return 0; + if(!TSuperClass::IsCompatibleCellTypes(theResult,theMeshName,theEntity,theFieldName,theIteration)) + THROW_SALOME_CORBA_EXCEPTION("It is impossible to build presentation of this type,\nbecause of the source mesh contains not acceptable mesh elements!", + SALOME::INTERNAL_ERROR); + return 1; } int VISU::Plot3D_i::myNbPresent = 0; diff --git a/src/VISU_I/VISU_StreamLines_i.cc b/src/VISU_I/VISU_StreamLines_i.cc index e3b8565b..b8449008 100644 --- a/src/VISU_I/VISU_StreamLines_i.cc +++ b/src/VISU_I/VISU_StreamLines_i.cc @@ -58,13 +58,19 @@ int VISU::StreamLines_i::IsPossible(Result_i* theResult, const char* theMeshName VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput(); bool aResult = VISU_StreamLinesPL::IsPossible(aDataSet); MESSAGE("StreamLines_i::IsPossible - aResult = "<