From: eap Date: Fri, 27 Feb 2009 11:25:08 +0000 (+0000) Subject: 0020183: EDF SMESH 966 : Mesh element info anomaly X-Git-Tag: V4_1_5rc1~33 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f600e22b18153d7b2e660b4965b576de914bb07d;p=modules%2Fsmesh.git 0020183: EDF SMESH 966 : Mesh element info anomaly fix GetElemObjId() and GetNodeObjId: prevent out_of_range error if id==vector.size() --- diff --git a/src/OBJECT/SMESH_ExtractGeometry.cxx b/src/OBJECT/SMESH_ExtractGeometry.cxx index cebedd549..0376aba38 100644 --- a/src/OBJECT/SMESH_ExtractGeometry.cxx +++ b/src/OBJECT/SMESH_ExtractGeometry.cxx @@ -58,22 +58,14 @@ SMESH_ExtractGeometry::~SMESH_ExtractGeometry(){} vtkIdType SMESH_ExtractGeometry::GetElemObjId(int theVtkID){ - if(myElemVTK2ObjIds.empty() || theVtkID > myElemVTK2ObjIds.size()) return -1; -#if defined __GNUC_2__ + if( theVtkID < 0 || theVtkID >= myElemVTK2ObjIds.size()) return -1; return myElemVTK2ObjIds[theVtkID]; -#else - return myElemVTK2ObjIds.at(theVtkID); -#endif } vtkIdType SMESH_ExtractGeometry::GetNodeObjId(int theVtkID){ - if(myNodeVTK2ObjIds.empty() || theVtkID > myNodeVTK2ObjIds.size()) return -1; -#if defined __GNUC_2__ + if ( theVtkID < 0 || theVtkID >= myNodeVTK2ObjIds.size()) return -1; return myNodeVTK2ObjIds[theVtkID]; -#else - return myNodeVTK2ObjIds.at(theVtkID); -#endif }