Throw user's exception instead of SIGSEGV.
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;
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;
}
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;
VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
bool aResult = VISU_StreamLinesPL::IsPossible(aDataSet);
MESSAGE("StreamLines_i::IsPossible - aResult = "<<aResult);
- return aResult;
+ if(!aResult)
+ return 0;
}catch(std::exception& exc){
INFOS("Follow exception was occured :\n"<<exc.what());
+ return 0;
}catch(...){
INFOS("Unknown exception was occured!");
+ return 0;
}
- 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;
}