]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
NPAL16752 (SIGSEGV on cutpanes, cutlines, plot3D on cronoshexa.med file):
authorakl <akl@opencascade.com>
Fri, 14 Sep 2007 15:54:52 +0000 (15:54 +0000)
committerakl <akl@opencascade.com>
Fri, 14 Sep 2007 15:54:52 +0000 (15:54 +0000)
Throw user's exception instead of SIGSEGV.

src/VISU_I/VISU_CutLines_i.cc
src/VISU_I/VISU_CutPlanes_i.cc
src/VISU_I/VISU_Plot3D_i.cc
src/VISU_I/VISU_StreamLines_i.cc

index 46132a1d989baa13238ad98f42235224770f648b..a74ed5660188d4c3ffcf87a5f9f48538cd5278db 100644 (file)
@@ -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;
index a23d15bfc6da15a6dcfb7fd6cbf4a27d5ce953e2..684f7f3dfc383b00e42f382f2c77f123f079d7d5 100644 (file)
@@ -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;
 }
 
 
index 396b3c97679fbb82a6683187b3eab64c9cb00b9f..94001b87a90e36eb5904bb16fdaf267a86c47a31 100644 (file)
@@ -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;
index e3b8565bedd66965a3bb2b30c8d7d75e9f264960..b8449008619f4f398d496f4097df8d2650c747c0 100644 (file)
@@ -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 = "<<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;
 }