mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-25 08:50:35 +05:00
protect IndexToShape() from Standard_OutOfRange exception
This commit is contained in:
parent
8d6ad56522
commit
3d1a536674
@ -34,8 +34,10 @@
|
|||||||
#include "SMDS_SpacePosition.hxx"
|
#include "SMDS_SpacePosition.hxx"
|
||||||
#include "SMESHDS_GroupOnGeom.hxx"
|
#include "SMESHDS_GroupOnGeom.hxx"
|
||||||
|
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
|
#include <Standard_OutOfRange.hxx>
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <TopoDS_Iterator.hxx>
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
@ -1235,7 +1237,15 @@ int SMESHDS_Mesh::AddCompoundSubmesh(const TopoDS_Shape& S,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
const TopoDS_Shape& SMESHDS_Mesh::IndexToShape(int ShapeIndex) const
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user