]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/SMESHDS/SMESHDS_Mesh.cxx
Salome HOME
0020714: EDF GHS3DPLUGIN: shapeToMesh when creating 3D mesh from 2D mesh
[modules/smesh.git] / src / SMESHDS / SMESHDS_Mesh.cxx
index 34118b82907afab02291f4d9651c74a35fa22e27..c4479f35bc73ff1ecfd6393020e580085c02ac55 100644 (file)
 #include "SMDS_SpacePosition.hxx"
 #include "SMESHDS_GroupOnGeom.hxx"
 
-#include <TopExp_Explorer.hxx>
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_OutOfRange.hxx>
 #include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
 #include <TopoDS_Iterator.hxx>
 
 #include "utilities.h"
@@ -1235,7 +1237,15 @@ int SMESHDS_Mesh::AddCompoundSubmesh(const TopoDS_Shape& S,
 //=======================================================================
 const TopoDS_Shape& SMESHDS_Mesh::IndexToShape(int ShapeIndex) const
 {
-        return myIndexToShape.FindKey(ShapeIndex);
+  try
+  {
+    return myIndexToShape.FindKey(ShapeIndex);
+  }
+  catch ( Standard_OutOfRange )
+  {
+  }
+  static TopoDS_Shape nullShape;
+  return nullShape;
 }
 
 //=======================================================================