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 "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"
|
||||
@ -1234,9 +1236,17 @@ int SMESHDS_Mesh::AddCompoundSubmesh(const TopoDS_Shape& S,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopoDS_Shape& SMESHDS_Mesh::IndexToShape(int ShapeIndex) const
|
||||
{
|
||||
try
|
||||
{
|
||||
return myIndexToShape.FindKey(ShapeIndex);
|
||||
}
|
||||
catch ( Standard_OutOfRange )
|
||||
{
|
||||
}
|
||||
static TopoDS_Shape nullShape;
|
||||
return nullShape;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeToIndex
|
||||
|
Loading…
Reference in New Issue
Block a user